r15138 by cbradney - #3700: Add text frame distances to preferences and doc setup

scribus-commit scribus-commit at lists.scribus.net
Sat May 29 14:20:32 CEST 2010


Revision: 15138
Author: cbradney
Date: 2010-05-29T12:18:48.795322Z
Commit message: #3700: Add text frame distances to preferences and doc setup

Changeset: 
M  /trunk/Scribus/scribus/prefsmanager.cpp
M  /trunk/Scribus/scribus/pageitem.cpp
M  /trunk/Scribus/scribus/ui/prefs_itemtools.cpp
M  /trunk/Scribus/scribus/prefsstructs.h
M  /trunk/Scribus/scribus/ui/prefs_itemtoolsbase.ui

Diffs:
Index: scribus/prefsmanager.cpp
===================================================================
--- scribus/prefsmanager.cpp	(revision 15137)
+++ scribus/prefsmanager.cpp	(revision 15138)
@@ -1427,6 +1427,10 @@
 	dcItemTools.setAttribute("TextColumnCount",appPrefs.itemToolPrefs.textColumns);
 	dcItemTools.setAttribute("TextColumnGap",ScCLocale::toQStringC(appPrefs.itemToolPrefs.textColumnGap));
 	dcItemTools.setAttribute("TextTabWidth",ScCLocale::toQStringC(appPrefs.itemToolPrefs.textTabWidth));
+	dcItemTools.setAttribute("TextDistanceTop",ScCLocale::toQStringC(appPrefs.itemToolPrefs.textDistances.Top));
+	dcItemTools.setAttribute("TextDistanceBottom",ScCLocale::toQStringC(appPrefs.itemToolPrefs.textDistances.Bottom));
+	dcItemTools.setAttribute("TextDistanceLeft",ScCLocale::toQStringC(appPrefs.itemToolPrefs.textDistances.Left));
+	dcItemTools.setAttribute("TextDistanceRight",ScCLocale::toQStringC(appPrefs.itemToolPrefs.textDistances.Right));
 	dcItemTools.setAttribute("TabFillCharacter",appPrefs.itemToolPrefs.textTabFillChar);
 	dcItemTools.setAttribute("ShapeLineStyle",appPrefs.itemToolPrefs.shapeLineStyle);
 	dcItemTools.setAttribute("LineStyle",appPrefs.itemToolPrefs.lineStyle);
@@ -2015,6 +2019,10 @@
 			appPrefs.itemToolPrefs.textColumnGap  = ScCLocale::toDoubleC(dc.attribute("TextColumnGap"), 0.0);
 			appPrefs.itemToolPrefs.textTabFillChar = dc.attribute("TabFillCharacter", "");
 			appPrefs.itemToolPrefs.textTabWidth   = ScCLocale::toDoubleC(dc.attribute("TextTabWidth"), 36.0);
+			appPrefs.itemToolPrefs.textDistances.Top = ScCLocale::toDoubleC(dc.attribute("TextDistanceTop"), 0.0);
+			appPrefs.itemToolPrefs.textDistances.Bottom = ScCLocale::toDoubleC(dc.attribute("TextDistanceBottom"), 0.0);
+			appPrefs.itemToolPrefs.textDistances.Left = ScCLocale::toDoubleC(dc.attribute("TextDistanceLeft"), 0.0);
+			appPrefs.itemToolPrefs.textDistances.Right = ScCLocale::toDoubleC(dc.attribute("TextDistanceRight"), 0.0);
 			appPrefs.itemToolPrefs.shapeLineStyle = dc.attribute("ShapeLineStyle").toInt();
 			appPrefs.itemToolPrefs.lineStyle = dc.attribute("LineStyle").toInt();
 			appPrefs.itemToolPrefs.shapeLineWidth     = ScCLocale::toDoubleC(dc.attribute("ShapeLineWidth"), 0.0);
Index: scribus/prefsstructs.h
===================================================================
--- scribus/prefsstructs.h	(revision 15137)
+++ scribus/prefsstructs.h	(revision 15138)
@@ -182,6 +182,7 @@
 	int textColumns; //! Default number of columns in a text frame
 	double textColumnGap; //! Default gap between columns of a text frame
 	QString textTabFillChar; //! Default tab fill character
+	MarginStruct textDistances; //! Default text to frame distances
 	double textTabWidth; //! Default tab width
 	/* ShapeTool */
 	QString shapeLineColor; //! Default shape line color
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp	(revision 15137)
+++ scribus/pageitem.cpp	(revision 15138)
@@ -458,10 +458,10 @@
 	CurX = 0;
 	CurY = 0;
 	CPos = 0;
