[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/plugins/artistictextshape
From:       Jan Hambrecht <jaham () gmx ! net>
Date:       2008-11-11 23:41:56
Message-ID: 1226446916.609642.30033.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 883058 by jaham:

save vertical space
removed text input widget as text can be edited on screen with the tool



 M  +2 -29     ArtisticTextShapeConfigWidget.cpp  
 M  +0 -2      ArtisticTextShapeConfigWidget.h  
 M  +61 -58    ArtisticTextShapeConfigWidget.ui  


--- trunk/koffice/plugins/artistictextshape/ArtisticTextShapeConfigWidget.cpp #883057:883058
@@ -53,22 +53,14 @@
     connect( widget.fontSize, SIGNAL(valueChanged(int)), this, SIGNAL(propertyChanged()));
     connect( widget.bold, SIGNAL(toggled(bool)), this, SIGNAL(propertyChanged()));
     connect( widget.italic, SIGNAL(toggled(bool)), this, SIGNAL(propertyChanged()));
-    connect( widget.text, SIGNAL(textChanged(const QString&)), this, SIGNAL(propertyChanged()));
     connect( widget.startOffset, SIGNAL(valueChanged(int)), this, SIGNAL(propertyChanged()));
     connect( m_anchorGroup, SIGNAL(buttonClicked(int)), this, SIGNAL(propertyChanged()));
-
-    KoCanvasController* canvasController = KoToolManager::instance()->activeCanvasController();
-    if ( canvasController ) {
-        KoShapeManager *manager = canvasController->canvas()->shapeManager();
-        connect( manager, SIGNAL(selectionContentChanged()), this, SLOT(slotTextChanged()));
-    }
 }
 
 void ArtisticTextShapeConfigWidget::blockChildSignals( bool block )
 {
     widget.fontFamily->blockSignals( block );
     widget.fontSize->blockSignals( block );
-    widget.text->blockSignals( block );
     widget.bold->blockSignals( block );
     widget.italic->blockSignals( block );
     widget.startOffset->blockSignals( block );
@@ -85,9 +77,6 @@
 
     QFont font = m_shape->font();
 
-    int cursorPos = widget.text->cursorPosition();
-    widget.text->setText( m_shape->text() );
-    widget.text->setCursorPosition( cursorPos );
     widget.fontSize->setValue( font.pointSize() );
     font.setPointSize( 8 );
 
@@ -101,8 +90,7 @@
     else
         widget.anchorEnd->setChecked( true );
     widget.startOffset->setValue( static_cast<int>( m_shape->startOffset() * 100.0 ) );
-    widget.startOffset->setVisible( m_shape->isOnPath() );
-    widget.labelStartOffset->setVisible( m_shape->isOnPath() );
+    widget.startOffset->setEnabled( m_shape->isOnPath() );
 
     blockChildSignals( false );
 }
