From 7d712a59283fb028feb6c9ff1c27212db2f1b5b8 Mon Sep 17 00:00:00 2001
Message-Id: <7d712a59283fb028feb6c9ff1c27212db2f1b5b8.1614897969.git.bubu@ujevangelizacio.hu>
From: =?UTF-8?q?Gyuris=20Gell=C3=A9rt?= <bubu@ujevangelizacio.hu>
Date: Thu, 4 Mar 2021 23:46:00 +0100
Subject: [PATCH] Update layout for Text Properties: unify buttons, layout, new
 label icons

---
 scribus/ui/alignselect.cpp                 |  19 ++-
 scribus/ui/directionselect.cpp             |  10 +-
 scribus/ui/propertiespalette_text.cpp      |   6 +-
 scribus/ui/propertiespalette_textbase.ui   | 173 ++++++++++++++++-----
 scribus/ui/propertywidget_advancedbase.ui  |  84 ++++++++++
 scribus/ui/propertywidget_textcolorbase.ui | 108 +++++++++++++
 6 files changed, 348 insertions(+), 52 deletions(-)

diff --git a/scribus/ui/alignselect.cpp b/scribus/ui/alignselect.cpp
index f328aac5c..77b256576 100644
--- a/scribus/ui/alignselect.cpp
+++ b/scribus/ui/alignselect.cpp
@@ -22,11 +22,12 @@ AlignSelect::AlignSelect(QWidget* parent) : QWidget(parent)
 	buttonGroup = new QButtonGroup(this);
 
 	GroupAlignLayout = new QHBoxLayout( this );
-	GroupAlignLayout->setSpacing( 0 );
-	GroupAlignLayout->setMargin( 0 );
+	GroupAlignLayout->setSpacing(3);
+	GroupAlignLayout->setContentsMargins(0, 0, 0, 0);
 
 	TextL = new QToolButton( this );
-	TextL->setMaximumSize( QSize( 22, 22 ) );
+	TextL->setMaximumSize( QSize(24, 24) );
+	TextL->setMinimumSize( QSize(24, 24) );
 	TextL->setIcon(im.loadIcon("16/format-justify-left.png"));
 	TextL->setCheckable( true );
 	TextL->setChecked( true );
@@ -34,28 +35,32 @@ AlignSelect::AlignSelect(QWidget* parent) : QWidget(parent)
 	buttonGroup->addButton(TextL, 0);
 
 	TextC = new QToolButton( this );
-	TextC->setMaximumSize( QSize( 22, 22 ) );
+	TextC->setMaximumSize( QSize(24, 24) );
+	TextC->setMinimumSize( QSize(24, 24) );
 	TextC->setIcon(im.loadIcon("16/format-justify-center.png"));
 	TextC->setCheckable( true );
 	GroupAlignLayout->addWidget( TextC );
 	buttonGroup->addButton(TextC, 1);
 
 	TextR = new QToolButton( this );
-	TextR->setMaximumSize( QSize( 22, 22 ) );
+	TextR->setMaximumSize( QSize(24, 24) );
+	TextR->setMinimumSize( QSize(24, 24) );
 	TextR->setIcon(im.loadIcon("16/format-justify-right.png"));
 	TextR->setCheckable( true );
 	GroupAlignLayout->addWidget( TextR );
 	buttonGroup->addButton(TextR, 2);
 
 	TextB = new QToolButton( this );
-	TextB->setMaximumSize( QSize( 22, 22 ) );
+	TextB->setMaximumSize( QSize(24, 24) );
+	TextB->setMinimumSize( QSize(24, 24) );
 	TextB->setIcon(im.loadIcon("16/format-justify-fill-block.png"));
 	TextB->setCheckable( true );
 	GroupAlignLayout->addWidget( TextB );
 	buttonGroup->addButton(TextB, 3);
 
 	TextF = new QToolButton( this );
-	TextF->setMaximumSize( QSize( 22, 22 ) );
+	TextF->setMaximumSize( QSize(24, 24) );
+	TextF->setMinimumSize( QSize(24, 24) );
 	TextF->setIcon(im.loadIcon("16/format-justify-fill.png"));
 	TextF->setCheckable( true );
 	GroupAlignLayout->addWidget( TextF );
diff --git a/scribus/ui/directionselect.cpp b/scribus/ui/directionselect.cpp
index 8fa132cf7..44a78a0ba 100644
--- a/scribus/ui/directionselect.cpp
+++ b/scribus/ui/directionselect.cpp
@@ -18,12 +18,13 @@ DirectionSelect::DirectionSelect(QWidget* parent) : QWidget(parent)
 	buttonGroup = new QButtonGroup(this);
 
 	groupSelectLayout = new QHBoxLayout( this );
