[Kst] extragear/graphics/kst/src/libkstapp

George Staikos staikos at kde.org
Tue Jan 23 20:19:21 CET 2007


SVN commit 626583 by staikos:

revert 620422 - put horizontal justification options back in, though they don't
work because auto-resize of labels is now mandatory.  problems with this are
pointed out on the list.  Let's solve the problems in entirety.


 M  +4 -0      kstviewlabel.cpp  
 M  +64 -97    viewlabelwidget.ui  
 M  +3 -0      viewlabelwidget.ui.h  


--- trunk/extragear/graphics/kst/src/libkstapp/kstviewlabel.cpp #626582:626583
@@ -594,6 +594,7 @@
     widget->_precision->setValue(8);
     widget->_rotation->setValue(0);
     widget->_fontSize->setValue(0);
+    widget->_horizontal->setCurrentItem(0);
     widget->_fontColor->setColor(KstSettings::globalSettings()->foregroundColor);
     widget->_font->setCurrentFont(KstApp::inst()->defaultFont());
     widget->_margin->setValue(5);
@@ -623,6 +624,7 @@
     widget->_precision->setValue(int(dataPrecision()));
     widget->_rotation->setValue(double(rotation()));
     widget->_fontSize->setValue(int(fontSize()));
+    widget->_horizontal->setCurrentItem(horizJustifyWrap());
     widget->_fontColor->setColor(foregroundColor());
     widget->_font->setCurrentFont(fontName());
 
@@ -654,6 +656,7 @@
   setDataPrecision(widget->_precision->value());
   setRotation(widget->_rotation->value());
   setFontSize(widget->_fontSize->value());
+  setHorizJustifyWrap(widget->_horizontal->currentItem());
   setForegroundColor(widget->_fontColor->color());
   setFontName(widget->_font->currentFont());
 
@@ -678,6 +681,7 @@
   connect(widget->_font, SIGNAL(activated(int)), parent, SLOT(modified()));
   connect(widget->_fontSize, SIGNAL(valueChanged(int)), parent, SLOT(modified()));
   connect(widget->_fontSize->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), parent, SLOT(modified()));
+  connect(widget->_horizontal, SIGNAL(activated(int)), parent, SLOT(modified()));
   connect(widget->_fontColor, SIGNAL(changed(const QColor&)), parent, SLOT(modified()));  
   connect(widget->_precision, SIGNAL(valueChanged(int)), parent, SLOT(modified()));
   connect(widget->_precision->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), parent, SLOT(modified()));
--- trunk/extragear/graphics/kst/src/libkstapp/viewlabelwidget.ui #626582:626583
@@ -8,18 +8,18 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>528</width>
-            <height>329</height>
+            <width>506</width>
+            <height>356</height>
         </rect>
     </property>
     <property name="caption">
         <string>viewLabelWidget</string>
     </property>
-    <grid>
+    <vbox>
         <property name="name">
             <cstring>unnamed</cstring>
         </property>
-        <widget class="QLayoutWidget" row="0" column="0">
+        <widget class="QLayoutWidget">
             <property name="name">
                 <cstring>layout8</cstring>
             </property>
@@ -50,7 +50,7 @@
                 </widget>
             </hbox>
         </widget>
-        <widget class="QLayoutWidget" row="1" column="0">
+        <widget class="QLayoutWidget">
             <property name="name">
                 <cstring>layout9</cstring>
             </property>
@@ -111,41 +111,31 @@
                         <property name="name">
                             <cstring>unnamed</cstring>
                         </property>
-                        <spacer row="0" column="7">
+                        <widget class="QLabel" row="0" column="0">
                             <property name="name">
-                                <cstring>spacer7</cstring>
+                                <cstring>textLabel3</cstring>
                             </property>
-                            <property name="orientation">
-                                <enum>Horizontal</enum>
+                            <property name="text">
+                                <string>Font:</string>
                             </property>
