diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-05-10 03:04:21 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-05-10 03:04:21 +0000 |
commit | 5ccb957341daaf5c223a49391f3076e95832ac1f (patch) | |
tree | 0e23ba8717f429560881bedc107e1f6de2c78075 /kcontrol | |
parent | 4d3847fc45c6700ec1667d9616c8f91b734cb75d (diff) | |
download | tdebase-5ccb957341daaf5c223a49391f3076e95832ac1f.tar.gz tdebase-5ccb957341daaf5c223a49391f3076e95832ac1f.zip |
Part of batch commit to enable true tasktray resize support for Trinity applications
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1124757 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol')
-rw-r--r-- | kcontrol/icons/icons.cpp | 44 | ||||
-rw-r--r-- | kcontrol/icons/icons.h | 5 | ||||
-rw-r--r-- | kcontrol/randr/krandrtray.cpp | 15 | ||||
-rw-r--r-- | kcontrol/randr/krandrtray.h | 1 |
4 files changed, 45 insertions, 20 deletions
diff --git a/kcontrol/icons/icons.cpp b/kcontrol/icons/icons.cpp index 37bc31210..4ce1e4d98 100644 --- a/kcontrol/icons/icons.cpp +++ b/kcontrol/icons/icons.cpp @@ -62,12 +62,12 @@ KIconConfig::KIconConfig(QWidget *parent, const char *name) QPushButton *push; - push = addPreviewIcon(0, i18n("Default"), this, g_lay); - connect(push, SIGNAL(clicked()), SLOT(slotEffectSetup0())); - push = addPreviewIcon(1, i18n("Active"), this, g_lay); - connect(push, SIGNAL(clicked()), SLOT(slotEffectSetup1())); - push = addPreviewIcon(2, i18n("Disabled"), this, g_lay); - connect(push, SIGNAL(clicked()), SLOT(slotEffectSetup2())); + mPreviewButton1 = addPreviewIcon(0, i18n("Default"), this, g_lay); + connect(mPreviewButton1, SIGNAL(clicked()), SLOT(slotEffectSetup0())); + mPreviewButton2 = addPreviewIcon(1, i18n("Active"), this, g_lay); + connect(mPreviewButton2, SIGNAL(clicked()), SLOT(slotEffectSetup1())); + mPreviewButton3 = addPreviewIcon(2, i18n("Disabled"), this, g_lay); + connect(mPreviewButton3, SIGNAL(clicked()), SLOT(slotEffectSetup2())); m_pTab1 = new QWidget(this, "General Tab"); top->addWidget(m_pTab1, 0, 1); @@ -278,12 +278,6 @@ void KIconConfig::read() mpKickerConfig->setGroup("General"); mQuickLaunchSize = mpKickerConfig->readNumEntry("panelIconWidth", KIcon::SizeLarge); - - // 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() @@ -455,6 +449,11 @@ void KIconConfig::save() } } + // Reload kicker/systray configuration files; we have no way of knowing if any other parameters changed + // from initial read to this write request + mpSystrayConfig->reparseConfiguration(); + mpKickerConfig->reparseConfiguration(); + mpSystrayConfig->setGroup("System Tray"); mpSystrayConfig->writeEntry("systrayIconWidth", mSysTraySize); mpKickerConfig->setGroup("General"); @@ -478,6 +477,9 @@ void KIconConfig::save() // Signal kicker to reload icon configuration kapp->dcopClient()->send("kicker", "kicker", "configure()", QByteArray()); + + // Signal system tray to reload icon configuration + kapp->dcopClient()->send("kicker", "SystemTrayApplet", "iconSizeChanged()", QByteArray()); } void KIconConfig::defaults() @@ -496,27 +498,35 @@ void KIconConfig::slotUsage(int index) mpSizeBox->setEnabled(true); mpDPCheck->setEnabled(false); mpAnimatedCheck->setEnabled(false); + mPreviewButton1->setEnabled(false); + mPreviewButton2->setEnabled(false); + mPreviewButton3->setEnabled(false); } else if (mpUsageList->text(index) == i18n("System Tray Icons")) { - // 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 - mpSizeBox->setEnabled(false); + mpSizeBox->setEnabled(true); mpDPCheck->setEnabled(false); mpAnimatedCheck->setEnabled(false); + mPreviewButton1->setEnabled(false); + mPreviewButton2->setEnabled(false); + mPreviewButton3->setEnabled(false); } else if ( mUsage == KIcon::Panel || mUsage == KIcon::LastGroup ) { mpSizeBox->setEnabled(false); mpDPCheck->setEnabled(false); mpAnimatedCheck->setEnabled( mUsage == KIcon::Panel ); + mPreviewButton1->setEnabled(true); + mPreviewButton2->setEnabled(true); + mPreviewButton3->setEnabled(true); } else { mpSizeBox->setEnabled(true); mpDPCheck->setEnabled(true); mpAnimatedCheck->setEnabled( mUsage == KIcon::Desktop ); + mPreviewButton1->setEnabled(true); + mPreviewButton2->setEnabled(true); + mPreviewButton3->setEnabled(true); } apply(); diff --git a/kcontrol/icons/icons.h b/kcontrol/icons/icons.h index 7e29e377a..6fa27eee3 100644 --- a/kcontrol/icons/icons.h +++ b/kcontrol/icons/icons.h @@ -115,6 +115,7 @@ private: QCheckBox *mpDPCheck, *wordWrapCB, *underlineCB, *mpAnimatedCheck; QTabWidget *m_pTabWidget; QWidget *m_pTab1; + QPushButton *mPreviewButton1, *mPreviewButton2, *mPreviewButton3; }; class KIconEffectSetupDialog: public KDialogBase @@ -152,6 +153,6 @@ private: QImage mExample; QGroupBox *mpEffectGroup; QLabel *mpPreview, *mpEffectLabel, *mpEffectColor, *mpEffectColor2; -}; - +}; + #endif diff --git a/kcontrol/randr/krandrtray.cpp b/kcontrol/randr/krandrtray.cpp index adfe48e5f..8b230ba74 100644 --- a/kcontrol/randr/krandrtray.cpp +++ b/kcontrol/randr/krandrtray.cpp @@ -51,7 +51,7 @@ KRandRSystemTray::KRandRSystemTray(QWidget* parent, const char *name) , m_popupUp(false) , m_help(new KHelpMenu(this, KGlobal::instance()->aboutData(), false, actionCollection())) { - setPixmap(KSystemTray::loadIcon("randr")); + setPixmap(KSystemTray::loadSizedIcon("randr", width())); setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); connect(this, SIGNAL(quitSelected()), kapp, SLOT(quit())); QToolTip::add(this, i18n("Screen resize & rotate")); @@ -88,6 +88,19 @@ KRandRSystemTray::KRandRSystemTray(QWidget* parent, const char *name) } } +void KRandRSystemTray::resizeEvent ( QResizeEvent * ) +{ + // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes + QPixmap origpixmap; + QPixmap scaledpixmap; + QImage newIcon; + origpixmap = KSystemTray::loadSizedIcon( "randr", width() ); + newIcon = origpixmap; + newIcon = newIcon.smoothScale(width(), height()); + scaledpixmap = newIcon; + setPixmap(scaledpixmap); +} + void KRandRSystemTray::mousePressEvent(QMouseEvent* e) { // Popup the context menu with left-click diff --git a/kcontrol/randr/krandrtray.h b/kcontrol/randr/krandrtray.h index d34c85071..145fb89b0 100644 --- a/kcontrol/randr/krandrtray.h +++ b/kcontrol/randr/krandrtray.h @@ -59,6 +59,7 @@ protected slots: protected: void mousePressEvent( QMouseEvent *e ); + void resizeEvent ( QResizeEvent * ); private: void populateMenu(KPopupMenu* menu); |