-	groupSelectLayout->setSpacing( 0 );
-	groupSelectLayout->setMargin( 5 );
+	groupSelectLayout->setSpacing(3);
+	groupSelectLayout->setContentsMargins(6, 0, 6, 0);
 	groupSelectLayout->setAlignment(Qt::AlignRight);
 
 	LTR = new QToolButton( this );
-	LTR->setMaximumSize( QSize( 22, 22 ) );
+	LTR->setMaximumSize( QSize(24, 24) );
+	LTR->setMinimumSize( QSize(24, 24) );
 	LTR->setIcon(IconManager::instance().loadIcon("16/text-direction-ltr.png"));
 	LTR->setCheckable( true );
 	LTR->setChecked( true );
@@ -31,7 +32,8 @@ DirectionSelect::DirectionSelect(QWidget* parent) : QWidget(parent)
 	buttonGroup->addButton(LTR, 0);
 
 	RTL = new QToolButton( this );
-	RTL->setMaximumSize( QSize( 22, 22 ) );
+	RTL->setMaximumSize( QSize(24, 24) );
+	RTL->setMinimumSize( QSize(24, 24) );
 	RTL->setIcon(IconManager::instance().loadIcon("16/text-direction-rtl.png"));
 	RTL->setCheckable( true );
 	groupSelectLayout->addWidget( RTL );
