void OwnerManagerDlg::updateList() { myOwnerView->clear(); IconManager* iconman = IconManager::instance(); // Get currently active protocols Licq::ProtocolPluginsList protocols; Licq::gPluginManager.getProtocolPluginsList(protocols); BOOST_FOREACH(Licq::ProtocolPlugin::Ptr protocol, protocols) { unsigned long ppid = protocol->protocolId(); QTreeWidgetItem* protoItem = new QTreeWidgetItem(myOwnerView); protoItem->setIcon(0, iconman->iconForProtocol(ppid)); protoItem->setText(0, QString(tr("%1 (Version: %2)")).arg(protocol->name().c_str()) .arg(protocol->version().c_str())); protoItem->setData(0, Qt::UserRole, (unsigned int)ppid); Licq::OwnerListGuard ownerList(ppid); BOOST_FOREACH(const Licq::Owner* o, **ownerList) { Licq::OwnerReadGuard owner(o); QTreeWidgetItem* ownerItem = new QTreeWidgetItem(protoItem); ownerItem->setIcon(0, iconman->iconForStatus(owner->status(), owner->id())); ownerItem->setText(0, QString("%1 (%2)") .arg(QString::fromUtf8(owner->id().accountId().c_str())) .arg(owner->statusString(true, false).c_str())); ownerItem->setData(0, Qt::UserRole, QVariant::fromValue(owner->id())); ownerItem->setData(0, Qt::UserRole+1, owner->status()); } }
SMCStyleWidget::SMCStyleWidget(QWidget *parent) : QWidget() { setupUi(this); IconManager* im = IconManager::instance(); fontSizeLabel_->setPixmap(im->loadPixmap("Zeichen.xpm")); trackingLabel_->setPixmap(im->loadPixmap("textkern.png")); widthSpaceLabel->setPixmap(im->loadPixmap("spacewidth.png")); baselineOffsetLabel_->setPixmap(im->loadPixmap("textbase.png")); hscaleLabel_->setPixmap(im->loadPixmap("textscaleh.png")); vscaleLabel_->setPixmap(im->loadPixmap("textscalev.png")); FillIcon->setPixmap(im->loadPixmap("16/color-fill.png")); fillShadeLabel->setPixmap(im->loadPixmap("shade.png")); StrokeIcon->setPixmap(im->loadPixmap("16/color-stroke.png")); strokeShadeLabel->setPixmap(im->loadPixmap("shade.png")); fillColor_->clear(); strokeColor_->clear(); ColorList::Iterator it; QPixmap pm = QPixmap(15, 15); fillColor_->addItem(CommonStrings::tr_NoneColor); strokeColor_->addItem(CommonStrings::tr_NoneColor); StrokeIcon->setEnabled(false); strokeShade_->setEnabled(false); strokeColor_->setEnabled(false); connect(effects_, SIGNAL(State(int)), this, SLOT(slotColorChange())); }
void UserEventCommon::updateIcons() { IconManager* iconman = IconManager::instance(); myMenu->setIcon(iconman->getIcon(IconManager::MenuIcon)); myHistory->setIcon(iconman->getIcon(IconManager::HistoryIcon)); myInfo->setIcon(iconman->getIcon(IconManager::InfoIcon)); myEncoding->setIcon(iconman->getIcon(IconManager::EncodingIcon)); }
void SMLineStyleWidget::fillJoinCombo() { IconManager* im = IconManager::instance(); joinCombo->clear(); joinCombo->addItem(im->loadIcon("MiterJoin.png"), tr( "Miter Join" ) ); joinCombo->addItem(im->loadIcon("BevelJoin.png"), tr( "Bevel Join" ) ); joinCombo->addItem(im->loadIcon("RoundJoin.png"), tr( "Round Join" ) ); }
void SMLineStyleWidget::fillEndCombo() { IconManager* im = IconManager::instance(); endCombo->clear(); endCombo->addItem(im->loadIcon("ButtCap.png"), tr( "Flat Cap" ) ); endCombo->addItem(im->loadIcon("SquareCap.png"), tr( "Square Cap" ) ); endCombo->addItem(im->loadIcon("RoundCap.png"), tr( "Round Cap" ) ); }
SMLineStyleWidget::SMLineStyleWidget() : QWidget() { setupUi(this); IconManager* im = IconManager::instance(); addButton->setIcon(im->loadIcon("penciladd.png")); removeButton->setIcon(im->loadIcon("pencilsub.png")); lineWidth->setMinimum(0.0); lineWidth->setMaximum(300.0); fillEndCombo(); fillJoinCombo(); languageChange(); }
SMLineStyleWidget::SMLineStyleWidget() : QWidget() { setupUi(this); IconManager* im = IconManager::instance(); addButton->setIcon(im->loadIcon("penciladd.png")); removeButton->setIcon(im->loadIcon("pencilsub.png")); lineWidth->setMinimum(0.0); lineWidth->setMaximum(300.0); endCombo->addItem(im->loadIcon("ButtCap.png"), tr( "Flat Cap" ) ); endCombo->addItem(im->loadIcon("SquareCap.png"), tr( "Square Cap" ) ); endCombo->addItem(im->loadIcon("RoundCap.png"), tr( "Round Cap" ) ); joinCombo->addItem(im->loadIcon("MiterJoin.png"), tr( "Miter Join" ) ); joinCombo->addItem(im->loadIcon("BevelJoin.png"), tr( "Bevel Join" ) ); joinCombo->addItem(im->loadIcon("RoundJoin.png"), tr( "Round Join" ) ); languageChange(); }
void AlignDistributePalette::init() { undoManager = UndoManager::instance(); IconManager* im = IconManager::instance(); alignLeftOutToolButton->setIcon(im->loadIcon("22/align-horizontal-left-out.png")); alignLeftInToolButton->setIcon(im->loadIcon("22/align-horizontal-left.png")); alignCenterHorToolButton->setIcon(im->loadIcon("22/align-horizontal-center.png")); alignRightInToolButton->setIcon(im->loadIcon("22/align-horizontal-right.png")); alignRightOutToolButton->setIcon(im->loadIcon("22/align-horizontal-right-out.png")); alignTopOutToolButton->setIcon(im->loadIcon("22/align-vertical-top-out.png")); alignTopInToolButton->setIcon(im->loadIcon("22/align-vertical-top.png")); alignCenterVerToolButton->setIcon(im->loadIcon("22/align-vertical-center.png")); alignBottomInToolButton->setIcon(im->loadIcon("22/align-vertical-bottom.png")); alignBottomOutToolButton->setIcon(im->loadIcon("22/align-vertical-bottom-out.png")); distributeLeftToolButton->setIcon(im->loadIcon("22/distribute-horizontal-left.png")); distributeCenterHToolButton->setIcon(im->loadIcon("22/distribute-horizontal-center.png")); distributeRightToolButton->setIcon(im->loadIcon("22/distribute-horizontal-right.png")); distributeDistHToolButton->setIcon(im->loadIcon("22/distribute-horizontal-equal.png")); distributeBottomToolButton->setIcon(im->loadIcon("22/distribute-vertical-bottom.png")); distributeCenterVToolButton->setIcon(im->loadIcon("22/distribute-vertical-center.png")); distributeTopToolButton->setIcon(im->loadIcon("22/distribute-vertical-top.png")); distributeDistVToolButton->setIcon(im->loadIcon("22/distribute-vertical-equal.png")); distributeAcrossPageToolButton->setIcon(im->loadIcon("22/distribute-horizontal-page.png")); distributeDownPageToolButton->setIcon(im->loadIcon("22/distribute-vertical-page.png")); distributeAcrossMarginsToolButton->setIcon(im->loadIcon("22/distribute-horizontal-margin.png")); distributeDownMarginsToolButton->setIcon(im->loadIcon("22/distribute-vertical-margin.png")); distributeDistValueHToolButton->setIcon(im->loadIcon("22/distribute-horizontal-x.png")); distributeDistValueVToolButton->setIcon(im->loadIcon("22/distribute-vertical-y.png")); swapLeftToolButton->setIcon(im->loadIcon("22/swap-left.png")); swapRightToolButton->setIcon(im->loadIcon("22/swap-right.png")); QSize s(24,24); alignLeftOutToolButton->setMinimumSize(s); alignLeftInToolButton->setMinimumSize(s); alignCenterHorToolButton->setMinimumSize(s); alignRightInToolButton->setMinimumSize(s); alignRightOutToolButton->setMinimumSize(s); alignTopOutToolButton->setMinimumSize(s); alignTopInToolButton->setMinimumSize(s); alignCenterVerToolButton->setMinimumSize(s); alignBottomInToolButton->setMinimumSize(s); alignBottomOutToolButton->setMinimumSize(s); distributeLeftToolButton->setMinimumSize(s); distributeCenterHToolButton->setMinimumSize(s); distributeRightToolButton->setMinimumSize(s); distributeDistHToolButton->setMinimumSize(s); distributeBottomToolButton->setMinimumSize(s); distributeCenterVToolButton->setMinimumSize(s); distributeTopToolButton->setMinimumSize(s); distributeDistVToolButton->setMinimumSize(s); distributeAcrossPageToolButton->setMinimumSize(s); distributeDownPageToolButton->setMinimumSize(s); distributeAcrossMarginsToolButton->setMinimumSize(s); distributeDownMarginsToolButton->setMinimumSize(s); distributeDistValueHToolButton->setMinimumSize(s); distributeDistValueVToolButton->setMinimumSize(s); swapLeftToolButton->setMinimumSize(s); swapRightToolButton->setMinimumSize(s); alignLeftOutToolButton->setMaximumSize(s); alignLeftInToolButton->setMaximumSize(s); alignCenterHorToolButton->setMaximumSize(s); alignRightInToolButton->setMaximumSize(s); alignRightOutToolButton->setMaximumSize(s); alignTopOutToolButton->setMaximumSize(s); alignTopInToolButton->setMaximumSize(s); alignCenterVerToolButton->setMaximumSize(s); alignBottomInToolButton->setMaximumSize(s); alignBottomOutToolButton->setMaximumSize(s); distributeLeftToolButton->setMaximumSize(s); distributeCenterHToolButton->setMaximumSize(s); distributeRightToolButton->setMaximumSize(s); distributeDistHToolButton->setMaximumSize(s); distributeBottomToolButton->setMaximumSize(s); distributeCenterVToolButton->setMaximumSize(s); distributeTopToolButton->setMaximumSize(s); distributeDistVToolButton->setMaximumSize(s); distributeAcrossPageToolButton->setMaximumSize(s); distributeDownPageToolButton->setMaximumSize(s); distributeAcrossMarginsToolButton->setMaximumSize(s); distributeDownMarginsToolButton->setMaximumSize(s); distributeDistValueHToolButton->setMaximumSize(s); distributeDistValueVToolButton->setMaximumSize(s); swapLeftToolButton->setMaximumSize(s); swapRightToolButton->setMaximumSize(s); connect(alignLeftOutToolButton, SIGNAL(clicked()), this, SLOT(alignLeftOut())); connect(alignRightOutToolButton, SIGNAL(clicked()), this, SLOT(alignRightOut())); connect(alignBottomInToolButton, SIGNAL(clicked()), this, SLOT(alignBottomIn())); connect(alignRightInToolButton, SIGNAL(clicked()), this, SLOT(alignRightIn())); connect(alignBottomOutToolButton, SIGNAL(clicked()), this, SLOT(alignBottomOut())); connect(alignCenterHorToolButton, SIGNAL(clicked()), this, SLOT(alignCenterHor())); connect(alignLeftInToolButton, SIGNAL(clicked()), this, SLOT(alignLeftIn())); connect(alignCenterVerToolButton, SIGNAL(clicked()), this, SLOT(alignCenterVer())); connect(alignTopOutToolButton, SIGNAL(clicked()), this, SLOT(alignTopOut())); connect(alignTopInToolButton, SIGNAL(clicked()), this, SLOT(alignTopIn())); connect(distributeDistHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistH())); connect(distributeDistValueHToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValH())); connect(distributeRightToolButton, SIGNAL(clicked()), this, SLOT(distributeRight())); connect(distributeBottomToolButton, SIGNAL(clicked()), this, SLOT(distributeBottom())); connect(distributeCenterHToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterH())); connect(distributeDistVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistV())); connect(distributeDistValueVToolButton, SIGNAL(clicked()), this, SLOT(distributeDistValV())); connect(distributeLeftToolButton, SIGNAL(clicked()), this, SLOT(distributeLeft())); connect(distributeCenterVToolButton, SIGNAL(clicked()), this, SLOT(distributeCenterV())); connect(distributeTopToolButton, SIGNAL(clicked()), this, SLOT(distributeTop())); connect(distributeAcrossPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossPage())); connect(distributeDownPageToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownPage())); connect(distributeAcrossMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistAcrossMargins())); connect(distributeDownMarginsToolButton, SIGNAL(clicked()), this, SLOT(distributeDistDownMargins())); connect(swapLeftToolButton, SIGNAL(clicked()), this, SLOT(swapLeft())); connect(swapRightToolButton, SIGNAL(clicked()), this, SLOT(swapRight())); alignRelativeToCombo->setCurrentIndex(0); alignToChanged(0); alignMethodChanged(0); connect(alignRelativeToCombo, SIGNAL(activated(int)), this, SLOT(alignToChanged(int))); connect(alignMoveOrResizeCombo, SIGNAL(activated(int)), this, SLOT(alignMethodChanged(int))); unitRatio=1.0; guideDirection=-1; guideInfoText = guideInfoTextNone; alignGuideLineEdit->setText(guideInfoTextNone); }
void GroupMenu::updateIcons() { IconManager* iconman = IconManager::instance(); myRemoveGroupAction->setIcon(iconman->getIcon(IconManager::RemoveIcon)); }
void ModeTabBar::paintEvent(QPaintEvent *event) { QPainter p(this); IconManager *iconManager = IconManager::instance(); QLinearGradient bgGrad(rect().topLeft(), rect().topRight()); bgGrad.setColorAt(0.5, palette().color(QPalette::Window)); bgGrad.setColorAt(1.0, palette().color(QPalette::Midlight)); p.fillRect(rect(), bgGrad); p.setPen(palette().color(QPalette::Shadow)); p.drawLine(width() - 1, 0, width() - 1, height()); for(int i = 0; i < count(); ++i) { p.save(); QFont labelFont = font(); labelFont.setBold(true); p.setFont(labelFont); QRect rect = tabRect(i); int textHeight = p.fontMetrics().boundingRect(QRect(0, 0, width(), height()), 0, tabLabel(i)).height(); QRect labelRect(QPoint(rect.left() + tabPadding, rect.bottom() - textHeight - tabPadding), QSize(rect.width() - (tabPadding * 2), textHeight)); int iconSize = rect.height() - textHeight - (3 * tabPadding); QRect iconRect(QPoint((rect.width() - iconSize) / 2, rect.top() + tabPadding), QSize(iconSize, iconSize)); bool isSelected = (i == m_currentIndex); bool isEnabled = isTabEnabled(i); bool isHovered = (i == m_hoverIndex); if(isHovered && isEnabled) { p.fillRect(rect.adjusted(0, 0, -1, 0), QColor(0, 0, 0, 24)); } if(isSelected) { p.save(); p.setPen(palette().color(QPalette::Shadow)); p.drawLine(rect.topLeft(), rect.topRight()); p.drawLine(rect.bottomLeft(), rect.bottomRight()); p.fillRect(rect.adjusted(0, 0, -1, 0), QColor(0, 0, 0, 32)); p.translate(rect.width() - 6, rect.top() + (rect.height() / 2) - 12); QPolygon arrowPoly; arrowPoly.append(QPoint(7, 0)); arrowPoly.append(QPoint(7, 24)); arrowPoly.append(QPoint(0, 12)); p.translate(0, 1); p.setBrush(palette().color(QPalette::Shadow)); p.setPen(palette().color(QPalette::Shadow)); p.setRenderHint(QPainter::Antialiasing); p.drawPolygon(arrowPoly); p.translate(0, -1); p.setBrush(palette().color(QPalette::Light)); p.drawPolygon(arrowPoly); p.restore(); } if(!isEnabled) p.setOpacity(0.6); QIcon icon(iconManager->icon(tabIcon(i))); QPixmap pixmap = icon.pixmap(iconSize, iconSize, isEnabled ? QIcon::Normal : QIcon::Disabled); p.drawPixmap(iconRect, pixmap); p.setPen(palette().color(QPalette::Text)); p.drawText(labelRect, Qt::AlignCenter, tabLabel(i)); p.restore(); } }