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

List:       kde-commits
Subject:    KDE/kdebase/workspace/kwin/kcmkwin
From:       Davide Bettio <davbet () aliceposta ! it>
Date:       2008-10-14 13:23:52
Message-ID: 1223990632.146973.1038.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 871309 by bettio:

usability++
see "kwin's KCM usability" mail.


 M  +6 -4      kwincompositing/main.cpp  
 M  +72 -26    kwincompositing/main.ui  
 M  +17 -14    kwindesktop/desktop.cpp  


--- trunk/KDE/kdebase/workspace/kwin/kcmkwin/kwincompositing/main.cpp #871308:871309
@@ -33,6 +33,7 @@
 #include <kservicetypetrader.h>
 #include <kplugininfo.h>
 #include <kservice.h>
+#include <ktitlewidget.h>
 
 #include <QtDBus/QtDBus>
 #include <QTimer>
@@ -75,7 +76,7 @@
     ui.setupUi(this);
     layout()->setMargin(0);
     ui.tabWidget->setCurrentIndex(0);
-    ui.statusLabel->hide();
+    ui.statusTitleWidget->hide();
 
     connect(ui.advancedOptions, SIGNAL(clicked()), this, \
                SLOT(showAdvancedOptions()));
     connect(ui.useCompositing, SIGNAL(toggled(bool)), this, \
SLOT(compositingEnabled(bool))); @@ -118,10 +119,11 @@
         compositingEnabled(false);
 
         QString text = i18n("Compositing is not supported on your system.");
-        text += "<br><br>";
+        text += "<br>";
         text += CompositingPrefs::compositingNotPossibleReason();
-        ui.statusLabel->setText(text);
-        ui.statusLabel->show();
+        ui.statusTitleWidget->setText(text);
+        ui.statusTitleWidget->setPixmap(KTitleWidget::InfoMessage, \
KTitleWidget::ImageLeft); +        ui.statusTitleWidget->show();
     }
 
     KAboutData *about = new KAboutData(I18N_NOOP("kcmkwincompositing"), 0,
--- trunk/KDE/kdebase/workspace/kwin/kcmkwin/kwincompositing/main.ui #871308:871309
@@ -16,19 +16,14 @@
       <number>0</number>
      </property>
      <widget class="QWidget" name="tab" >
-      <property name="geometry" >
-       <rect>
-        <x>0</x>
-        <y>0</y>
-        <width>585</width>
-        <height>618</height>
-       </rect>
-      </property>
       <attribute name="title" >
        <string>General</string>
       </attribute>
-      <layout class="QVBoxLayout" >
+      <layout class="QVBoxLayout" name="verticalLayout" >
        <item>
+        <widget class="KTitleWidget" name="statusTitleWidget" />
+       </item>
+       <item>
         <widget class="QCheckBox" name="useCompositing" >
          <property name="text" >
           <string comment="@option:check" >Enable desktop effects</string>
@@ -80,30 +75,50 @@
              <item row="3" column="0" >
               <widget class="QLabel" name="label_3" >
                <property name="text" >
-                <string>Effect for window switching</string>
+                <string>Effect for window switching:</string>
                </property>
+               <property name="alignment" >
+                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+               </property>
                <property name="buddy" >
                 <cstring>windowSwitchingCombo</cstring>
                </property>
               </widget>
              </item>
              <item row="3" column="1" >
-              <widget class="QComboBox" name="windowSwitchingCombo" />
+              <widget class="QComboBox" name="windowSwitchingCombo" >
+               <property name="sizePolicy" >
+                <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+              </widget>
              </item>
              <item row="4" column="0" >
               <widget class="QLabel" name="label_4" >
                <property name="text" >
-                <string>Effect for desktop switching</string>
+                <string>Effect for desktop switching:</string>
                </property>
+               <property name="alignment" >
+                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+               </property>
                <property name="buddy" >
                 <cstring>desktopSwitchingCombo</cstring>
                </property>
               </widget>
              </item>
              <item row="4" column="1" >
-              <widget class="QComboBox" name="desktopSwitchingCombo" />
+              <widget class="QComboBox" name="desktopSwitchingCombo" >
+               <property name="sizePolicy" >
+                <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+              </widget>
              </item>
-             <item row="6" column="0" colspan="2" >
+             <item row="7" column="0" colspan="2" >
               <widget class="QLabel" name="label" >
                <property name="text" >
                 <string>You can find more effects in the 'All Effects' tab</string>
@@ -112,6 +127,12 @@
              </item>
              <item row="5" column="1" >
               <widget class="QComboBox" name="animationSpeedCombo" >
+               <property name="sizePolicy" >
+                <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
                <property name="currentIndex" >
                 <number>3</number>
                </property>
@@ -155,11 +176,41 @@
              <item row="5" column="0" >
               <widget class="QLabel" name="label_5" >
                <property name="text" >
-                <string>Animation speed</string>
+                <string>Animation speed:</string>
                </property>
+               <property name="alignment" >
+                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+               </property>
               </widget>
              </item>
+             <item row="6" column="0" >
+              <spacer name="verticalSpacer" >
+               <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>5</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
             </layout>
+            <zorder>effectWinManagement</zorder>
+            <zorder>effectShadows</zorder>
+            <zorder>effectAnimations</zorder>
+            <zorder>label_3</zorder>
+            <zorder>windowSwitchingCombo</zorder>
+            <zorder>label_4</zorder>
+            <zorder>desktopSwitchingCombo</zorder>
+            <zorder>label</zorder>
+            <zorder>animationSpeedCombo</zorder>
+            <zorder>label_5</zorder>
+            <zorder>verticalSpacer</zorder>
            </widget>
           </item>
           <item>
@@ -190,9 +241,6 @@
         </widget>
        </item>
        <item>
-        <widget class="QLabel" name="statusLabel" />
-       </item>
-       <item>
         <spacer>
          <property name="orientation" >
           <enum>Qt::Vertical</enum>
@@ -208,14 +256,6 @@
       </layout>
      </widget>
      <widget class="QWidget" name="tab_2" >
-      <property name="geometry" >
-       <rect>
-        <x>0</x>
-        <y>0</y>
-        <width>591</width>
-        <height>619</height>
-       </rect>
-      </property>
       <attribute name="title" >
        <string>All Effects</string>
       </attribute>
@@ -242,9 +282,15 @@
     </widget>
    </item>
   </layout>
+  <zorder>tabWidget</zorder>
  </widget>
  <customwidgets>
   <customwidget>
+   <class>KTitleWidget</class>
+   <extends>QWidget</extends>
+   <header>ktitlewidget.h</header>
+  </customwidget>
+  <customwidget>
    <class>KPluginSelector</class>
    <extends>QWidget</extends>
    <header>kpluginselector.h</header>
--- trunk/KDE/kdebase/workspace/kwin/kcmkwin/kwindesktop/desktop.cpp #871308:871309
@@ -71,15 +71,12 @@
   layout->setMargin(0);
   layout->setSpacing(KDialog::spacingHint());
 
-  // number group
-  QGroupBox *number_group = new QGroupBox(this);
-
-  QHBoxLayout *lay = new QHBoxLayout(number_group);
+  QHBoxLayout *lay = new QHBoxLayout();
   lay->setMargin(KDialog::marginHint());
   lay->setSpacing(KDialog::spacingHint());
 
-  QLabel *label = new QLabel(i18n("N&umber of desktops: "), number_group);
-  _numInput = new KIntNumInput(4, number_group);
+  QLabel *label = new QLabel(i18n("N&umber of desktops: "), this);
+  _numInput = new KIntNumInput(4, this);
   _numInput->setRange(1, maxDesktops, 1);
   connect(_numInput, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)));
   connect(_numInput, SIGNAL(valueChanged(int)), SLOT( changed() ));
@@ -87,29 +84,31 @@
   QString wtstr = i18n( "Here you can set how many virtual desktops you want on your \
KDE desktop. Move the slider to change the value." );  label->setWhatsThis( wtstr );
   _numInput->setWhatsThis( wtstr );
+  QSpacerItem *horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, \
QSizePolicy::Minimum);  
   lay->addWidget(label);
   lay->addWidget(_numInput);
-  lay->setStretchFactor( _numInput, 2 );
+  lay->addItem(horizontalSpacer);
+  //lay->setStretchFactor( _numInput, 2 );
 
-  layout->addWidget(number_group);
+  layout->addLayout(lay);
 
   // name group
   QGroupBox *name_group = new QGroupBox(i18n("Desktop &Names"), this);
-  QFormLayout *namesLayout = new QFormLayout;
+  QGridLayout *namesLayout = new QGridLayout;
   name_group->setLayout(namesLayout);
-  QFontMetrics fm(label->font());
-  int labelWidth = fm.width(i18n("Desktop %1:", 10)); // be sure that all label will \
have the same width (with one or two numbers, e.g. 1, 99)  for(int i = 0; i < \
maxDesktops; i++)  {
       _nameLabel[i] = new QLabel(i18n("Desktop %1:", i+1), name_group);
       _nameInput[i] = new KLineEdit(name_group);
+      _nameLabel[i]->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
       _nameLabel[i]->setWhatsThis( i18n( "Here you can enter the name for desktop \
                %1", i+1 ) );
       _nameInput[i]->setWhatsThis( i18n( "Here you can enter the name for desktop \
%1", i+1 ) );  
       connect(_nameInput[i], SIGNAL(textChanged(const QString&)),
            SLOT( changed() ));
-      namesLayout->addRow(_nameLabel[i],_nameInput[i]);
+      namesLayout->addWidget(_nameLabel[i], i, 0, 1, 1);
+      namesLayout->addWidget(_nameInput[i], i, 1, 1, 1);
     }
 
   for(int i = 1; i < maxDesktops; i++)
@@ -143,14 +142,18 @@
   if (config->isGroupImmutable(groupname))
   {
      name_group->setEnabled(false);
-     number_group->setEnabled(false);
+     //number of desktops widgets
+     label->setEnabled(false);
+     _numInput->setEnabled(false);
   }
   else
   {
      KConfigGroup cfgGroup(config.data(), groupname.constData());
      if (cfgGroup.isEntryImmutable("Number"))
      {
-        number_group->setEnabled(false);
+        //number of desktops widgets
+        label->setEnabled(false);
+        _numInput->setEnabled(false);
      }
   }
   // End check for immutable


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

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