Attempt to make icon states

This commit is contained in:
Balkron
2020-11-02 01:35:46 +05:00
parent fa3939217a
commit 0e4b72d70b
2 changed files with 21 additions and 1 deletions

View File

@@ -42,7 +42,7 @@ namespace noggit
{
auto layout (new QFormLayout (this));
auto brush_group (new QGroupBox (this));
auto brush_group(new QGroupBox("Brush", this));
auto brush_layout (new QFormLayout (brush_group));
_radius_spin = new QDoubleSpinBox (this);

View File

@@ -37,8 +37,26 @@ namespace noggit
temp_btn->ensurePolished();
painter->setPen (temp_btn->palette().color(QPalette::WindowText));
QColor normal_button_color;
if (mode == QIcon::Normal)
{
normal_button_color = temp_btn->palette().color(QPalette::WindowText);
}
QColor off_button_color;
if (state == QIcon::Off)
{
off_button_color = temp_btn->palette().color(QPalette::Shadow);
}
QColor disabled_button_color;
if (mode == QIcon::Disabled)
{
disabled_button_color = temp_btn->palette().color(QPalette::BrightText);
}
delete temp_btn;
if (!_fonts.count (rect.height()))
{
auto id (QFontDatabase::addApplicationFont (":/fonts/fa-solid-900.ttf"));
@@ -82,5 +100,7 @@ namespace noggit
font_awesome_icon::font_awesome_icon (font_awesome::icons const& icon)
: QIcon (new font_awesome_icon_engine (QString (QChar (icon))))
{}
}
}