diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-05-07 03:43:19 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-05-07 03:43:19 +0000 |
commit | c35d57256c61f97d2b4221e11e39b1fb9bac2a7e (patch) | |
tree | 6dcd8fd6b9659dc95150630fd788aac61c575df9 | |
parent | 4b06331086ba155155239d9e9a174a2dbc48c899 (diff) | |
download | tdebase-c35d57256c61f97d2b4221e11e39b1fb9bac2a7e.tar.gz tdebase-c35d57256c61f97d2b4221e11e39b1fb9bac2a7e.zip |
Added backend for panel icon maximum size control
Polished frontend for panel icon size configuration
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1123840 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r-- | kcontrol/icons/icons.cpp | 73 | ||||
-rw-r--r-- | kcontrol/icons/icons.h | 3 | ||||
-rw-r--r-- | kicker/kicker/core/main.cpp | 5 | ||||
-rw-r--r-- | kicker/libkicker/global.cpp | 10 |
4 files changed, 59 insertions, 32 deletions
diff --git a/kcontrol/icons/icons.cpp b/kcontrol/icons/icons.cpp index 8ad71540e..43b529ff1 100644 --- a/kcontrol/icons/icons.cpp +++ b/kcontrol/icons/icons.cpp @@ -26,6 +26,7 @@ #include <kipc.h> #include <klocale.h> #include <kseparator.h> +#include <dcopclient.h> #include "icons.h" @@ -101,29 +102,30 @@ KIconConfig::KIconConfig(QWidget *parent, const char *name) QGroupBox *gboxpnl = new QGroupBox(i18n("Panel Settings"), this); //top->addMultiCellWidget(gboxpnl, 4, 4, 0, 1); top->addMultiCellWidget(gboxpnl, 4, 4, 0, 0); - QGridLayout *gpnl_lay = new QGridLayout(gboxpnl, 3, 3, KDialog::marginHint(), KDialog::spacingHint()); + QGridLayout *gpnl_lay = new QGridLayout(gboxpnl, 3, 2, KDialog::marginHint(), KDialog::spacingHint()); gpnl_lay->addRowSpacing(0, fontMetrics().lineSpacing()); + QLabel *lbl3 = new QLabel(i18n("Maximum icon size:"), gboxpnl); + lbl3->setFixedSize(lbl3->sizeHint()); + gpnl_lay->addWidget(lbl3, 1, 0, Qt::AlignLeft); + mpQuickLaunchSizeBox = new QComboBox(gboxpnl); + connect(mpQuickLaunchSizeBox, SIGNAL(activated(int)), SLOT(changed())); + lbl3->setBuddy(mpQuickLaunchSizeBox); + gpnl_lay->addWidget(mpQuickLaunchSizeBox, 1, 1, Qt::AlignCenter); + QLabel *lbl2 = new QLabel(i18n("System tray icon size:"), gboxpnl); lbl2->setFixedSize(lbl2->sizeHint()); - gpnl_lay->addWidget(lbl2, 1, 0, Qt::AlignLeft); + gpnl_lay->addWidget(lbl2, 2, 0, Qt::AlignLeft); mpSysTraySizeBox = new QComboBox(gboxpnl); connect(mpSysTraySizeBox, SIGNAL(activated(int)), SLOT(changed())); lbl2->setBuddy(mpSysTraySizeBox); - gpnl_lay->addWidget(mpSysTraySizeBox, 1, 1, Qt::AlignCenter); + gpnl_lay->addWidget(mpSysTraySizeBox, 2, 1, Qt::AlignCenter); - QLabel *lbl3 = new QLabel(i18n("Quick launch icon size:"), gboxpnl); - lbl3->setFixedSize(lbl3->sizeHint()); - gpnl_lay->addWidget(lbl3, 2, 0, Qt::AlignLeft); - mpQuickLaunchSizeBox = new QComboBox(gboxpnl); - connect(mpQuickLaunchSizeBox, SIGNAL(activated(int)), SLOT(changed())); - lbl3->setBuddy(mpQuickLaunchSizeBox); - gpnl_lay->addWidget(mpQuickLaunchSizeBox, 2, 1, Qt::AlignCenter); + QSpacerItem *thisSpacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + top->addItem(thisSpacer, 5, 0); - mQLSizeLocked = new QCheckBox(i18n("Lock to panel size"), gboxpnl); - mQLSizeLocked->setFixedSize(mQLSizeLocked->sizeHint()); - connect(mQLSizeLocked, SIGNAL(toggled(bool)), SLOT(QLSizeLockedChanged(bool))); - gpnl_lay->addWidget(mQLSizeLocked, 2, 2, Qt::AlignRight); + mpSystrayConfig = new KSimpleConfig( QString::fromLatin1( "systemtray_panelappletrc" )); + mpKickerConfig = new KSimpleConfig( QString::fromLatin1( "kickerrc" )); init(); read(); @@ -133,6 +135,7 @@ KIconConfig::KIconConfig(QWidget *parent, const char *name) KIconConfig::~KIconConfig() { + delete mpSystrayConfig; delete mpEffect; } @@ -308,26 +311,33 @@ void KIconConfig::read() mpQuickLaunchSizeBox->insertItem(QString().setNum(48)); mpSysTraySizeBox->insertItem(QString().setNum(64)); mpQuickLaunchSizeBox->insertItem(QString().setNum(64)); - - // FIXME - // For now, disable mpQuickLaunchSizeBox as the required backend code does not exist yet - // This will change in the near future however - mpQuickLaunchSizeBox->setEnabled(false); - mQLSizeLocked->setEnabled(false); - mQLSizeLocked->setChecked(true); - - // FIXME - // Due to issues with the system tray handling code, mpSysTraySizeBox also needs to be disabled - // This should be fixed ASAP - mpSysTraySizeBox->setEnabled(false); + mpSysTraySizeBox->insertItem(QString().setNum(128)); + mpQuickLaunchSizeBox->insertItem(QString().setNum(128)); mpConfig->setGroup("System Tray"); mSysTraySize = mpConfig->readNumEntry("systrayIconWidth", 22); + + mpSystrayConfig->setGroup("System Tray"); + mSysTraySize = mpSystrayConfig->readNumEntry("systrayIconWidth", 22); for (i=0;i<(mpSysTraySizeBox->count());i++) { if (mpSysTraySizeBox->text(i) == QString().setNum(mSysTraySize)) { mpSysTraySizeBox->setCurrentItem(i); } } + + mpKickerConfig->setGroup("General"); + mQuickLaunchSize = mpKickerConfig->readNumEntry("panelIconWidth", KIcon::SizeLarge); + for (i=0;i<(mpQuickLaunchSizeBox->count());i++) { + if (mpQuickLaunchSizeBox->text(i) == QString().setNum(mQuickLaunchSize)) { + mpQuickLaunchSizeBox->setCurrentItem(i); + } + } + + // FIXME + // Due to issues with the system tray handling code, mpSysTraySizeBox should be be disabled + // This should be fixed ASAP + // Specifically, kicker does not automatically reconfigure the system tray icon sizes on its configure() DCOP call + mpSysTraySizeBox->setEnabled(false); } void KIconConfig::apply() @@ -450,10 +460,14 @@ void KIconConfig::save() } } - mpConfig->setGroup("System Tray"); - mpConfig->writeEntry("systrayIconWidth", mpSysTraySizeBox->currentText()); + mpSystrayConfig->setGroup("System Tray"); + mpSystrayConfig->writeEntry("systrayIconWidth", mpSysTraySizeBox->currentText()); + mpKickerConfig->setGroup("General"); + mpKickerConfig->writeEntry("panelIconWidth", mpQuickLaunchSizeBox->currentText()); mpConfig->sync(); + mpSystrayConfig->sync(); + mpKickerConfig->sync(); emit changed(false); @@ -466,6 +480,9 @@ void KIconConfig::save() mbChanged[i] = false; } } + + // Signal kicker to reload icon configuration + kapp->dcopClient()->send("kicker", "kicker", "configure()", QByteArray()); } void KIconConfig::defaults() diff --git a/kcontrol/icons/icons.h b/kcontrol/icons/icons.h index b1f167066..2e8d4c6fe 100644 --- a/kcontrol/icons/icons.h +++ b/kcontrol/icons/icons.h @@ -104,6 +104,8 @@ private: KIconTheme *mpTheme; KIconLoader *mpLoader; KConfig *mpConfig; + KSimpleConfig *mpSystrayConfig; + KSimpleConfig *mpKickerConfig; typedef QLabel *QLabelPtr; QLabelPtr mpPreview[3]; @@ -112,7 +114,6 @@ private: QComboBox *mpSizeBox; QComboBox *mpSysTraySizeBox; QComboBox *mpQuickLaunchSizeBox; - QCheckBox *mQLSizeLocked; QCheckBox *mpDPCheck, *wordWrapCB, *underlineCB, *mpAnimatedCheck; QTabWidget *m_pTabWidget; QWidget *m_pTab1; diff --git a/kicker/kicker/core/main.cpp b/kicker/kicker/core/main.cpp index 8eb033e29..aa49f90aa 100644 --- a/kicker/kicker/core/main.cpp +++ b/kicker/kicker/core/main.cpp @@ -109,9 +109,10 @@ extern "C" KDE_EXPORT int kdemain( int argc, char ** argv ) KAboutData aboutData( appname.data(), I18N_NOOP("KDE Panel"), version, description, KAboutData::License_BSD, - I18N_NOOP("(c) 1999-2004, The KDE Team") ); + I18N_NOOP("(c) 1999-2010, The KDE Team") ); - aboutData.addAuthor("Aaron J. Seigo", I18N_NOOP("Current maintainer"), "[email protected]"); + aboutData.addAuthor("Timothy Pearson", I18N_NOOP("Current maintainer"), "[email protected]"); + aboutData.addAuthor("Aaron J. Seigo",0, "[email protected]"); aboutData.addAuthor("Matthias Elter",0, "[email protected]"); aboutData.addAuthor("Matthias Ettrich",0, "[email protected]"); aboutData.addAuthor("Wilco Greven",0, "[email protected]"); diff --git a/kicker/libkicker/global.cpp b/kicker/libkicker/global.cpp index 1f393616d..a0915bcd1 100644 --- a/kicker/libkicker/global.cpp +++ b/kicker/libkicker/global.cpp @@ -33,6 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <kio/netaccess.h> #include <kstandarddirs.h> #include <kservice.h> +#include <ksimpleconfig.h> #include "global.h" #include "kickerSettings.h" @@ -157,7 +158,14 @@ int sizeValue(KPanelExtension::Size s) int maxButtonDim() { - return (2 * KickerSettings::iconMargin()) + KIcon::SizeLarge; + int maxDim; + //return (2 * KickerSettings::iconMargin()) + KIcon::SizeLarge; + + KSimpleConfig *kickerconfig = new KSimpleConfig( QString::fromLatin1( "kickerrc" )); + kickerconfig->setGroup("General"); + maxDim = (2 * KickerSettings::iconMargin()) + kickerconfig->readNumEntry("panelIconWidth", KIcon::SizeLarge);; + delete kickerconfig; + return maxDim; } QString newDesktopFile(const KURL& url) |