diff options
author | Timothy Pearson <[email protected]> | 2014-07-07 11:37:01 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2014-07-07 11:37:01 -0500 |
commit | 6ee99456cc9fbcf6a6f61e4dd293a6cf438075a5 (patch) | |
tree | cc8482d2619026592bc68e905bc3e5374e3a204c /kcontrol | |
parent | 88bcfba011fddfce00ff48f2162b8b6ebffcdea8 (diff) | |
download | tdebase-6ee99456cc9fbcf6a6f61e4dd293a6cf438075a5.tar.gz tdebase-6ee99456cc9fbcf6a6f61e4dd293a6cf438075a5.zip |
Fix tderandrtray abort on startup due to oversized tray icon creation when icon widget has not yet been shown
Diffstat (limited to 'kcontrol')
-rw-r--r-- | kcontrol/randr/tderandrtray.cpp | 20 | ||||
-rw-r--r-- | kcontrol/randr/tderandrtray.h | 2 |
2 files changed, 18 insertions, 4 deletions
diff --git a/kcontrol/randr/tderandrtray.cpp b/kcontrol/randr/tderandrtray.cpp index 31615b3cd..32f6f39ac 100644 --- a/kcontrol/randr/tderandrtray.cpp +++ b/kcontrol/randr/tderandrtray.cpp @@ -54,9 +54,9 @@ KRandRSystemTray::KRandRSystemTray(TQWidget* parent, const char *name) , m_popupUp(false) , m_help(new KHelpMenu(this, TDEGlobal::instance()->aboutData(), false, actionCollection())) { - TDEPopupMenu *help = m_help->menu(); - help->connectItem(KHelpMenu::menuHelpContents, this, TQT_SLOT(slotHelpContents())); - setPixmap(KSystemTray::loadSizedIcon("randr", width())); + TDEPopupMenu *help = m_help->menu(); + help->connectItem(KHelpMenu::menuHelpContents, this, TQT_SLOT(slotHelpContents())); + setPixmap(KSystemTray::loadIcon("randr")); setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); connect(this, TQT_SIGNAL(quitSelected()), this, TQT_SLOT(_quit())); TQToolTip::add(this, i18n("Screen resize & rotate")); @@ -113,7 +113,7 @@ void KRandRSystemTray::_quit (){ exit(0); } -void KRandRSystemTray::resizeEvent ( TQResizeEvent * ) +void KRandRSystemTray::resizeTrayIcon () { // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes TQPixmap origpixmap; @@ -126,6 +126,18 @@ void KRandRSystemTray::resizeEvent ( TQResizeEvent * ) setPixmap(scaledpixmap); } +void KRandRSystemTray::resizeEvent ( TQResizeEvent * ) +{ + // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes + resizeTrayIcon(); +} + +void KRandRSystemTray::showEvent ( TQShowEvent * ) +{ + // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes + resizeTrayIcon(); +} + void KRandRSystemTray::mousePressEvent(TQMouseEvent* e) { // Popup the context menu with left-click diff --git a/kcontrol/randr/tderandrtray.h b/kcontrol/randr/tderandrtray.h index 542570619..09a1b2671 100644 --- a/kcontrol/randr/tderandrtray.h +++ b/kcontrol/randr/tderandrtray.h @@ -63,6 +63,7 @@ protected slots: protected: void mousePressEvent( TQMouseEvent *e ); void resizeEvent ( TQResizeEvent * ); + void showEvent ( TQShowEvent * ); private: void populateMenu(TDEPopupMenu* menu); @@ -71,6 +72,7 @@ private: int GetHackResolutionParameter(); void findPrimaryDisplay(); void reloadDisplayConfiguration(); + void resizeTrayIcon(); bool m_popupUp; KHelpMenu* m_help; |