void PanelButton::updateKickerTip(KickerTip::Data& data) { data.message = QStyleSheet::escape(title()); data.subtext = QStyleSheet::escape(QToolTip::textFor(this)); data.icon = zoomIcon(); data.direction = popupDirection(); }
void xkmenu::buttonClicked() { int x = mapToGlobal(QPoint(0,0)).x(); int y = mapToGlobal(QPoint(0,0)).y(); kdDebug() << k_funcinfo << "applet pos: " << mapToGlobal( QPoint() ) << endl; switch( popupDirection() ) { case Up: y -= m_menu->frameGeometry().height(); break; case Down: y += height(); break; case Left: x -= m_menu->frameGeometry().width(); break; case Right: x += width(); } kdDebug() << k_funcinfo << "menu geo: " << m_menu->frameGeometry() << endl; kdDebug() << k_funcinfo << "dst point: " << QPoint( x, y ) << endl; // Snap to screen edge if we're closer than 20 pixel // (applet handlers can cause ugly spaces) x = x < 20 ? 0 : x; // If right edge is out of desktop put the menu back in desktop ? if( ( x + m_menu->frameGeometry().width() ) > QApplication::desktop()->width() ) { x = QApplication::desktop()->width() - m_menu->frameGeometry().width(); } m_menu->move( x, y ); m_menu->show(); }
void QuickLauncher::positionChange(Position) { for (int n=0; n<int(m_buttons->size()); ++n) { (*m_buttons)[n]->setPopupDirection(popupDirection()); } }
QuickButton* QuickLauncher::createButton(TQString url) { QuickButton* newButton=new QuickButton(url, m_configAction, this); connect(newButton, TQT_SIGNAL(executed(TQString)), this, TQT_SLOT(slotOwnServiceExecuted(TQString))); connect(newButton, TQT_SIGNAL(stickyToggled(bool)), this, TQT_SLOT(slotStickyToggled())); newButton->setPopupDirection(popupDirection()); return newButton; }
void PanelPopupButton::slotExecMenu() { if (!m_popup) { return; } m_pressedDuringPopup = false; KickerTip::enableTipping(false); kapp->syncX(); kapp->processEvents(); if (!m_initialized) { initPopup(); } m_popup->adjustSize(); m_popup->exec(KickerLib::popupPosition(popupDirection(), m_popup, this)); }
void BrowserButton::slotDelayedPopup() { topMenu->initialize(); topMenu->popup(Plasma::popupPosition(popupDirection(), topMenu, this)); setDown(false); }