r20289 by craig - #13263: Substitute Link checkbox with chain link button in Preferences

scribus-commit scribus-commit at lists.scribus.net
Tue Jul 28 21:45:54 UTC 2015


Author: craig
Date: Tue Jul 28 21:45:54 2015
New Revision: 20289

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20289
Log:
#13263: Substitute Link checkbox with chain link button in Preferences

Modified:
    trunk/Scribus/scribus/ui/newmarginwidget.cpp
    trunk/Scribus/scribus/ui/newmarginwidgetbase.ui

Modified: trunk/Scribus/scribus/ui/newmarginwidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20289&path=/trunk/Scribus/scribus/ui/newmarginwidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/newmarginwidget.cpp (original)
+++ trunk/Scribus/scribus/ui/newmarginwidget.cpp Tue Jul 28 21:45:54 2015
@@ -49,19 +49,19 @@
 		presetLayoutLabel->resize(0,0);
 		presetLayoutComboBox->hide();
 		presetLayoutLabel->hide();
-		formLayout->removeWidget(presetLayoutComboBox);
-		formLayout->removeWidget(presetLayoutLabel);
+		gridLayout->removeWidget(presetLayoutComboBox);
+		gridLayout->removeWidget(presetLayoutLabel);
 	}
 	if (!showPrinterMargins)
 	{
 		printerMarginsPushButton->blockSignals(true);
 		printerMarginsPushButton->resize(0,0);
 		printerMarginsPushButton->hide();
-		formLayout->removeWidget(printerMarginsPushButton);
+		gridLayout->removeWidget(printerMarginsPushButton);
 	}
 	setFacingPages(!(layoutType == singlePage));
 
-	formLayout->invalidate();
+	gridLayout->invalidate();
 
 	languageChange();
 
@@ -70,7 +70,7 @@
 	connect(leftMarginSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setLeft()));
 	connect(rightMarginSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setRight()));
 	connect(presetLayoutComboBox, SIGNAL(activated(int)), this, SLOT(setPreset()));
-	connect(marginLinkCheckBox, SIGNAL(clicked()), this, SLOT(slotLinkMargins()));
+	connect(marginLinkButton, SIGNAL(clicked()), this, SLOT(slotLinkMargins()));
 	connect(printerMarginsPushButton, SIGNAL(clicked()), this, SLOT(setMarginsToPrinterMargins()));
 }
 