@@ -120,9 +108,7 @@
     KoCanvasController* canvasController = KoToolManager::instance()->activeCanvasController();
     if ( canvasController ) {
         KoCanvasBase *canvas = canvasController->canvas();
-	if ( widget.text->text() != m_shape->text() ) {
-            canvas->addCommand( new ChangeText( this, widget.text->text() ) );
-	} else if ( font != m_shape->font() ) {
+    if ( font != m_shape->font() ) {
             canvas->addCommand( new ChangeFont( this, font ) );
 	} else {
 	    ArtisticTextShape::TextAnchor anchor;
@@ -147,16 +133,3 @@
 
     return 0;
 }
-
-void ArtisticTextShapeConfigWidget::slotTextChanged()
-{
-    if ( ! m_shape )
-        return;
-
-    int cursorPos = widget.text->cursorPosition();
-    blockChildSignals( true );
-    widget.text->setText( m_shape->text() );
-    blockChildSignals( false );
-    widget.text->setCursorPosition( cursorPos );
-}
-
--- trunk/koffice/plugins/artistictextshape/ArtisticTextShapeConfigWidget.h #883057:883058
@@ -44,8 +44,6 @@
     virtual bool showOnShapeCreate() { return false; }
     /// reimplemented
     virtual QUndoCommand * createCommand();
-private slots:
-    void slotTextChanged();
 
 private:
     class ChangeFont : public QUndoCommand
--- trunk/koffice/plugins/artistictextshape/ArtisticTextShapeConfigWidget.ui #883057:883058
@@ -5,11 +5,20 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>337</width>
-    <height>206</height>
+    <width>329</width>
+    <height>99</height>
    </rect>
   </property>
-  <layout class="QGridLayout" >
+  <property name="sizePolicy" >
+   <sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <layout class="QGridLayout" name="gridLayout" >
+   <property name="margin" >
+    <number>0</number>
+   </property>
    <item row="0" column="0" >
     <widget class="QLabel" name="label" >
      <property name="text" >
@@ -17,6 +26,16 @@
      </property>
     </widget>
    </item>
+   <item row="0" column="1" colspan="2" >
+    <widget class="KFontComboBox" name="fontFamily" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
    <item row="1" column="0" >
     <widget class="QLabel" name="label_2" >
      <property name="text" >
@@ -24,101 +43,78 @@
      </property>
     </widget>
    </item>
-   <item row="1" column="2" >
-    <widget class="KIntSpinBox" name="fontSize" />
-   </item>
-   <item row="2" column="0" >
-    <widget class="QLabel" name="label_3" >
-     <property name="text" >
-      <string>Style:</string>
+   <item row="1" column="1" >
+    <widget class="KIntSpinBox" name="fontSize" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
      </property>
     </widget>
    </item>
-   <item row="2" column="2" >
+   <item row="1" column="2" >
     <widget class="QWidget" native="1" name="widget" >
      <layout class="QHBoxLayout" >
+      <property name="spacing" >
+       <number>0</number>
+      </property>
+      <property name="margin" >
+       <number>0</number>
+      </property>
       <item>
-       <spacer>
-        <property name="orientation" >
-         <enum>Qt::Horizontal</enum>
-        </property>
-        <property name="sizeHint" stdset="0" >
-         <size>
-          <width>61</width>
-          <height>29</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item>
        <widget class="QToolButton" name="anchorStart" >
         <property name="text" >
-         <string>...</string>
+         <string/>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QToolButton" name="anchorMiddle" >
         <property name="text" >
-         <string>...</string>
+         <string/>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QToolButton" name="anchorEnd" >
         <property name="text" >
-         <string>...</string>
+         <string/>
         </property>
        </widget>
       </item>
       <item>
-       <spacer>
+       <widget class="Line" name="line" >
         <property name="orientation" >
-         <enum>Qt::Horizontal</enum>
+         <enum>Qt::Vertical</enum>
         </property>
-        <property name="sizeHint" stdset="0" >
-         <size>
-          <width>40</width>
-          <height>20</height>
-         </size>
-        </property>
-       </spacer>
+       </widget>
       </item>
       <item>
        <widget class="QToolButton" name="bold" >
         <property name="text" >
-         <string>...</string>
+         <string/>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QToolButton" name="italic" >
         <property name="text" >
-         <string>...</string>
+         <string/>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
-   <item row="3" column="0" >
-    <widget class="QLabel" name="label_4" >
-     <property name="text" >
-      <string>Text:</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="2" >
-    <widget class="QLineEdit" name="text" />
-   </item>
-   <item row="4" column="0" >
+   <item row="2" column="0" >
     <widget class="QLabel" name="labelStartOffset" >
      <property name="text" >
       <string>Offset:</string>
      </property>
     </widget>
    </item>
-   <item row="4" column="2" >
+   <item row="2" column="1" colspan="2" >
     <widget class="QSlider" name="startOffset" >
      <property name="maximum" >
       <number>100</number>
@@ -128,24 +124,31 @@
      </property>
     </widget>
    </item>
-   <item row="5" column="2" >
-    <spacer>
+   <item row="3" column="1" colspan="2" >
+    <spacer name="verticalSpacer" >
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" stdset="0" >
       <size>
-       <width>269</width>
-       <height>21</height>
+       <width>20</width>
+       <height>40</height>
       </size>
      </property>
     </spacer>
    </item>
-   <item row="0" column="2" >
-    <widget class="KFontComboBox" name="fontFamily" >
-    </widget>
-   </item>
   </layout>
+  <zorder>label</zorder>
+  <zorder>fontFamily</zorder>
+  <zorder>label_2</zorder>
+  <zorder>fontSize</zorder>
+  <zorder>label_3</zorder>
+  <zorder>label_4</zorder>
+  <zorder>text</zorder>
+  <zorder>labelStartOffset</zorder>
+  <zorder>startOffset</zorder>
+  <zorder>verticalSpacer</zorder>
+  <zorder>widget</zorder>
  </widget>
  <customwidgets>
   <customwidget>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic