Пример #1
0
void PanelButton::updateKickerTip(KickerTip::Data& data)
{
    data.message = QStyleSheet::escape(title());
    data.subtext = QStyleSheet::escape(QToolTip::textFor(this));
    data.icon = zoomIcon();
    data.direction = popupDirection();
}
Пример #2
0
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();
}
Пример #3
0
void QuickLauncher::positionChange(Position)
{
    for (int n=0; n<int(m_buttons->size()); ++n)
    {
        (*m_buttons)[n]->setPopupDirection(popupDirection());
    }
}
Пример #4
0
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;
}
Пример #5
0
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));
}
Пример #6
0
void BrowserButton::slotDelayedPopup()
{
    topMenu->initialize();
    topMenu->popup(Plasma::popupPosition(popupDirection(), topMenu, this));
    setDown(false);
}