-                            <property name="sizeType">
-                                <enum>Expanding</enum>
-                            </property>
-                            <property name="sizeHint">
-                                <size>
-                                    <width>50</width>
-                                    <height>31</height>
-                                </size>
-                            </property>
-                        </spacer>
-                        <spacer row="1" column="7">
+                        </widget>
+                        <widget class="QLabel" row="2" column="0">
                             <property name="name">
-                                <cstring>spacer7_2</cstring>
+                                <cstring>textLabel4_3_2</cstring>
                             </property>
-                            <property name="orientation">
-                                <enum>Horizontal</enum>
+                            <property name="sizePolicy">
+                                <sizepolicy>
+                                    <hsizetype>0</hsizetype>
+                                    <vsizetype>5</vsizetype>
+                                    <horstretch>0</horstretch>
+                                    <verstretch>0</verstretch>
+                                </sizepolicy>
                             </property>
-                            <property name="sizeType">
-                                <enum>Expanding</enum>
+                            <property name="text">
+                                <string>Font Color:</string>
                             </property>
-                            <property name="sizeHint">
-                                <size>
-                                    <width>50</width>
-                                    <height>31</height>
-                                </size>
-                            </property>
-                        </spacer>
-                        <widget class="QSpinBox" row="1" column="4">
+                        </widget>
+                        <widget class="QSpinBox" row="2" column="3">
                             <property name="name">
                                 <cstring>_precision</cstring>
                             </property>
@@ -153,45 +143,47 @@
                                 <number>-99</number>
                             </property>
                         </widget>
-                        <widget class="QLabel" row="0" column="0">
+                        <widget class="QLabel" row="2" column="2">
                             <property name="name">
-                                <cstring>textLabel3</cstring>
+                                <cstring>textLabel4_3</cstring>
                             </property>
                             <property name="text">
-                                <string>Font:</string>
+                                <string>Precision:</string>
                             </property>
+                            <property name="alignment">
+                                <set>AlignVCenter|AlignRight</set>
+                            </property>
                         </widget>
-                        <widget class="KDoubleSpinBox" row="1" column="2">
+                        <widget class="KFontCombo" row="0" column="1" rowspan="1" colspan="3">
                             <property name="name">
-                                <cstring>_rotation</cstring>
+                                <cstring>_font</cstring>
                             </property>
-                            <property name="maxValue">
-                                <number>360</number>
+                        </widget>
+                        <widget class="KColorButton" row="2" column="1">
+                            <property name="name">
+                                <cstring>_fontColor</cstring>
                             </property>
-                            <property name="minValue">
-                                <number>-360</number>
+                            <property name="text">
+                                <string></string>
                             </property>
-                            <property name="lineStep">
-                                <number>5</number>
-                            </property>
                         </widget>
-                        <widget class="QLabel" row="1" column="3">
+                        <widget class="QLabel" row="1" column="0">
                             <property name="name">
-                                <cstring>textLabel4_3</cstring>
+                                <cstring>textLabel5_3</cstring>
                             </property>
                             <property name="text">
-                                <string>Precision:</string>
+                                <string>Justification:</string>
                             </property>
                             <property name="alignment">
-                                <set>AlignVCenter|AlignRight</set>
+                                <set>AlignVCenter</set>
                             </property>
                         </widget>
-                        <widget class="KFontCombo" row="0" column="1" rowspan="1" colspan="4">
+                        <widget class="KComboBox" row="1" column="1">
                             <property name="name">
-                                <cstring>_font</cstring>
+                                <cstring>_horizontal</cstring>
                             </property>
                         </widget>
-                        <widget class="QLabel" row="1" column="0" rowspan="1" colspan="2">
+                        <widget class="QLabel" row="1" column="2">
                             <property name="name">
                                 <cstring>textLabel4_2</cstring>
                             </property>
@@ -202,23 +194,21 @@
                                 <set>AlignVCenter|AlignRight</set>
                             </property>
                         </widget>
-                        <widget class="QSpinBox" row="0" column="6">
+                        <widget class="KDoubleSpinBox" row="1" column="3">
                             <property name="name">