diff --git a/scribus/ui/propertiespalette_text.cpp b/scribus/ui/propertiespalette_text.cpp
index 0b051faf6..360f3f787 100644
--- a/scribus/ui/propertiespalette_text.cpp
+++ b/scribus/ui/propertiespalette_text.cpp
@@ -58,10 +58,12 @@ PropertiesPalette_Text::PropertiesPalette_Text( QWidget* parent) : QWidget(paren
 	fontSize->setPrefix( "" );
 	fontSizeLabel->setPixmap(IconManager::instance().loadPixmap("zeichen.png"));
 	lineSpacingLabel->setPixmap(IconManager::instance().loadPixmap("linespacing2.png"));
+	textAlignmentLabel->setPixmap(IconManager::instance().loadPixmap("22/text-align.png"));
+	langLabel->setPixmap(IconManager::instance().loadPixmap("22/language.png"));
+	paraStyleLabel->setPixmap(IconManager::instance().loadPixmap("22/paragraph-style.png"));
+	charStyleLabel->setPixmap(IconManager::instance().loadPixmap("22/character-style.png"));
 
-	paraStyleLabel->setBuddy(paraStyleCombo);
 	paraStyleClear->setIcon(IconManager::instance().loadPixmap("16/edit-clear.png"));
-	charStyleLabel->setBuddy(charStyleCombo);
 	charStyleClear->setIcon(IconManager::instance().loadPixmap("16/edit-clear.png"));
 
 	colorWidgets = new PropertyWidget_TextColor(textTree);
diff --git a/scribus/ui/propertiespalette_textbase.ui b/scribus/ui/propertiespalette_textbase.ui
index b38e3f796..5d4a9338f 100644
--- a/scribus/ui/propertiespalette_textbase.ui
+++ b/scribus/ui/propertiespalette_textbase.ui
@@ -40,11 +40,23 @@
      <item>
       <widget class="QLabel" name="fontSizeLabel">
        <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
@@ -74,13 +86,6 @@
      </item>
     </layout>
    </item>
-   <item>
-    <widget class="Line" name="line_3">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout_2">
      <property name="spacing">
@@ -94,6 +99,18 @@
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
@@ -138,12 +155,37 @@
      <property name="spacing">
       <number>3</number>
      </property>
-     <item alignment="Qt::AlignLeft">
-      <widget class="DirectionSelect" name="textDirection" native="true"/>
+     <item>
+      <widget class="QLabel" name="textAlignmentLabel">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+      </widget>
      </item>
      <item>
       <widget class="AlignSelect" name="textAlignment" native="true"/>
      </item>
+     <item alignment="Qt::AlignLeft">
+      <widget class="DirectionSelect" name="textDirection" native="true"/>
+     </item>
      <item>
       <spacer name="horizontalSpacer_2">
        <property name="orientation">
@@ -157,8 +199,46 @@
        </property>
       </spacer>
      </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_6">
+     <property name="spacing">
+      <number>3</number>
+     </property>
+     <item>
+      <widget class="QLabel" name="langLabel">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+      </widget>
+     </item>
      <item>
       <widget class="QComboBox" name="langCombo">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
        <property name="toolTip">
         <string>Text Language</string>
        </property>
@@ -169,20 +249,6 @@
      </item>
     </layout>
    </item>
-   <item>
-    <layout class="QHBoxLayout" name="horizontalLayout_6">
-     <property name="spacing">
-      <number>3</number>
-     </property>
-    </layout>
-   </item>
-   <item>
-    <widget class="Line" name="line">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
    <item>
     <layout class="QHBoxLayout" name="horizontalLayout_3">
      <property name="spacing">
@@ -191,13 +257,25 @@
      <item>
       <widget class="QLabel" name="paraStyleLabel">
        <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
-        <string>Paragraph St&amp;yle:</string>
+        <string/>
        </property>
        <property name="pixmap">
         <pixmap>../../resources/icons/zeichen.png</pixmap>
@@ -219,10 +297,16 @@
      </item>
      <item>
       <widget class="QToolButton" name="paraStyleClear">
+       <property name="minimumSize">
+        <size>
+         <width>24</width>
+         <height>24</height>
+        </size>
+       </property>
        <property name="maximumSize">
         <size>
-         <width>22</width>
-         <height>22</height>
+         <width>24</width>
+         <height>24</height>
         </size>
        </property>
        <property name="toolTip">
@@ -247,13 +331,25 @@
      <item>
       <widget class="QLabel" name="charStyleLabel">
        <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
-        <string>Character St&amp;yle:</string>
+        <string/>
        </property>
        <property name="pixmap">
         <pixmap>../../resources/icons/zeichen.png</pixmap>
@@ -275,10 +371,16 @@
      </item>
      <item>
       <widget class="QToolButton" name="charStyleClear">
+       <property name="minimumSize">
+        <size>
+         <width>24</width>
+         <height>24</height>
+        </size>
+       </property>
        <property name="maximumSize">
         <size>
-         <width>22</width>
-         <height>22</height>
+         <width>24</width>
+         <height>24</height>
         </size>
        </property>
        <property name="toolTip">
@@ -295,13 +397,6 @@
      </item>
     </layout>
    </item>
-   <item>
-    <widget class="Line" name="line_2">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
    <item>
     <widget class="ScTreeWidget" name="textTree">
      <column>
diff --git a/scribus/ui/propertywidget_advancedbase.ui b/scribus/ui/propertywidget_advancedbase.ui
index baafb2167..6250bd082 100644
--- a/scribus/ui/propertywidget_advancedbase.ui
+++ b/scribus/ui/propertywidget_advancedbase.ui
@@ -37,9 +37,30 @@
    </property>
    <item row="0" column="0">
     <widget class="QLabel" name="textBaseLabel">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumSize">
+      <size>
+       <width>22</width>
+       <height>22</height>
+      </size>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>16777215</width>
+       <height>22</height>
+      </size>
+     </property>
      <property name="text">
       <string/>
      </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
     </widget>
    </item>
    <item row="0" column="1">
@@ -60,9 +81,30 @@
    </item>
    <item row="0" column="2">
     <widget class="QLabel" name="trackingLabel">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumSize">
+      <size>
+       <width>22</width>
+       <height>22</height>
+      </size>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>16777215</width>
+       <height>22</height>
+      </size>
+     </property>
      <property name="text">
       <string/>
      </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
     </widget>
    </item>
    <item row="0" column="3">
@@ -77,9 +119,30 @@
    </item>
    <item row="1" column="0">
     <widget class="QLabel" name="scaleHLabel">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumSize">
+      <size>
+       <width>22</width>
+       <height>22</height>
+      </size>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>16777215</width>
+       <height>22</height>
+      </size>
+     </property>
      <property name="text">
       <string/>
      </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
     </widget>
    </item>
    <item row="1" column="1">
@@ -94,9 +157,30 @@
    </item>
    <item row="1" column="2">
     <widget class="QLabel" name="scaleVLabel">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumSize">
+      <size>
+       <width>22</width>
+       <height>22</height>
+      </size>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>16777215</width>
+       <height>22</height>
+      </size>
+     </property>
      <property name="text">
       <string/>
      </property>
+     <property name="alignment">
+      <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+     </property>
     </widget>
    </item>
    <item row="1" column="3">
diff --git a/scribus/ui/propertywidget_textcolorbase.ui b/scribus/ui/propertywidget_textcolorbase.ui
index 950184770..d8a1aff67 100644
--- a/scribus/ui/propertywidget_textcolorbase.ui
+++ b/scribus/ui/propertywidget_textcolorbase.ui
@@ -36,6 +36,24 @@
      </property>
      <item>
       <widget class="QLabel" name="fillIcon">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
@@ -59,6 +77,24 @@
      </item>
      <item>
       <widget class="QLabel" name="fillShadeLabel">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
@@ -86,6 +122,24 @@
      </property>
      <item>
       <widget class="QLabel" name="strokeIcon">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
@@ -112,6 +166,24 @@
      </item>
      <item>
       <widget class="QLabel" name="strokeShadeLabel">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
@@ -139,6 +211,24 @@
      </property>
      <item>
       <widget class="QLabel" name="backIcon">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
@@ -162,6 +252,24 @@
      </item>
      <item>
       <widget class="QLabel" name="backShadeLabel">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
-- 
2.27.0

