MCPcopy Create free account
hub / github.com/czyt1988/SARibbon / createColorButton

Method createColorButton

example/ThemeDesignerExample/mainwindow.cpp:390–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390void MainWindow::createColorButton(SARibbonPanel* panel, const QString& tokenName,
391 const QString& displayName, const QColor& defaultColor,
392 bool isLarge)
393{
394 SARibbonColorToolButton* btn = new SARibbonColorToolButton(panel);
395 btn->setColor(defaultColor);
396 btn->setColorStyle(SARibbonColorToolButton::ColorFillToIcon);
397 btn->setToolTip(tokenName);
398 if (isLarge) {
399 btn->setButtonType(SARibbonToolButton::LargeButton);
400 btn->setText(displayName);
401 panel->addLargeWidget(btn);
402 } else {
403 btn->setText(displayName);
404 panel->addSmallWidget(btn);
405 }
406 btn->setupStandardColorMenu();
407 m_colorButtons.insert(tokenName, btn);
408}
409
410void MainWindow::populateGallery(SARibbonGallery* gallery)
411{

Callers

nothing calls this directly

Calls 9

setColorMethod · 0.45
setColorStyleMethod · 0.45
setToolTipMethod · 0.45
setButtonTypeMethod · 0.45
setTextMethod · 0.45
addLargeWidgetMethod · 0.45
addSmallWidgetMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected