SimpleColors(ColorPopup* colorPopup, TooltipManager* tooltips) { for (int i=0; i<g_simplePal->size(); ++i) { doc::color_t c = g_simplePal->getEntry(i); app::Color color = app::Color::fromRgb(doc::rgba_getr(c), doc::rgba_getg(c), doc::rgba_getb(c), doc::rgba_geta(c)); Item* item = new Item(colorPopup, color); item->InitTheme.connect( [item]{ item->setSizeHint(gfx::Size(16, 16)*ui::guiscale()); item->setStyle(skin::SkinTheme::instance()->styles.simpleColor()); }); item->initTheme(); addChild(item); tooltips->addTooltipFor( item, g_simplePal->getEntryName(i), BOTTOM); } }
void deselect() { for (int i=0; i<g_simplePal->size(); ++i) { children()[i]->setSelected(false); } }
void selectColor(int index) { for (int i=0; i<g_simplePal->size(); ++i) { children()[i]->setSelected(i == index); } }