-	Extra = 0;
-	TExtra = 0;
-	BExtra = 0;
-	RExtra = 0;
+	Extra = m_Doc->itemToolPrefs().textDistances.Left;
+	TExtra = m_Doc->itemToolPrefs().textDistances.Top;
+	BExtra = m_Doc->itemToolPrefs().textDistances.Bottom;
+	RExtra = m_Doc->itemToolPrefs().textDistances.Right;
 	firstChar = 0;
 	MaxChars = 0;
 	Pfile = "";
Index: scribus/ui/prefs_itemtools.cpp
===================================================================
--- scribus/ui/prefs_itemtools.cpp	(revision 15137)
+++ scribus/ui/prefs_itemtools.cpp	(revision 15138)
@@ -111,6 +111,10 @@
 	textTabWidthSpinBox->setValue(prefsData->itemToolPrefs.textTabWidth * unitRatio);
 	textColumnsSpinBox->setValue(prefsData->itemToolPrefs.textColumns);
 	textColumnGapSpinBox->setValue(prefsData->itemToolPrefs.textColumnGap * unitRatio);
+	topTextDistanceSpinBox->setValue(prefsData->itemToolPrefs.textDistances.Top * unitRatio);
+	bottomTextDistanceSpinBox->setValue(prefsData->itemToolPrefs.textDistances.Bottom * unitRatio);
+	leftTextDistanceSpinBox->setValue(prefsData->itemToolPrefs.textDistances.Left * unitRatio);
+	rightTextDistanceSpinBox->setValue(prefsData->itemToolPrefs.textDistances.Right * unitRatio);
 
 	//Image Tool
 //TODO	imageFrameLineColorComboBox
@@ -216,12 +220,16 @@
 			prefsData->itemToolPrefs.textTabFillChar = textTabFillCharComboBox->currentText().right(1);
 			break;
 	}
+	prefsData->itemToolPrefs.textDistances.Top = topTextDistanceSpinBox->value() / unitRatio;
+	prefsData->itemToolPrefs.textDistances.Bottom = bottomTextDistanceSpinBox->value() / unitRatio;
+	prefsData->itemToolPrefs.textDistances.Left = leftTextDistanceSpinBox->value() / unitRatio;
+	prefsData->itemToolPrefs.textDistances.Right = rightTextDistanceSpinBox->value() / unitRatio;
 
 	//Image Tool
-//
-//	TODO imageFrameLineColorComboBox
-//	TODO imageFrameLineShadingSpinBox
-//	TODO scalingLockToolButton
+	//
+	//	TODO imageFrameLineColorComboBox
+	//	TODO imageFrameLineShadingSpinBox
+	//	TODO scalingLockToolButton
 
 	prefsData->itemToolPrefs.imageFillColor = imageFrameFillColorComboBox->currentText();
 	if (prefsData->itemToolPrefs.imageFillColor == CommonStrings::tr_NoneColor)
Index: scribus/ui/prefs_itemtoolsbase.ui
===================================================================
--- scribus/ui/prefs_itemtoolsbase.ui	(revision 15137)
+++ scribus/ui/prefs_itemtoolsbase.ui	(revision 15138)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>670</width>
-    <height>832</height>
+    <width>661</width>
+    <height>746</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -88,14 +88,11 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>620</width>
-            <height>727</height>
+            <width>596</width>
+            <height>720</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_2">
-           <property name="margin">
-            <number>6</number>
-           </property>
            <item>
             <layout class="QHBoxLayout" name="horizontalLayout_5">
              <item>
@@ -106,70 +103,46 @@
                <property name="formAlignment">
                 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
                </property>
-               <item row="2" column="0">
-                <widget class="QLabel" name="label_10">
+               <item row="0" column="0">
+                <widget class="QLabel" name="label_30">
                  <property name="text">
-                  <string>Columns:</string>
+                  <string>Fill Color:</string>
                  </property>
                 </widget>
                </item>
-               <item row="2" column="1">
-                <widget class="QSpinBox" name="textColumnsSpinBox">
-                 <property name="minimum">
-                  <number>1</number>
-                 </property>
-                </widget>
+               <item row="0" column="1">
+                <widget class="ColorCombo" name="textFrameFillColorComboBox"/>
                </item>
-               <item row="3" column="0">
-                <widget class="QLabel" name="label_17">
+               <item row="1" column="0">
+                <widget class="QLabel" name="label_31">
                  <property name="text">
-                  <string>Column Gap:</string>
+                  <string>Line Color:</string>
                  </property>
                 </widget>
                </item>
