Esempio n. 1
0
void NextClient::menuButtonPressed()
{
    // Probably don't need this null check, but we might as well.
    if (button[MENU_IDX]) {
	QRect menuRect = button[MENU_IDX]->rect();
        QPoint menuTop = button[MENU_IDX]->mapToGlobal(menuRect.topLeft());
        QPoint menuBottom = button[MENU_IDX]->mapToGlobal(menuRect.bottomRight());
	menuTop += QPoint(1, 1);
	menuBottom += QPoint(1, 1);
        KDecorationFactory* f = factory();
        showWindowMenu(QRect(menuTop, menuBottom));
        if( !f->exists( this )) // 'this' was deleted
            return;
	button[MENU_IDX]->setDown(false);
    }
}
Esempio n. 2
0
void KniftyClient::menuButtonPressed()
{
    static QTime* t = NULL;
    static KniftyClient* lastClient = NULL;
    if (t == NULL)
        t = new QTime;
    bool dbl = (lastClient == this && t->elapsed() <= QApplication::doubleClickInterval());
    lastClient = this;
    t->start();
    if( !dbl )
    {
        QPoint pos = m_button[ButtonMenu]->mapToGlobal(
            m_button[ButtonMenu]->rect().bottomLeft() );
        KDecorationFactory* f = factory();
        showWindowMenu( pos );
        if( !f->exists( this )) // 'this' was deleted
            return;
        m_button[ButtonMenu]->setDown(false);
    }
    else
       closing = true;
}
Esempio n. 3
0
void KCommonDecoration::menuButtonPressed()
{
    static QTime* t = NULL;
    static KCommonDecoration* lastClient = NULL;
    if (t == NULL)
        t = new QTime;
    bool dbl = (lastClient==this && t->elapsed() <= QApplication::doubleClickInterval());
    lastClient = this;
    t->start();
    if (!dbl || !decorationBehaviour(DB_MenuClose) ) {
        QRect menuRect = m_button[MenuButton]->rect();
        QPoint menutop = m_button[MenuButton]->mapToGlobal(menuRect.topLeft());
        QPoint menubottom = m_button[MenuButton]->mapToGlobal(menuRect.bottomRight())+QPoint(0,2);
        KDecorationFactory* f = factory();
        showWindowMenu(QRect(menutop, menubottom));
        if( !f->exists( this )) // 'this' was deleted
            return;
        m_button[MenuButton]->setDown(false);
    }
    else
        closing = true;
}