Exemple #1
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();
}
Exemple #2
0
void window_list::refreshTaskList()
{
    XfitMan xf = xfitMan();
    QList<Window> tmp = xf.getClientList();

    //qDebug() << "** Fill ********************************";
    //foreach (Window wnd, tmp)
    //    if (xf->acceptWindow(wnd)) qDebug() << XfitMan::debugWindow(wnd);
    //qDebug() << "****************************************";


    QMutableHashIterator<Window, InstanceOfWindow*> i(buttons);
    while (i.hasNext())
    {
        i.next();
        int n = tmp.removeAll(i.key());

        if (!n)
        {
            //delete i.value();
	    i.value()->deleteLater();
            i.remove();
        }
    }

    foreach (Window wnd, tmp)
    {
        if (xf.acceptWindow(wnd))
        {
            InstanceOfWindow* btn = new InstanceOfWindow(this,wnd);
            //btn->setToolButtonStyle();

            buttons.insert(wnd, btn);
            // -1 is here due the last stretchable item
            layout->insertWidget(layout->count()-1, btn);
            // now I want to set higher stretchable priority for buttons
            // to suppress stretchItem (last item) default value which
            // will remove that anoying aggresive space at the end -- petr
            layout->setStretch(layout->count()-2, 1);
	    //layout->addWidget(btn);
        }
    }
    setButtonMaxWidth();
    refreshButtonVisibility();

    activeWindowChanged();
    

}