From 293b4fa9d5c112e3708fce08469c8b16a3f05410 Mon Sep 17 00:00:00 2001
Message-Id: <293b4fa9d5c112e3708fce08469c8b16a3f05410.1615755617.git.bubu@ujevangelizacio.hu>
From: =?UTF-8?q?Gyuris=20Gell=C3=A9rt?= <bubu@ujevangelizacio.hu>
Date: Sun, 14 Mar 2021 22:00:05 +0100
Subject: [PATCH] Update layout for Text Properties: unify buttons, layout, new
 label icons

---
 scribus/ui/alignselect.cpp                 |   7 +-
 scribus/ui/directionselect.cpp             |   6 +-
 scribus/ui/propertiespalette_text.cpp      |   6 +-
 scribus/ui/propertiespalette_textbase.ui   | 163 +++++++++++++--------
 scribus/ui/propertywidget_advancedbase.ui  |  64 +++++++-
 scribus/ui/propertywidget_textcolorbase.ui |  74 +++++++++-
 scribus/ui/smalignselect.cpp               |   1 -
 scribus/ui/smdirectionselect.cpp           |   1 -
 8 files changed, 241 insertions(+), 81 deletions(-)

diff --git a/scribus/ui/alignselect.cpp b/scribus/ui/alignselect.cpp
index 674290429..0a0fd87f2 100644
--- a/scribus/ui/alignselect.cpp
+++ b/scribus/ui/alignselect.cpp
@@ -22,11 +22,10 @@ AlignSelect::AlignSelect(QWidget* parent) : QWidget(parent)
 	buttonGroup = new QButtonGroup(this);
 
 	GroupAlignLayout = new QHBoxLayout( this );
-	GroupAlignLayout->setSpacing( 0 );
+	GroupAlignLayout->setSpacing(3);
 	GroupAlignLayout->setContentsMargins(0, 0, 0, 0);
 
 	TextL = new QToolButton( this );
-	TextL->setMaximumSize( QSize( 22, 22 ) );
 	TextL->setIcon(im.loadIcon("16/format-justify-left.png"));
 	TextL->setCheckable( true );
 	TextL->setChecked( true );
@@ -34,28 +33,24 @@ AlignSelect::AlignSelect(QWidget* parent) : QWidget(parent)
 	buttonGroup->addButton(TextL, 0);
 
 	TextC = new QToolButton( this );
-	TextC->setMaximumSize( QSize( 22, 22 ) );
 	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->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->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->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 4c5ff48cd..2a592878e 100644
--- a/scribus/ui/directionselect.cpp
+++ b/scribus/ui/directionselect.cpp
@@ -18,12 +18,11 @@ DirectionSelect::DirectionSelect(QWidget* parent) : QWidget(parent)
 	buttonGroup = new QButtonGroup(this);
 
 	groupSelectLayout = new QHBoxLayout( this );
-	groupSelectLayout->setSpacing( 0 );
-	groupSelectLayout->setContentsMargins(5, 5, 5, 5);
+	groupSelectLayout->setSpacing(3);
+	groupSelectLayout->setContentsMargins(6, 0, 6, 0);
 	groupSelectLayout->setAlignment(Qt::AlignRight);
 
 	LTR = new QToolButton( this );
-	LTR->setMaximumSize( QSize( 22, 22 ) );
 	LTR->setIcon(IconManager::instance().loadIcon("16/text-direction-ltr.png"));
 	LTR->setCheckable( true );
 	LTR->setChecked( true );
@@ -31,7 +30,6 @@ DirectionSelect::DirectionSelect(QWidget* parent) : QWidget(parent)
 	buttonGroup->addButton(LTR, 0);
 
 	RTL = new QToolButton( this );
-	RTL->setMaximumSize( QSize( 22, 22 ) );
 	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..68fdbcedf 100644
--- a/scribus/ui/propertiespalette_textbase.ui
+++ b/scribus/ui/propertiespalette_textbase.ui
@@ -39,11 +39,17 @@
      </property>
      <item>
       <widget class="QLabel" name="fontSizeLabel">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
+       <property name="minimumSize">
+        <size>
+         <width>20</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
        </property>
        <property name="text">
         <string/>
@@ -74,13 +80,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">
@@ -88,11 +87,17 @@
      </property>
      <item>
       <widget class="QLabel" name="lineSpacingLabel">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
+       <property name="minimumSize">
+        <size>
+         <width>20</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
        </property>
        <property name="text">
         <string/>
@@ -138,12 +143,31 @@
      <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="minimumSize">
+        <size>
+         <width>20</width>
+         <height>0</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 +181,40 @@
        </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="minimumSize">
+        <size>
+         <width>20</width>
+         <height>0</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 +225,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">
@@ -190,14 +232,20 @@
      </property>
      <item>
       <widget class="QLabel" name="paraStyleLabel">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
+       <property name="minimumSize">
+        <size>
+         <width>20</width>
+         <height>0</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,12 +267,6 @@
      </item>
      <item>
       <widget class="QToolButton" name="paraStyleClear">
-       <property name="maximumSize">
-        <size>
-         <width>22</width>
-         <height>22</height>
-        </size>
-       </property>
        <property name="toolTip">
         <string>Remove Direct Paragraph Formatting</string>
        </property>
@@ -246,14 +288,20 @@
      </property>
      <item>
       <widget class="QLabel" name="charStyleLabel">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
+       <property name="minimumSize">
+        <size>
+         <width>20</width>
+         <height>0</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,12 +323,6 @@
      </item>
      <item>
       <widget class="QToolButton" name="charStyleClear">
-       <property name="maximumSize">
-        <size>
-         <width>22</width>
-         <height>22</height>
-        </size>
-       </property>
        <property name="toolTip">
         <string>Remove Direct Character Formatting</string>
        </property>
@@ -295,13 +337,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..bf954c091 100644
--- a/scribus/ui/propertywidget_advancedbase.ui
+++ b/scribus/ui/propertywidget_advancedbase.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>239</width>
-    <height>155</height>
+    <width>278</width>
+    <height>161</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -37,9 +37,24 @@
    </property>
    <item row="0" column="0">
     <widget class="QLabel" name="textBaseLabel">
+     <property name="minimumSize">
+      <size>
+       <width>20</width>
+       <height>0</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 +75,24 @@
    </item>
    <item row="0" column="2">
     <widget class="QLabel" name="trackingLabel">
+     <property name="minimumSize">
+      <size>
+       <width>20</width>
+       <height>0</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 +107,24 @@
    </item>
    <item row="1" column="0">
     <widget class="QLabel" name="scaleHLabel">
+     <property name="minimumSize">
+      <size>
+       <width>20</width>
+       <height>0</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 +139,24 @@
    </item>
    <item row="1" column="2">
     <widget class="QLabel" name="scaleVLabel">
+     <property name="minimumSize">
+      <size>
+       <width>20</width>
+       <height>0</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..ee92357bd 100644
--- a/scribus/ui/propertywidget_textcolorbase.ui
+++ b/scribus/ui/propertywidget_textcolorbase.ui
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>147</width>
+    <width>167</width>
     <height>135</height>
    </rect>
   </property>
@@ -36,6 +36,18 @@
      </property>
      <item>
       <widget class="QLabel" name="fillIcon">
+       <property name="minimumSize">
+        <size>
+         <width>20</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
@@ -59,6 +71,18 @@
      </item>
      <item>
       <widget class="QLabel" name="fillShadeLabel">
+       <property name="minimumSize">
+        <size>
+         <width>20</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
@@ -86,6 +110,18 @@
      </property>
      <item>
       <widget class="QLabel" name="strokeIcon">
+       <property name="minimumSize">
+        <size>
+         <width>20</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
@@ -112,6 +148,18 @@
      </item>
      <item>
       <widget class="QLabel" name="strokeShadeLabel">
+       <property name="minimumSize">
+        <size>
+         <width>20</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
@@ -139,6 +187,18 @@
      </property>
      <item>
       <widget class="QLabel" name="backIcon">
+       <property name="minimumSize">
+        <size>
+         <width>20</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
@@ -162,6 +222,18 @@
      </item>
      <item>
       <widget class="QLabel" name="backShadeLabel">
+       <property name="minimumSize">
+        <size>
+         <width>20</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
        <property name="text">
         <string/>
        </property>
diff --git a/scribus/ui/smalignselect.cpp b/scribus/ui/smalignselect.cpp
index cdb7ea940..90164afb8 100644
--- a/scribus/ui/smalignselect.cpp
+++ b/scribus/ui/smalignselect.cpp
@@ -12,7 +12,6 @@ SMAlignSelect::SMAlignSelect(QWidget *parent)
 	: AlignSelect(parent)
 {
 	parentButton = new QToolButton(this);
-	parentButton->setMaximumSize( QSize( 22, 22 ) );
 	parentButton->setCheckable( true );
 	parentButton->setText( tr("P", "P as in Parent"));
 	parentButton->setToolTip( tr("Use parent style's alignment instead of overriding it"));
diff --git a/scribus/ui/smdirectionselect.cpp b/scribus/ui/smdirectionselect.cpp
index d54df49ed..c0334af70 100644
--- a/scribus/ui/smdirectionselect.cpp
+++ b/scribus/ui/smdirectionselect.cpp
@@ -4,7 +4,6 @@ SMDirectionSelect::SMDirectionSelect(QWidget *parent)
 : DirectionSelect(parent)
 {
 	parentButton = new QToolButton(this);
-	parentButton->setMaximumSize( QSize( 22, 22 ) );
 	parentButton->setCheckable( true );
 	parentButton->setText( tr("P", "P as in Parent"));
 	parentButton->setToolTip( tr("Use parent style's direction instead of overriding it"));
-- 
2.27.0

