void AsemanWinTaskbarButtonEngine::updateBadgeNumber(int number) { if(!_button->window()) { return; } _button->setOverlayIcon( QIcon(QPixmap::fromImage(generateIcon(number))) ); }
void SelectFrameAction::slotDoneClicked() { int newBorder = m_FrameWidget->border(); if(m_CurrentBorder != newBorder) { m_CurrentBorder = newBorder; setIcon(generateIcon()); } emit borderSelected(newBorder); popupMenu()->hide(); }
void EffectsListWidget::loadEffects(const EffectsList *effectlist, QTreeWidgetItem *defaultFolder, const QList<QTreeWidgetItem *> *folders, int type, const QString ¤t, bool *found) { QStringList effectInfo, l; QTreeWidgetItem *item; int ct = effectlist->count(); QFontMetrics f(font()); int fontSize = f.height(); for (int ix = 0; ix < ct; ++ix) { const QDomElement effect = effectlist->at(ix); effectInfo = effectlist->effectInfo(effect); if (effectInfo.isEmpty()) continue; QTreeWidgetItem *parentItem = NULL; if (folders) { for (int i = 0; i < folders->count(); ++i) { l = folders->at(i)->data(0, IdRole).toString().split(QLatin1Char(','), QString::SkipEmptyParts); if (l.contains(effectInfo.at(2))) { parentItem = folders->at(i); break; } } } if (parentItem == NULL) parentItem = defaultFolder; QIcon icon2 = generateIcon(fontSize, effectInfo.at(0), effect); item = new QTreeWidgetItem(parentItem, QStringList(effectInfo.takeFirst())); QString tag = effectInfo.at(0); if (type != EffectsList::EFFECT_CUSTOM && tag.startsWith(QLatin1String("movit."))) { // GPU effect effectInfo.append(QString::number(EffectsList::EFFECT_GPU)); item->setData(0, TypeRole, EffectsList::EFFECT_GPU); } else { effectInfo.append(QString::number(type)); item->setData(0, TypeRole, type); } if (effectInfo.count() == 4) item->setIcon(0, QIcon::fromTheme(QStringLiteral("folder"))); else item->setIcon(0, icon2); item->setData(0, IdRole, effectInfo); item->setToolTip(0, effectlist->getEffectInfo(effect)); if (parentItem == NULL) { addTopLevelItem(item); } if (item->text(0) == current) { setCurrentItem(item); *found = true; } } }
AccountItem::AccountItem(const Tp::AccountPtr &account, AccountsListModel *parent) : QObject(parent), m_account(account), m_icon(new KIcon()) { kDebug(); //connect AccountPtr signals to AccountItem signals connect(m_account.data(), SIGNAL(stateChanged(bool)), SIGNAL(updated())); connect(m_account.data(), SIGNAL(displayNameChanged(const QString&)), SIGNAL(updated())); connect(m_account.data(), SIGNAL(connectionStatusChanged(Tp::ConnectionStatus)), SIGNAL(updated())); generateIcon(); }
void Cutegram::setSysTrayCounter(int count, bool force) { if( count == p->sysTrayCounter && !force ) return; const QImage & img = generateIcon( QImage(SYSTRAY_ICON), count ); if( p->sysTray ) { p->sysTray->setIcon( QPixmap::fromImage(img) ); } else if( p->unityTray ) { QString path = UNITY_ICON_PATH(count); QFile::remove(path); QImageWriter writer(path); writer.write(img); p->unityTray->setIcon(path); } p->sysTrayCounter = count; emit sysTrayCounterChanged(); }
SelectFrameAction::SelectFrameAction(const QString &text, QToolBar *parent) : KToolBarPopupAction(KIcon(), text, parent), m_Parent(parent), m_CurrentBorder(TabularCell::None) { setIcon(generateIcon()); QWidget *page = new QWidget(parent); QVBoxLayout *layout = new QVBoxLayout(); layout->setMargin(0); layout->setSpacing(0); page->setLayout(layout); QWidget *buttonBox = new QWidget(page); QHBoxLayout *buttonBoxLayout = new QHBoxLayout(); buttonBoxLayout->setMargin(0); buttonBoxLayout->setSpacing(KDialog::spacingHint()); buttonBox->setLayout(buttonBoxLayout); m_pbNone = new QToolButton(buttonBox); m_pbLeftRight = new QToolButton(buttonBox); m_pbTopBottom = new QToolButton(buttonBox); m_pbAll = new QToolButton(buttonBox); m_pbNone->setIcon(QIcon(QPixmap(const_cast<const char**>(no_border_xpm)))); m_pbLeftRight->setIcon(QIcon(QPixmap(const_cast<const char**>(lr_border_xpm)))); m_pbTopBottom->setIcon(QIcon(QPixmap(const_cast<const char**>(tb_border_xpm)))); m_pbAll->setIcon(QIcon(QPixmap(const_cast<const char**>(all_border_xpm)))); buttonBoxLayout->addStretch(); buttonBoxLayout->addWidget(m_pbNone); buttonBoxLayout->addWidget(m_pbLeftRight); buttonBoxLayout->addWidget(m_pbTopBottom); buttonBoxLayout->addWidget(m_pbAll); buttonBoxLayout->addStretch(); QWidget *frameWidget = new QWidget(page); QHBoxLayout *frameWidgetLayout = new QHBoxLayout(); frameWidgetLayout->setMargin(0); frameWidgetLayout->setSpacing(KDialog::spacingHint()); frameWidget->setLayout(frameWidgetLayout); m_FrameWidget = new TabularFrameWidget(frameWidget); frameWidgetLayout->addStretch(); frameWidgetLayout->addWidget(m_FrameWidget); frameWidgetLayout->addStretch(); m_pbDone = new KPushButton(KIcon("dialog-ok-apply"), i18n("Apply"), page); layout->addWidget(buttonBox); layout->addWidget(frameWidget); layout->addWidget(m_pbDone); QWidgetAction *widgetAction = new QWidgetAction(this); widgetAction->setDefaultWidget(page); popupMenu()->addAction(widgetAction); connect(this, SIGNAL(triggered(bool)), this, SLOT(slotTriggered())); connect(m_pbNone, SIGNAL(clicked()), this, SLOT(slotNoneClicked())); connect(m_pbLeftRight, SIGNAL(clicked()), this, SLOT(slotLeftRightClicked())); connect(m_pbTopBottom, SIGNAL(clicked()), this, SLOT(slotTopBottomClicked())); connect(m_pbAll, SIGNAL(clicked()), this, SLOT(slotAllClicked())); connect(m_pbDone, SIGNAL(clicked()), this, SLOT(slotDoneClicked())); }