View Issue Details

IDProjectCategoryView StatusLast Update
0013263ScribusUser Interfacepublic2015-07-28 22:23
ReporterFirasH Assigned ToFirasH  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version1.5.1svn 
Fixed in Version1.5.1svn 
Summary0013263: Substitute "Link" checkbox with chain link button in Preferences
DescriptionSubstitute "Link" checkbox with chain link button in Preferences.
See attached screenshot. The patch is tested.
Additional Information1.5.1.svn (20287)
TagsNo tags attached.
PatchYes

Activities

FirasH

2015-07-28 02:17

developer  

13263-Patch.diff (11,283 bytes)   

diff --git a/scribus/ui/newmarginwidget.cpp b/scribus/ui/newmarginwidget.cpp
--- a/scribus/ui/newmarginwidget.cpp
+++ b/scribus/ui/newmarginwidget.cpp
@@ -49,8 +49,8 @@
 		presetLayoutLabel->resize(0,0);
 		presetLayoutComboBox->hide();
 		presetLayoutLabel->hide();
-		formLayout->removeWidget(presetLayoutComboBox);
-		formLayout->removeWidget(presetLayoutLabel);
+		gridLayout->removeWidget(presetLayoutComboBox);
+		gridLayout->removeWidget(presetLayoutLabel);
 	}
 	if (!showPrinterMargins)
 	{
@@ -57,11 +57,11 @@
 		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);
 }
 
diff --git a/scribus/ui/newmarginwidgetbase.ui b/scribus/ui/newmarginwidgetbase.ui
--- a/scribus/ui/newmarginwidgetbase.ui
+++ b/scribus/ui/newmarginwidgetbase.ui
@@ -19,39 +19,20 @@
   <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">
-     <item row="0" column="0">
-      <widget class="QLabel" name="presetLayoutLabel">
+  <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>Preset Layouts:</string>
+        <string>Bottom:</string>
        </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="PresetLayout" name="presetLayoutComboBox">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
+       <property name="buddy">
+        <cstring>bottomMarginSpinBox</cstring>
        </property>
       </widget>
      </item>
-     <item row="2" column="0">
+     <item row="1" column="0">
       <widget class="QLabel" name="leftMarginLabel">
        <property name="text">
         <string>Left:</string>
@@ -61,8 +42,8 @@
        </property>
       </widget>
      </item>
-     <item row="2" column="1">
-      <widget class="ScrSpinBox" name="leftMarginSpinBox">
+     <item row="4" column="1">
+      <widget class="ScrSpinBox" name="bottomMarginSpinBox">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
          <horstretch>0</horstretch>
@@ -71,7 +52,7 @@
        </property>
       </widget>
      </item>
-     <item row="3" column="0">
+     <item row="2" column="0">
       <widget class="QLabel" name="rightMarginLabel">
        <property name="text">
         <string>Right:</string>
@@ -81,17 +62,14 @@
        </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>
+     <item row="0" column="0">
+      <widget class="QLabel" name="presetLayoutLabel">
+       <property name="text">
+        <string>Preset Layouts:</string>
        </property>
       </widget>
      </item>
-     <item row="4" column="0">
+     <item row="3" column="0">
       <widget class="QLabel" name="topMarginLabel">
        <property name="text">
         <string>Top:</string>
@@ -101,8 +79,8 @@
        </property>
       </widget>
      </item>
-     <item row="4" column="1">
-      <widget class="ScrSpinBox" name="topMarginSpinBox">
+     <item row="1" column="1">
+      <widget class="ScrSpinBox" name="leftMarginSpinBox">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
          <horstretch>0</horstretch>
@@ -111,18 +89,18 @@
        </property>
       </widget>
      </item>
-     <item row="5" column="0">
-      <widget class="QLabel" name="bottomMarginLabel">
-       <property name="text">
-        <string>Bottom:</string>
+     <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>
-       <property name="buddy">
-        <cstring>bottomMarginSpinBox</cstring>
-       </property>
       </widget>
      </item>
-     <item row="5" column="1">
-      <widget class="ScrSpinBox" name="bottomMarginSpinBox">
+     <item row="3" column="1">
+      <widget class="ScrSpinBox" name="topMarginSpinBox">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
          <horstretch>0</horstretch>
@@ -131,17 +109,17 @@
        </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>
+     <item row="0" column="1">
+      <widget class="PresetLayout" name="presetLayoutComboBox">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
        </property>
-       <property name="text">
-        <string>Link</string>
-       </property>
       </widget>
      </item>
-     <item row="7" column="1">
+     <item row="5" column="1">
       <widget class="QPushButton" name="printerMarginsPushButton">
        <property name="text">
         <string>Printer Margins...</string>
@@ -148,6 +126,37 @@
        </property>
       </widget>
      </item>
+     <item row="1" column="2" rowspan="4">
+      <widget class="LinkButton" name="marginLinkButton">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>15</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="toolTip">
+        <string>Ensure all margins have the same value</string>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+       <property name="checkable">
+        <bool>true</bool>
+       </property>
+       <property name="toolButtonStyle">
+        <enum>Qt::ToolButtonIconOnly</enum>
+       </property>
+       <property name="autoRaise">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
     </layout>
    </item>
   </layout>
@@ -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>
13263-Patch.diff (11,283 bytes)   

FirasH

2015-07-28 02:19

developer  

13263-Screenshot.png (81,205 bytes)   
13263-Screenshot.png (81,205 bytes)   

Kunda

2015-07-28 05:41

updater   ~0035923

added screenshot on OSX

Kunda

2015-07-28 05:45

updater  

Kunda

2015-07-28 05:45

updater  

Scribus-File-Document-Setup.png (74,241 bytes)   
Scribus-File-Document-Setup.png (74,241 bytes)   

Kunda

2015-07-28 05:48

updater   ~0035924

Scribus-Preferences-Document-Setup.png is the dialog reached through Scribus > Preferences > Document Setup > Margin Bleeds

Scribus-File-Document-Setup.png is the dialog reached through
File > Document Setup > Margin Bleeds

FirasH

2015-07-28 22:23

developer   ~0035933

Thanks cbradney!
Committed in 1.5.1.svn (20289).

Issue History

Date Modified Username Field Change
2015-07-28 02:17 FirasH New Issue
2015-07-28 02:17 FirasH File Added: 13263-Patch.diff
2015-07-28 02:19 FirasH File Added: 13263-Screenshot.png
2015-07-28 05:41 Kunda Note Added: 0035923
2015-07-28 05:41 Kunda File Added: Screenshot 2015-07-28 00.40.48.png
2015-07-28 05:44 Kunda File Deleted: Screenshot 2015-07-28 00.40.48.png
2015-07-28 05:45 Kunda File Added: Scribus-Preferences-Document-Setup.png
2015-07-28 05:45 Kunda File Added: Scribus-File-Document-Setup.png
2015-07-28 05:48 Kunda Note Added: 0035924
2015-07-28 21:46 cbradney Status new => resolved
2015-07-28 21:46 cbradney Fixed in Version => 1.5.1svn
2015-07-28 21:46 cbradney Resolution open => fixed
2015-07-28 21:46 cbradney Assigned To => FirasH
2015-07-28 22:23 FirasH Note Added: 0035933
2015-07-28 22:23 FirasH Status resolved => closed