diff options
Diffstat (limited to 'kicker/applets/systemtray/systemtrayapplet.cpp')
-rw-r--r-- | kicker/applets/systemtray/systemtrayapplet.cpp | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/kicker/applets/systemtray/systemtrayapplet.cpp b/kicker/applets/systemtray/systemtrayapplet.cpp index 41d5af10b..97b71d1b2 100644 --- a/kicker/applets/systemtray/systemtrayapplet.cpp +++ b/kicker/applets/systemtray/systemtrayapplet.cpp @@ -100,6 +100,7 @@ SystemTrayApplet::SystemTrayApplet(const TQString& configFile, Type type, int ac m_clockApplet = new ClockApplet(configFile, KPanelApplet::Normal, KPanelApplet::Preferences, this, "clockapplet"); updateClockGeometry(); connect(m_clockApplet, TQT_SIGNAL(clockReconfigured()), this, TQT_SLOT(updateClockGeometry())); + connect(m_clockApplet, TQT_SIGNAL(updateLayout()), this, TQT_SLOT(updateClockGeometry())); setBackgroundOrigin(AncestorOrigin); @@ -116,7 +117,17 @@ SystemTrayApplet::SystemTrayApplet(const TQString& configFile, Type type, int ac void SystemTrayApplet::updateClockGeometry() { if (m_clockApplet) - m_clockApplet->setFixedSize(m_clockApplet->widthForHeight(height()-2),height()-2); + { + m_clockApplet->setPosition(position()); + if (orientation() == Qt::Horizontal) + { + m_clockApplet->setFixedSize(m_clockApplet->widthForHeight(height()),height()); + } + else + { + m_clockApplet->setFixedSize(width(),m_clockApplet->heightForWidth(width())); + } + } } void SystemTrayApplet::initialize() @@ -547,9 +558,9 @@ void SystemTrayApplet::embedWindow( WId w, bool kde_tray ) delete emb; return; } - + connect(emb, TQT_SIGNAL(embeddedWindowDestroyed()), TQT_SLOT(updateTrayWindows())); - emb->getIconSize(m_iconSize); + emb->setFixedSize(m_iconSize, m_iconSize); if (shouldHide(w)) { @@ -1142,22 +1153,6 @@ TrayEmbed::~TrayEmbed() // } -void TrayEmbed::getIconSize(int defaultIconSize) -{ - TQSize minSize = minimumSizeHint(); - - int width = minSize.width(); - int height = minSize.height(); - - if (width < 1 || width > defaultIconSize) - width = defaultIconSize; - if (height < 1 || height > defaultIconSize) - height = defaultIconSize; - - setFixedSize(width, height); - setBackground(); -} - void TrayEmbed::setBackground() { const TQPixmap *pbg = parentWidget()->backgroundPixmap(); |