From 4e9d2d3a25e288ad8de77098b69841e0c9adc354 Mon Sep 17 00:00:00 2001 From: Nick Shaforostoff Date: Mon, 25 Aug 2008 02:22:56 +0000 Subject: [PATCH] improvement: make systemsettings more 1024x600 netbooks friendly svn path=/trunk/KDE/kdebase/workspace/; revision=851963 --- kcmkwin/kwincompositing/main.ui | 26 ++++++++-- kcmkwin/kwindesktop/desktop.cpp | 35 ++++++------- kcmkwin/kwinoptions/mouse.cpp | 92 +++++++++++---------------------- kcmkwin/kwinoptions/windows.cpp | 12 +++-- 4 files changed, 74 insertions(+), 91 deletions(-) diff --git a/kcmkwin/kwincompositing/main.ui b/kcmkwin/kwincompositing/main.ui index 341ff232a3..368a6acbb4 100644 --- a/kcmkwin/kwincompositing/main.ui +++ b/kcmkwin/kwincompositing/main.ui @@ -13,17 +13,25 @@ - 0 + 1 + + + 0 + 0 + 585 + 617 + + - General + General - Enable desktop effects + Enable desktop effects true @@ -86,7 +94,7 @@ Qt::Horizontal - + 101 20 @@ -114,7 +122,7 @@ Qt::Vertical - + 20 21 @@ -125,6 +133,14 @@ + + + 0 + 0 + 585 + 617 + + All Effects diff --git a/kcmkwin/kwindesktop/desktop.cpp b/kcmkwin/kwindesktop/desktop.cpp index c00235dc8a..f41a5d5668 100644 --- a/kcmkwin/kwindesktop/desktop.cpp +++ b/kcmkwin/kwindesktop/desktop.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include @@ -96,32 +96,20 @@ KDesktopConfig::KDesktopConfig(QWidget *parent, const QVariantList &) // name group QGroupBox *name_group = new QGroupBox(i18n("Desktop &Names"), this); - QVBoxLayout *vhoxlayout = new QVBoxLayout; - name_group->setLayout(vhoxlayout); + QFormLayout *namesLayout = new QFormLayout; + 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/2); i++) + for(int i = 0; i < maxDesktops; i++) { - QHBoxLayout *hboxLayout = new QHBoxLayout; _nameLabel[i] = new QLabel(i18n("Desktop %1:", i+1), name_group); - _nameLabel[i]->setMinimumWidth(labelWidth); - hboxLayout->addWidget(_nameLabel[i]); _nameInput[i] = new KLineEdit(name_group); - hboxLayout->addWidget(_nameInput[i]); - _nameLabel[i+(maxDesktops/2)] = new QLabel(i18n("Desktop %1:", i+(maxDesktops/2)+1), name_group); - hboxLayout->addWidget(_nameLabel[i+(maxDesktops/2)]); - _nameInput[i+(maxDesktops/2)] = new KLineEdit(name_group); - hboxLayout->addWidget(_nameInput[i+(maxDesktops/2)]); _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 ) ); - _nameLabel[i+(maxDesktops/2)]->setWhatsThis( i18n( "Here you can enter the name for desktop %1", i+(maxDesktops/2)+1 ) ); - _nameInput[i+(maxDesktops/2)]->setWhatsThis( i18n( "Here you can enter the name for desktop %1", i+(maxDesktops/2)+1 ) ); connect(_nameInput[i], SIGNAL(textChanged(const QString&)), SLOT( changed() )); - connect(_nameInput[i+(maxDesktops/2)], SIGNAL(textChanged(const QString&)), - SLOT( changed() )); - vhoxlayout->addLayout(hboxLayout); + namesLayout->addRow(_nameLabel[i],_nameInput[i]); } for(int i = 1; i < maxDesktops; i++) @@ -186,7 +174,10 @@ void KDesktopConfig::load() } for(int i = 1; i <= maxDesktops; i++) - _nameInput[i-1]->setEnabled(i <= n); + { + _nameLabel[i-1]->setVisible(i <= n); + _nameInput[i-1]->setVisible(i <= n); + } emit changed(false); #if 0 @@ -253,7 +244,10 @@ void KDesktopConfig::defaults() _nameInput[i]->setText(i18n("Desktop %1", i+1)); for(int i = 0; i < maxDesktops; i++) - _nameInput[i]->setEnabled(i < n); + { + _nameLabel[i]->setVisible(i < n); + _nameInput[i]->setVisible(i < n); + } #if 0 _wheelOption->setChecked(false); @@ -268,7 +262,8 @@ void KDesktopConfig::slotValueChanged(int n) { for(int i = 0; i < maxDesktops; i++) { - _nameInput[i]->setEnabled(i < n); + _nameLabel[i]->setVisible(i < n); + _nameInput[i]->setVisible(i < n); if(itext().isEmpty()) _nameInput[i]->setText(i18n("Desktop %1", i+1)); } diff --git a/kcmkwin/kwinoptions/mouse.cpp b/kcmkwin/kwinoptions/mouse.cpp index 8652699b95..0eb5c23e87 100644 --- a/kcmkwin/kwinoptions/mouse.cpp +++ b/kcmkwin/kwinoptions/mouse.cpp @@ -30,9 +30,11 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -617,7 +619,7 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, QString txtButton1, txtButton3; QStringList items; bool leftHandedMouse = ( KGlobalSettings::mouseSettings().handed == KGlobalSettings::KMouseSettings::LeftHanded); - + QVBoxLayout *layout = new QVBoxLayout(this); layout->setMargin(0); layout->setSpacing(KDialog::spacingHint()); @@ -630,9 +632,9 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, box->setWhatsThis( i18n("Here you can customize mouse click behavior when clicking on an inactive" " inner window ('inner' means: not titlebar, not frame).") ); - grid = new QGridLayout(box); - grid->setMargin(KDialog::marginHint()); - grid->setSpacing(KDialog::spacingHint()); + QFormLayout *formLayout = new QFormLayout(box); + formLayout->setMargin(KDialog::marginHint()); + formLayout->setSpacing(KDialog::spacingHint()); strMouseButton1 = i18n("Left button:"); txtButton1 = i18n("In this row you can customize left click behavior when clicking into" @@ -651,26 +653,15 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, strWin1 = i18n("In this row you can customize left click behavior when clicking into" " an inactive inner window ('inner' means: not titlebar, not frame)."); + strWin2 = i18n("In this row you can customize middle click behavior when clicking into" + " an inactive inner window ('inner' means: not titlebar, not frame)."); + strWin3 = i18n("In this row you can customize right click behavior when clicking into" " an inactive inner window ('inner' means: not titlebar, not frame)."); // Be nice to lefties if ( leftHandedMouse ) qSwap(strWin1, strWin3); - label = new QLabel(strMouseButton1, box); - grid->addWidget(label, 0, 0); - label->setWhatsThis( strWin1 ); - - label = new QLabel(i18n("Middle button:"), box); - grid->addWidget(label, 1, 0); - strWin2 = i18n("In this row you can customize middle click behavior when clicking into" - " an inactive inner window ('inner' means: not titlebar, not frame)."); - label->setWhatsThis( strWin2 ); - - label = new QLabel(strMouseButton3, box); - grid->addWidget(label, 2, 0); - label->setWhatsThis( strWin3 ); - items.clear(); items << i18n("Activate, Raise & Pass Click") << i18n("Activate & Pass Click") @@ -678,25 +669,25 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, << i18n("Activate & Raise"); QComboBox* combo = new QComboBox(box); - grid->addWidget(combo, 0, 1); + coWin1 = combo; combo->addItems(items); connect(combo, SIGNAL(activated(int)), SLOT(changed())); - coWin1 = combo; combo->setWhatsThis( strWin1 ); + formLayout->addRow(strMouseButton1, combo); combo = new QComboBox(box); - grid->addWidget(combo, 1, 1); combo->addItems(items); connect(combo, SIGNAL(activated(int)), SLOT(changed())); coWin2 = combo; combo->setWhatsThis( strWin2 ); + formLayout->addRow(i18n("Middle button:"), combo); combo = new QComboBox(box); - grid->addWidget(combo, 2, 1); combo->addItems(items); connect(combo, SIGNAL(activated(int)), SLOT(changed())); coWin3 = combo; combo->setWhatsThis( strWin3 ); + formLayout->addRow(strMouseButton3, combo); /** Inner window, titlebar and frame **************/ @@ -707,19 +698,11 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, box->setWhatsThis( i18n("Here you can customize KDE's behavior when clicking somewhere into" " a window while pressing a modifier key.")); - grid = new QGridLayout(box); - grid->setMargin(KDialog::marginHint()); - grid->setSpacing(KDialog::spacingHint()); + formLayout = new QFormLayout(box); + formLayout->setMargin(KDialog::marginHint()); + formLayout->setSpacing(KDialog::spacingHint()); // Labels - label = new QLabel(i18n("Modifier key:"), box); - grid->addWidget(label, 0, 0); - - strAllKey = i18n("Here you select whether holding the Meta key or Alt key " - "will allow you to perform the following actions."); - label->setWhatsThis( strAllKey ); - - strMouseButton1 = i18n("Modifier key + left button:"); strAll1 = i18n("In this row you can customize left click behavior when clicking into" " the titlebar or the frame."); @@ -734,34 +717,15 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, qSwap(strAll1, strAll3); } - label = new QLabel(strMouseButton1, box); - grid->addWidget(label, 1, 0); - label->setWhatsThis( strAll1); - - label = new QLabel(i18n("Modifier key + middle button:"), box); - grid->addWidget(label, 2, 0); - strAll2 = i18n("Here you can customize KDE's behavior when middle clicking into a window" - " while pressing the modifier key."); - label->setWhatsThis( strAll2 ); - - label = new QLabel(strMouseButton3, box); - grid->addWidget(label, 3, 0); - label->setWhatsThis( strAll3); - - label = new QLabel(i18n("Modifier key + mouse wheel:"), box); - grid->addWidget(label, 4, 0); - strAllW = i18n("Here you can customize KDE's behavior when scrolling with the mouse wheel" - " in a window while pressing the modifier key."); - label->setWhatsThis( strAllW); - // Combo's combo = new QComboBox(box); - grid->addWidget(combo, 0, 1); combo->addItem(i18n("Meta")); combo->addItem(i18n("Alt")); connect(combo, SIGNAL(activated(int)), SLOT(changed())); coAllKey = combo; - combo->setWhatsThis( strAllKey ); + combo->setWhatsThis( i18n("Here you select whether holding the Meta key or Alt key " + "will allow you to perform the following actions.") ); + formLayout->addRow(i18n("Modifier key:"), combo); items.clear(); items << i18n("Move") @@ -774,28 +738,30 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, << i18n("Nothing"); combo = new QComboBox(box); - grid->addWidget(combo, 1, 1); combo->addItems(items); connect(combo, SIGNAL(activated(int)), SLOT(changed())); coAll1 = combo; combo->setWhatsThis( strAll1 ); + formLayout->addRow(strMouseButton1, combo); + combo = new QComboBox(box); - grid->addWidget(combo, 2, 1); combo->addItems(items); connect(combo, SIGNAL(activated(int)), SLOT(changed())); coAll2 = combo; - combo->setWhatsThis( strAll2 ); + combo->setWhatsThis( i18n("Here you can customize KDE's behavior when middle clicking into a window" + " while pressing the modifier key.") ); + formLayout->addRow(i18n("Modifier key + middle button:"), combo); combo = new QComboBox(box); - grid->addWidget(combo, 3, 1); combo->addItems(items); connect(combo, SIGNAL(activated(int)), SLOT(changed())); coAll3 = combo; combo->setWhatsThis( strAll3 ); + formLayout->addRow(strMouseButton3, combo); + combo = new QComboBox(box); - grid->addWidget(combo, 4, 1); combo->addItem(i18n("Raise/Lower")); combo->addItem(i18n("Shade/Unshade")); combo->addItem(i18n("Maximize/Restore")); @@ -805,10 +771,12 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, combo->addItem(i18n("Nothing")); connect(combo, SIGNAL(activated(int)), SLOT(changed())); coAllW = combo; - combo->setWhatsThis( strAllW ); + combo->setWhatsThis( i18n("Here you can customize KDE's behavior when scrolling with the mouse wheel" + " in a window while pressing the modifier key.") ); + formLayout->addRow(i18n("Modifier key + mouse wheel:"), combo); + layout->addStretch(); - load(); } diff --git a/kcmkwin/kwinoptions/windows.cpp b/kcmkwin/kwinoptions/windows.cpp index 24218113ae..4f72d3590e 100644 --- a/kcmkwin/kwinoptions/windows.cpp +++ b/kcmkwin/kwinoptions/windows.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -610,7 +611,7 @@ KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, const KCom delays = new KIntNumInput(10, electricBox); delays->setRange(0, MAX_EDGE_RES, 50); delays->setSuffix(i18n(" ms")); - delays->setLabel(i18n("Desktop &switch delay:")); + delays->setLabel(i18n("Desktop &switch delay:"), Qt::AlignVCenter|Qt::AlignLeft); delays->setWhatsThis( i18n("Here you can set a delay for switching desktops using the active" " borders feature. Desktops will be switched after the mouse has been pushed against a screen border" " for the specified number of milliseconds.") ); @@ -901,6 +902,9 @@ KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, const KCompone //lay->addWidget(plcBox); + + + //CT 15mar98 - add EdgeResistance, BorderAttractor, WindowsAttractor config MagicBox = new KButtonGroup(this); MagicBox->setTitle(i18n("Snap Zones")); @@ -909,7 +913,7 @@ KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, const KCompone BrdrSnap = new KIntNumInput(10, MagicBox); BrdrSnap->setSpecialValueText( i18n("none") ); BrdrSnap->setRange( 0, MAX_BRDR_SNAP); - BrdrSnap->setLabel(i18n("&Border snap zone:")); + BrdrSnap->setLabel(i18n("&Border snap zone:"), Qt::AlignVCenter|Qt::AlignLeft); BrdrSnap->setSteps(1,10); BrdrSnap->setWhatsThis( i18n("Here you can set the snap zone for screen borders, i.e." " the 'strength' of the magnetic field which will make windows snap to the border when" @@ -919,7 +923,7 @@ KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, const KCompone WndwSnap = new KIntNumInput(10, MagicBox); WndwSnap->setSpecialValueText( i18n("none") ); WndwSnap->setRange( 0, MAX_WNDW_SNAP); - WndwSnap->setLabel(i18n("&Window snap zone:")); + WndwSnap->setLabel(i18n("&Window snap zone:"), Qt::AlignVCenter|Qt::AlignLeft); WndwSnap->setSteps(1,10); WndwSnap->setWhatsThis( i18n("Here you can set the snap zone for windows, i.e." " the 'strength' of the magnetic field which will make windows snap to each other when" @@ -929,7 +933,7 @@ KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, const KCompone CntrSnap = new KIntNumInput(10, MagicBox); CntrSnap->setSpecialValueText( i18n("none") ); CntrSnap->setRange( 0, MAX_CNTR_SNAP); - CntrSnap->setLabel(i18n("&Center snap zone:")); + CntrSnap->setLabel(i18n("&Center snap zone:"), Qt::AlignVCenter|Qt::AlignLeft); CntrSnap->setSteps(1,10); CntrSnap->setWhatsThis( i18n("Here you can set the snap zone for the screen center, i.e." " the 'strength' of the magnetic field which will make windows snap to the center of"