-               <item row="3" column="1">
-                <widget class="ScrSpinBox" name="textColumnGapSpinBox"/>
+               <item row="1" column="1">
+                <widget class="ColorCombo" name="textFrameLineColorComboBox"/>
                </item>
-               <item row="4" column="0">
+               <item row="2" column="0">
                 <widget class="QLabel" name="label_9">
                  <property name="text">
                   <string>Tab Fill Character:</string>
                  </property>
                 </widget>
                </item>
-               <item row="4" column="1">
+               <item row="2" column="1">
                 <widget class="QComboBox" name="textTabFillCharComboBox"/>
                </item>
-               <item row="5" column="0">
+               <item row="3" column="0">
                 <widget class="QLabel" name="label_14">
                  <property name="text">
                   <string>Tab Width:</string>
                  </property>
                 </widget>
                </item>
-               <item row="5" column="1">
+               <item row="3" column="1">
                 <widget class="ScrSpinBox" name="textTabWidthSpinBox"/>
                </item>
-               <item row="0" column="1">
-                <widget class="ColorCombo" name="textFrameFillColorComboBox"/>
-               </item>
-               <item row="0" column="0">
-                <widget class="QLabel" name="label_30">
-                 <property name="text">
-                  <string>Fill Color:</string>
-                 </property>
-                </widget>
-               </item>
-               <item row="1" column="0">
-                <widget class="QLabel" name="label_31">
-                 <property name="text">
-                  <string>Line Color:</string>
-                 </property>
-                </widget>
-               </item>
-               <item row="1" column="1">
-                <widget class="ColorCombo" name="textFrameLineColorComboBox"/>
-               </item>
               </layout>
              </item>
              <item>
@@ -190,6 +163,9 @@
              </item>
              <item>
               <layout class="QFormLayout" name="formLayout_10">
+               <property name="fieldGrowthPolicy">
+                <enum>QFormLayout::FieldsStayAtSizeHint</enum>
+               </property>
                <item row="0" column="0">
                 <widget class="QLabel" name="label_32">
                  <property name="text">
@@ -197,6 +173,16 @@
                  </property>
                 </widget>
                </item>
+               <item row="0" column="1">
+                <widget class="QSpinBox" name="textFrameFillShadingSpinBox">
+                 <property name="suffix">
+                  <string> %</string>
+                 </property>
+                 <property name="maximum">
+                  <number>100</number>
+                 </property>
+                </widget>
+               </item>
                <item row="1" column="0">
                 <widget class="QLabel" name="label_33">
                  <property name="text">
@@ -214,13 +200,17 @@
                  </property>
                 </widget>
                </item>
-               <item row="0" column="1">
-                <widget class="QSpinBox" name="textFrameFillShadingSpinBox">
-                 <property name="suffix">
-                  <string> %</string>
+               <item row="2" column="0">
+                <widget class="QLabel" name="label_42">
+                 <property name="text">
+                  <string/>
                  </property>
-                 <property name="maximum">
-                  <number>100</number>
+                </widget>
+               </item>
+               <item row="3" column="0">
+                <widget class="QLabel" name="label_43">
+                 <property name="text">
+                  <string/>
                  </property>
                 </widget>
                </item>
@@ -242,6 +232,147 @@
             </layout>
            </item>
            <item>
+            <spacer name="verticalSpacer_10">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeType">
+              <enum>QSizePolicy::Fixed</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QLabel" name="label_44">
+             <property name="font">
+              <font>
+               <weight>75</weight>
+               <bold>true</bold>
+              </font>
+             </property>
+             <property name="text">
+              <string>Columns &amp; Text Distances</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="Line" name="line_6">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_9">
+             <item>
+              <layout class="QFormLayout" name="formLayout_12">
+               <item row="1" column="0">
+                <widget class="QLabel" name="label_13">
+                 <property name="text">
+                  <string>Top:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="1" column="1">
+                <widget class="ScrSpinBox" name="topTextDistanceSpinBox"/>
+               </item>
+               <item row="2" column="0">
+                <widget class="QLabel" name="label_12">
+                 <property name="text">
+                  <string>Bottom:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="2" column="1">
+                <widget class="ScrSpinBox" name="bottomTextDistanceSpinBox"/>
+               </item>
+               <item row="0" column="0">
+                <widget class="QLabel" name="label_10">
+                 <property name="text">
+                  <string>Columns:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="0" column="1">
+                <widget class="QSpinBox" name="textColumnsSpinBox">
+                 <property name="minimum">
+                  <number>1</number>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <spacer name="horizontalSpacer_13">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+               <property name="sizeType">
+                <enum>QSizePolicy::Fixed</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>20</width>
+                 <height>20</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
+             <item>
+              <layout class="QFormLayout" name="formLayout_13">
+               <item row="1" column="0">
+                <widget class="QLabel" name="label_39">
+                 <property name="text">
+                  <string>Left:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="1" column="1">
+                <widget class="ScrSpinBox" name="leftTextDistanceSpinBox"/>
+               </item>
+               <item row="2" column="0">
+                <widget class="QLabel" name="label_41">
+                 <property name="text">
+                  <string>Right:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="2" column="1">
+                <widget class="ScrSpinBox" name="rightTextDistanceSpinBox"/>
+               </item>
+               <item row="0" column="0">
+                <widget class="QLabel" name="label_17">
+                 <property name="text">
+                  <string>Column Gap:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="0" column="1">
+                <widget class="ScrSpinBox" name="textColumnGapSpinBox"/>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <spacer name="horizontalSpacer_15">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>40</width>
+                 <height>20</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
+            </layout>
+           </item>
+           <item>
             <spacer name="verticalSpacer">
              <property name="orientation">
               <enum>Qt::Vertical</enum>