@@ -109,7 +109,7 @@
 {
 	double newVal=topMarginSpinBox->value() / m_unitRatio;
 	bottomMarginSpinBox->setMaximum(qMax(0.0, pageHeight * m_unitRatio - topMarginSpinBox->value()));
-	if (marginLinkCheckBox->isChecked() && savedPresetItem==PresetLayout::none)
+	if (marginLinkButton->isChecked() && savedPresetItem==PresetLayout::none)
 	{
 		marginData.set(newVal, newVal, newVal, newVal);
 		updateMarginSpinValues();
@@ -123,7 +123,7 @@
 {
 	double newVal = bottomMarginSpinBox->value() / m_unitRatio;
 	topMarginSpinBox->setMaximum(qMax(0.0, pageHeight * m_unitRatio - bottomMarginSpinBox->value()));
-	if (marginLinkCheckBox->isChecked() && savedPresetItem==PresetLayout::none)
+	if (marginLinkButton->isChecked() && savedPresetItem==PresetLayout::none)
 	{
 		marginData.set(newVal, newVal, newVal, newVal);
 		updateMarginSpinValues();
@@ -137,7 +137,7 @@
 {
 	double newVal = leftMarginSpinBox->value() / m_unitRatio;
 	rightMarginSpinBox->setMaximum(qMax(0.0, pageWidth * m_unitRatio - leftMarginSpinBox->value()));
-	if (marginLinkCheckBox->isChecked() && savedPresetItem==PresetLayout::none)
+	if (marginLinkButton->isChecked() && savedPresetItem==PresetLayout::none)
 	{
 		marginData.set(newVal, newVal, newVal, newVal);
 		updateMarginSpinValues();
@@ -151,7 +151,7 @@
 {
 	double newVal = rightMarginSpinBox->value() / m_unitRatio;
 	leftMarginSpinBox->setMaximum(qMax(0.0, pageWidth * m_unitRatio - rightMarginSpinBox->value()));
-	if (marginLinkCheckBox->isChecked() && savedPresetItem==PresetLayout::none)
+	if (marginLinkButton->isChecked() && savedPresetItem==PresetLayout::none)
 	{
 		marginData.set(newVal, newVal, newVal, newVal);
 		updateMarginSpinValues();
@@ -224,8 +224,8 @@
 		rightMarginSpinBox->setEnabled(false);
 	leftMarginSpinBox->setEnabled(item != PresetLayout::nineparts);
 	if (item!=PresetLayout::none)
-		marginLinkCheckBox->setChecked(false);
-	marginLinkCheckBox->setEnabled(item==PresetLayout::none || !presetLayoutComboBox->isEnabled());
+		marginLinkButton->setChecked(false);
+	marginLinkButton->setEnabled(item==PresetLayout::none || !presetLayoutComboBox->isEnabled());
 	leftMarginSpinBox->blockSignals(false);
 	rightMarginSpinBox->blockSignals(false);
 	topMarginSpinBox->blockSignals(false);
@@ -264,7 +264,7 @@
 	bool topBlocked = topMarginSpinBox->blockSignals(true);
 	bool bottomBlocked = bottomMarginSpinBox->blockSignals(true);
 
-	if (marginLinkCheckBox->isChecked())
+	if (marginLinkButton->isChecked())
 	{
 		bottomMarginSpinBox->setValue(leftMarginSpinBox->value());
 		topMarginSpinBox->setValue(leftMarginSpinBox->value());
@@ -311,8 +311,8 @@
 		rightMarginSpinBox->setEnabled(false);
 	leftMarginSpinBox->setEnabled(item != PresetLayout::nineparts);
 	if (item!=PresetLayout::none)
-		marginLinkCheckBox->setChecked(false);
-	marginLinkCheckBox->setEnabled(item==PresetLayout::none);
+		marginLinkButton->setChecked(false);
+	marginLinkButton->setEnabled(item==PresetLayout::none);
 	presetLayoutComboBox->blockSignals(false);
 }
 

Modified: trunk/Scribus/scribus/ui/newmarginwidgetbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20289&path=/trunk/Scribus/scribus/ui/newmarginwidgetbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/newmarginwidgetbase.ui (original)
+++ trunk/Scribus/scribus/ui/newmarginwidgetbase.ui Tue Jul 28 21:45:54 2015
@@ -19,25 +19,93 @@
   <property name="windowTitle">
    <string>Form</string>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <property name="leftMargin">
-    <number>0</number>
-   </property>
-   <property name="topMargin">
-    <number>0</number>
-   </property>
-   <property name="rightMargin">
-    <number>0</number>
-   </property>
-   <property name="bottomMargin">
-    <number>0</number>
-   </property>
-   <item>
-    <layout class="QFormLayout" name="formLayout">
+  <layout class="QGridLayout" name="gridLayout_2">
+   <item row="0" column="0">
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="4" column="0">
+      <widget class="QLabel" name="bottomMarginLabel">
+       <property name="text">
+        <string>Bottom:</string>
+       </property>
+       <property name="buddy">
+        <cstring>bottomMarginSpinBox</cstring>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0">
+      <widget class="QLabel" name="leftMarginLabel">
+       <property name="text">
+        <string>Left:</string>
+       </property>
+       <property name="buddy">
+        <cstring>leftMarginSpinBox</cstring>
+       </property>
+      </widget>
+     </item>
+     <item row="4" column="1">
+      <widget class="ScrSpinBox" name="bottomMarginSpinBox">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="0">
+      <widget class="QLabel" name="rightMarginLabel">
+       <property name="text">
+        <string>Right:</string>
+       </property>
+       <property name="buddy">
+        <cstring>rightMarginSpinBox</cstring>
+       </property>
+      </widget>
+     </item>
      <item row="0" column="0">
       <widget class="QLabel" name="presetLayoutLabel">
        <property name="text">
         <string>Preset Layouts:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="0">
+      <widget class="QLabel" name="topMarginLabel">
+       <property name="text">
+        <string>Top:</string>
+       </property>
+       <property name="buddy">
+        <cstring>topMarginSpinBox</cstring>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="ScrSpinBox" name="leftMarginSpinBox">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1">
+      <widget class="ScrSpinBox" name="rightMarginSpinBox">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="1">
+      <widget class="ScrSpinBox" name="topMarginSpinBox">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
        </property>
       </widget>
      </item>
@@ -51,100 +119,41 @@
        </property>
       </widget>
      </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="leftMarginLabel">
+     <item row="5" column="1">
+      <widget class="QPushButton" name="printerMarginsPushButton">
        <property name="text">
-        <string>Left:</string>
-       </property>
-       <property name="buddy">
-        <cstring>leftMarginSpinBox</cstring>
+        <string>Printer Margins...</string>
        </property>
       </widget>
      </item>
-     <item row="2" column="1">
-      <widget class="ScrSpinBox" name="leftMarginSpinBox">
+     <item row="1" column="2" rowspan="4">
+      <widget class="LinkButton" name="marginLinkButton">
        <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
-      </widget>
-     </item>
-     <item row="3" column="0">
-      <widget class="QLabel" name="rightMarginLabel">
-       <property name="text">
-        <string>Right:</string>
+       <property name="minimumSize">
+        <size>
+         <width>15</width>
+         <height>0</height>
+        </size>
        </property>
-       <property name="buddy">
-        <cstring>rightMarginSpinBox</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="3" column="1">
-      <widget class="ScrSpinBox" name="rightMarginSpinBox">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-      </widget>
-     </item>
-     <item row="4" column="0">
-      <widget class="QLabel" name="topMarginLabel">
-       <property name="text">
-        <string>Top:</string>
-       </property>
-       <property name="buddy">
-        <cstring>topMarginSpinBox</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="4" column="1">
-      <widget class="ScrSpinBox" name="topMarginSpinBox">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-      </widget>
-     </item>
-     <item row="5" column="0">
-      <widget class="QLabel" name="bottomMarginLabel">
-       <property name="text">
-        <string>Bottom:</string>
-       </property>
-       <property name="buddy">
-        <cstring>bottomMarginSpinBox</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="5" column="1">
-      <widget class="ScrSpinBox" name="bottomMarginSpinBox">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-      </widget>
-     </item>
-     <item row="6" column="1">
-      <widget class="QCheckBox" name="marginLinkCheckBox">
        <property name="toolTip">
         <string>Ensure all margins have the same value</string>
        </property>
        <property name="text">
-        <string>Link</string>
+        <string/>
        </property>
-      </widget>
-     </item>
-     <item row="7" column="1">
-      <widget class="QPushButton" name="printerMarginsPushButton">
-       <property name="text">
-        <string>Printer Margins...</string>
+       <property name="checkable">
+        <bool>true</bool>
+       </property>
+       <property name="toolButtonStyle">
+        <enum>Qt::ToolButtonIconOnly</enum>
+       </property>
+       <property name="autoRaise">
+        <bool>true</bool>
        </property>
       </widget>
      </item>
@@ -159,6 +168,11 @@
    <header location="global">ui/scrspinbox.h</header>
   </customwidget>
   <customwidget>
+   <class>LinkButton</class>
+   <extends>QToolButton</extends>
+   <header>ui/linkbutton.h</header>
+  </customwidget>
+  <customwidget>
    <class>PresetLayout</class>
    <extends>QComboBox</extends>
    <header location="global">ui/marginpresetlayout.h</header>




More information about the scribus-commit mailing list