summaryrefslogtreecommitdiffstats
path: root/kcontrol/randr
diff options
context:
space:
mode:
Diffstat (limited to 'kcontrol/randr')
-rw-r--r--kcontrol/randr/tderandrtray.cpp24
-rw-r--r--kcontrol/randr/tderandrtray.h3
2 files changed, 25 insertions, 2 deletions
diff --git a/kcontrol/randr/tderandrtray.cpp b/kcontrol/randr/tderandrtray.cpp
index 1e07cea1d..32f6f39ac 100644
--- a/kcontrol/randr/tderandrtray.cpp
+++ b/kcontrol/randr/tderandrtray.cpp
@@ -54,7 +54,9 @@ KRandRSystemTray::KRandRSystemTray(TQWidget* parent, const char *name)
, m_popupUp(false)
, m_help(new KHelpMenu(this, TDEGlobal::instance()->aboutData(), false, actionCollection()))
{
- 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"));
@@ -111,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;
@@ -124,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
@@ -882,3 +896,9 @@ void KRandRSystemTray::deviceChanged (TDEGenericDevice* device) {
applyHotplugRules(locateLocal("config", "/", true));
}
}
+
+void KRandRSystemTray::slotHelpContents()
+{
+ kapp->invokeHelp(TQString::null, "tderandrtray");
+}
+
diff --git a/kcontrol/randr/tderandrtray.h b/kcontrol/randr/tderandrtray.h
index aee432b4a..09a1b2671 100644
--- a/kcontrol/randr/tderandrtray.h
+++ b/kcontrol/randr/tderandrtray.h
@@ -58,10 +58,12 @@ protected slots:
void slotOutputChanged(int parameter);
void slotColorProfileChanged(int parameter);
void slotDisplayProfileChanged(int parameter);
+ void slotHelpContents();
protected:
void mousePressEvent( TQMouseEvent *e );
void resizeEvent ( TQResizeEvent * );
+ void showEvent ( TQShowEvent * );
private:
void populateMenu(TDEPopupMenu* menu);
@@ -70,6 +72,7 @@ private:
int GetHackResolutionParameter();
void findPrimaryDisplay();
void reloadDisplayConfiguration();
+ void resizeTrayIcon();
bool m_popupUp;
KHelpMenu* m_help;