-                                <cstring>_fontSize</cstring>
+                                <cstring>_rotation</cstring>
                             </property>
+                            <property name="maxValue">
+                                <number>360</number>
+                            </property>
                             <property name="minValue">
-                                <number>-99</number>
+                                <number>-360</number>
                             </property>
-                        </widget>
-                        <widget class="KColorButton" row="1" column="6">
-                            <property name="name">
-                                <cstring>_fontColor</cstring>
+                            <property name="lineStep">
+                                <number>5</number>
                             </property>
-                            <property name="text">
-                                <string></string>
-                            </property>
                         </widget>
-                        <widget class="QLabel" row="0" column="5">
+                        <widget class="QLabel" row="0" column="4">
                             <property name="name">
                                 <cstring>textLabel4</cstring>
                             </property>
@@ -237,21 +227,13 @@
                                 <set>AlignVCenter|AlignRight</set>
                             </property>
                         </widget>
-                        <widget class="QLabel" row="1" column="5">
+                        <widget class="QSpinBox" row="0" column="5">
                             <property name="name">
-                                <cstring>textLabel4_3_2</cstring>
+                                <cstring>_fontSize</cstring>
                             </property>
-                            <property name="sizePolicy">
-                                <sizepolicy>
-                                    <hsizetype>0</hsizetype>
-                                    <vsizetype>5</vsizetype>
-                                    <horstretch>0</horstretch>
-                                    <verstretch>0</verstretch>
-                                </sizepolicy>
+                            <property name="minValue">
+                                <number>-99</number>
                             </property>
-                            <property name="text">
-                                <string>Font Color:</string>
-                            </property>
                         </widget>
                     </grid>
                 </widget>
@@ -305,18 +287,18 @@
                         </widget>
                         <spacer>
                             <property name="name">
-                                <cstring>spacer12</cstring>
+                                <cstring>spacer1</cstring>
                             </property>
                             <property name="orientation">
                                 <enum>Horizontal</enum>
                             </property>
                             <property name="sizeType">
-                                <enum>Fixed</enum>
+                                <enum>Expanding</enum>
                             </property>
                             <property name="sizeHint">
                                 <size>
-                                    <width>31</width>
-                                    <height>21</height>
+                                    <width>110</width>
+                                    <height>20</height>
                                 </size>
                             </property>
                         </spacer>
@@ -368,28 +350,11 @@
                                 <number>0</number>
                             </property>
                         </widget>
-                        <spacer>
-                            <property name="name">
-                                <cstring>spacer17</cstring>
-                            </property>
-                            <property name="orientation">
-                                <enum>Horizontal</enum>
-                            </property>
-                            <property name="sizeType">
-                                <enum>Expanding</enum>
-                            </property>
-                            <property name="sizeHint">
-                                <size>
-                                    <width>41</width>
-                                    <height>21</height>
-                                </size>
-                            </property>
-                        </spacer>
                     </hbox>
                 </widget>
             </vbox>
         </widget>
-    </grid>
+    </vbox>
 </widget>
 <customwidgets>
 </customwidgets>
@@ -416,6 +381,8 @@
     <includehint>kfontcombo.h</includehint>
     <includehint>klineedit.h</includehint>
     <includehint>kcolorbutton.h</includehint>
+    <includehint>kcombobox.h</includehint>
+    <includehint>knuminput.h</includehint>
     <includehint>kdualcolorbutton.h</includehint>
 </includehints>
 </UI>
--- trunk/extragear/graphics/kst/src/libkstapp/viewlabelwidget.ui.h #626582:626583
@@ -15,6 +15,9 @@
 {
     connect(_scalars, SIGNAL(selectionChanged(const QString &)),
 	    this, SLOT(insertScalarInText(const QString &)));
+    _horizontal->insertItem(i18n("Left"));
+    _horizontal->insertItem(i18n("Right"));
+    _horizontal->insertItem(i18n("Center"));
 
     connect(_strings, SIGNAL(selectionChanged(const QString &)),
 	    this, SLOT(insertStringInText(const QString &)));


More information about the Kst mailing list