|
@@ -10,6 +10,7 @@
|
|
#include <LibGUI/Icon.h>
|
|
#include <LibGUI/Icon.h>
|
|
#include <LibGfx/Bitmap.h>
|
|
#include <LibGfx/Bitmap.h>
|
|
#include <LibGfx/Font.h>
|
|
#include <LibGfx/Font.h>
|
|
|
|
+#include <LibGfx/SystemTheme.h>
|
|
|
|
|
|
namespace GUI {
|
|
namespace GUI {
|
|
|
|
|
|
@@ -33,6 +34,7 @@ public:
|
|
Variant(const Gfx::IntRect&);
|
|
Variant(const Gfx::IntRect&);
|
|
Variant(const Gfx::Font&);
|
|
Variant(const Gfx::Font&);
|
|
Variant(const Gfx::TextAlignment);
|
|
Variant(const Gfx::TextAlignment);
|
|
|
|
+ Variant(const Gfx::ColorRole);
|
|
Variant(const JsonValue&);
|
|
Variant(const JsonValue&);
|
|
Variant(Color);
|
|
Variant(Color);
|
|
|
|
|
|
@@ -62,6 +64,7 @@ public:
|
|
Rect,
|
|
Rect,
|
|
Font,
|
|
Font,
|
|
TextAlignment,
|
|
TextAlignment,
|
|
|
|
+ ColorRole,
|
|
};
|
|
};
|
|
|
|
|
|
bool is_valid() const { return m_type != Type::Invalid; }
|
|
bool is_valid() const { return m_type != Type::Invalid; }
|
|
@@ -80,6 +83,7 @@ public:
|
|
bool is_rect() const { return m_type == Type::Rect; }
|
|
bool is_rect() const { return m_type == Type::Rect; }
|
|
bool is_font() const { return m_type == Type::Font; }
|
|
bool is_font() const { return m_type == Type::Font; }
|
|
bool is_text_alignment() const { return m_type == Type::TextAlignment; }
|
|
bool is_text_alignment() const { return m_type == Type::TextAlignment; }
|
|
|
|
+ bool is_color_role() const { return m_type == Type::ColorRole; }
|
|
Type type() const { return m_type; }
|
|
Type type() const { return m_type; }
|
|
|
|
|
|
bool as_bool() const
|
|
bool as_bool() const
|
|
@@ -234,6 +238,13 @@ public:
|
|
return m_value.as_text_alignment;
|
|
return m_value.as_text_alignment;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Gfx::ColorRole to_color_role() const
|
|
|
|
+ {
|
|
|
|
+ if (type() != Type::ColorRole)
|
|
|
|
+ return Gfx::ColorRole::NoRole;
|
|
|
|
+ return m_value.as_color_role;
|
|
|
|
+ }
|
|
|
|
+
|
|
Color to_color(Color default_value = {}) const
|
|
Color to_color(Color default_value = {}) const
|
|
{
|
|
{
|
|
if (type() == Type::Color)
|
|
if (type() == Type::Color)
|
|
@@ -283,6 +294,7 @@ private:
|
|
float as_float;
|
|
float as_float;
|
|
Gfx::RGBA32 as_color;
|
|
Gfx::RGBA32 as_color;
|
|
Gfx::TextAlignment as_text_alignment;
|
|
Gfx::TextAlignment as_text_alignment;
|
|
|
|
+ Gfx::ColorRole as_color_role;
|
|
RawPoint as_point;
|
|
RawPoint as_point;
|
|
RawSize as_size;
|
|
RawSize as_size;
|
|
RawRect as_rect;
|
|
RawRect as_rect;
|