@@ -1192,6 +1323,54 @@
    <container>1</container>
   </customwidget>
  </customwidgets>
+ <tabstops>
+  <tabstop>tabWidget</tabstop>
+  <tabstop>scrollArea</tabstop>
+  <tabstop>textFrameFillColorComboBox</tabstop>
+  <tabstop>textFrameLineColorComboBox</tabstop>
+  <tabstop>textTabFillCharComboBox</tabstop>
+  <tabstop>textTabWidthSpinBox</tabstop>
+  <tabstop>textFrameFillShadingSpinBox</tabstop>
+  <tabstop>textFrameLineShadingSpinBox</tabstop>
+  <tabstop>textColumnsSpinBox</tabstop>
+  <tabstop>textColumnGapSpinBox</tabstop>
+  <tabstop>topTextDistanceSpinBox</tabstop>
+  <tabstop>leftTextDistanceSpinBox</tabstop>
+  <tabstop>bottomTextDistanceSpinBox</tabstop>
+  <tabstop>rightTextDistanceSpinBox</tabstop>
+  <tabstop>textFontComboBox</tabstop>
+  <tabstop>textSizeSpinBox</tabstop>
+  <tabstop>textColorComboBox</tabstop>
+  <tabstop>textColorShadingSpinBox</tabstop>
+  <tabstop>textStrokeColorComboBox</tabstop>
+  <tabstop>textStrokeShadingSpinBox</tabstop>
+  <tabstop>imageFrameFillColorComboBox</tabstop>
+  <tabstop>imageFrameFillShadingSpinBox</tabstop>
+  <tabstop>imageFrameLineColorComboBox</tabstop>
+  <tabstop>imageFrameLineShadingSpinBox</tabstop>
+  <tabstop>imageUseEmbeddedClippingPathCheckBox</tabstop>
+  <tabstop>imageFreeScalingRadioButton</tabstop>
+  <tabstop>imageHorizontalScalingSpinBox</tabstop>
+  <tabstop>imageVerticalScalingSpinBox</tabstop>
+  <tabstop>scalingLockToolButton</tabstop>
+  <tabstop>imageFrameScalingRadioButton</tabstop>
+  <tabstop>imageKeepAspectRatioCheckBox</tabstop>
+  <tabstop>onscreenResolutionFullRadioButton</tabstop>
+  <tabstop>onscreenResolutionNormalRadioButton</tabstop>
+  <tabstop>onscreenResolutionLowRadioButton</tabstop>
+  <tabstop>shapeFrameFillColorComboBox</tabstop>
+  <tabstop>shapeFrameFillShadingSpinBox</tabstop>
+  <tabstop>shapeFrameLineColorComboBox</tabstop>
+  <tabstop>shapeFrameLineShadingSpinBox</tabstop>
+  <tabstop>shapeFrameLineStyleComboBox</tabstop>
+  <tabstop>shapeLineWidthSpinBox</tabstop>
+  <tabstop>lineFillColorComboBox</tabstop>
+  <tabstop>lineFillColorShadingSpinBox</tabstop>
+  <tabstop>lineStyleComboBox</tabstop>
+  <tabstop>lineWidthSpinBox</tabstop>
+  <tabstop>lineStartArrowComboBox</tabstop>
+  <tabstop>lineEndArrowComboBox</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
  <buttongroups>




More information about the scribus-commit mailing list