Пример #1
0
void window_list::handlePropertyNotify(XPropertyEvent* event)
{
    if (event->window == QX11Info::appRootWindow())
    {
        // Windows list changed ...............................
        if (event->atom == XfitMan::atom("_NET_CLIENT_LIST"))
        {
            refreshTaskList();
            return;
        }

        // Activate window ....................................
        if (event->atom == XfitMan::atom("_NET_ACTIVE_WINDOW"))
        {
            activeWindowChanged();
            return;
        }

        // Desktop switch .....................................
        if (event->atom == XfitMan::atom("_NET_CURRENT_DESKTOP"))
        {
            if (this->onlyShowCurrentDesktop)
                refreshTaskList();
            return;
        }
    }
    else
    {
        InstanceOfWindow* btn = buttonByWindow(event->window);
        if (btn)
            btn->handlePropertyNotify(event);
    }
    this->activeWindowChanged();

}
Пример #2
0
void RazorTaskBar::settigsChanged()
{
    buttonMaxWidth = settings().value("maxWidth", 400).toInt();
    QString s = settings().value("buttonStyle").toString().toUpper();

    if (s == "ICON")
    {
        setButtonStyle(Qt::ToolButtonIconOnly);
        buttonMaxWidth = -1;
        setButtonMaxWidth(buttonMaxWidth);
    }
    else if (s == "TEXT")
    {
        setButtonStyle(Qt::ToolButtonTextOnly);
        setButtonMaxWidth(buttonMaxWidth);
    }
    else
    {
        setButtonStyle(Qt::ToolButtonTextBesideIcon);
        setButtonMaxWidth(buttonMaxWidth);
    }

    mShowOnlyCurrentDesktopTasks = settings().value("showOnlyCurrentDesktopTasks", mShowOnlyCurrentDesktopTasks).toBool();
    RazorTaskButton::setShowOnlyCurrentDesktopTasks(mShowOnlyCurrentDesktopTasks);
    refreshTaskList();
}
Пример #3
0
void RazorTaskBar::handlePropertyNotify(XPropertyEvent* event)
{

    if (event->window == mRootWindow)
    {
        // Windows list changed ...............................
        if (event->atom == XfitMan::atom("_NET_CLIENT_LIST"))
        {
            refreshTaskList();
            return;
        }

        // Activate window ....................................
        if (event->atom == XfitMan::atom("_NET_ACTIVE_WINDOW"))
        {
            activeWindowChanged();
            return;
        }

        // Desktop switch .....................................
        if (event->atom == XfitMan::atom("_NET_CURRENT_DESKTOP"))
        {
            if (mShowOnlyCurrentDesktopTasks)
                refreshTaskList();
            return;
        }
    }
    else
    {
        RazorTaskButton* btn = buttonByWindow(event->window);
        if (btn)
            btn->handlePropertyNotify(event);
    }
//    char* aname = XGetAtomName(QX11Info::display(), event->atom);
//    qDebug() << "** XPropertyEvent ********************";
//    qDebug() << "  atom:       0x" << hex << event->atom
//            << " (" << (aname ? aname : "Unknown") << ')';
//    qDebug() << "  window:    " << XfitMan::debugWindow(event->window);
//    qDebug() << "  display:   " << event->display;
//    qDebug() << "  send_event:" << event->send_event;
//    qDebug() << "  serial:    " << event->serial;
//    qDebug() << "  state:     " << event->state;
//    qDebug() << "  time:      " << event->time;
//    qDebug();

}
Пример #4
0
window_list::window_list(subway_panel* parent): Applet(parent)
{
    if(parent != NULL)
    {
	switch(parent->getPosition())
	{
	  case subway_panel::bottom:
	  case subway_panel::top:
	    layout = new QBoxLayout(QBoxLayout::LeftToRight,this);
	    ((QBoxLayout*)layout)->setAlignment(Qt::AlignLeft);
	    ((QBoxLayout*)layout)->setSpacing(0);
	    ((QBoxLayout*)layout)->setMargin(0);
	    ((QBoxLayout*)layout)->setContentsMargins(0,0,0,0);
	  default:
	    break;
	}
    }
    onlyShowCurrentDesktop = true;
    refreshTaskList();
    this->setAttribute(Qt::WA_NativeWindow);
}
Пример #5
0
void RazorTaskBar::settingsChanged()
{
    mButtonWidth = mPlugin->settings()->value("buttonWidth", 400).toInt();
    QString s = mPlugin->settings()->value("buttonStyle").toString().toUpper();

    if (s == "ICON")
    {
        setButtonStyle(Qt::ToolButtonIconOnly);
    }
    else if (s == "TEXT")
    {
        setButtonStyle(Qt::ToolButtonTextOnly);
    }
    else
    {
        setButtonStyle(Qt::ToolButtonTextBesideIcon);
    }

    mShowOnlyCurrentDesktopTasks = mPlugin->settings()->value("showOnlyCurrentDesktopTasks", mShowOnlyCurrentDesktopTasks).toBool();
    RazorTaskButton::setShowOnlyCurrentDesktopTasks(mShowOnlyCurrentDesktopTasks);
    RazorTaskButton::setCloseOnMiddleClick(mPlugin->settings()->value("closeOnMiddleClick", true).toBool());
    refreshTaskList();
}