mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +00:00
LibGfx: Make Palette::color(ColorRole) inline
This commit is contained in:
parent
767ff06f56
commit
22baa5e64f
2 changed files with 7 additions and 13 deletions
|
@ -49,17 +49,6 @@ Palette::~Palette()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
const SystemTheme& PaletteImpl::theme() const
|
|
||||||
{
|
|
||||||
return *m_theme_buffer.data<SystemTheme>();
|
|
||||||
}
|
|
||||||
|
|
||||||
Color PaletteImpl::color(ColorRole role) const
|
|
||||||
{
|
|
||||||
ASSERT((int)role < (int)ColorRole::__Count);
|
|
||||||
return Color::from_rgba(theme().color[(int)role]);
|
|
||||||
}
|
|
||||||
|
|
||||||
int PaletteImpl::metric(MetricRole role) const
|
int PaletteImpl::metric(MetricRole role) const
|
||||||
{
|
{
|
||||||
ASSERT((int)role < (int)MetricRole::__Count);
|
ASSERT((int)role < (int)MetricRole::__Count);
|
||||||
|
|
|
@ -44,10 +44,15 @@ public:
|
||||||
static NonnullRefPtr<PaletteImpl> create_with_anonymous_buffer(Core::AnonymousBuffer);
|
static NonnullRefPtr<PaletteImpl> create_with_anonymous_buffer(Core::AnonymousBuffer);
|
||||||
NonnullRefPtr<PaletteImpl> clone() const;
|
NonnullRefPtr<PaletteImpl> clone() const;
|
||||||
|
|
||||||
Color color(ColorRole) const;
|
Color color(ColorRole role) const
|
||||||
|
{
|
||||||
|
ASSERT((int)role < (int)ColorRole::__Count);
|
||||||
|
return Color::from_rgba(theme().color[(int)role]);
|
||||||
|
}
|
||||||
|
|
||||||
int metric(MetricRole) const;
|
int metric(MetricRole) const;
|
||||||
String path(PathRole) const;
|
String path(PathRole) const;
|
||||||
const SystemTheme& theme() const;
|
const SystemTheme& theme() const { return *m_theme_buffer.data<SystemTheme>(); }
|
||||||
|
|
||||||
void replace_internal_buffer(Badge<GUI::Application>, Core::AnonymousBuffer buffer);
|
void replace_internal_buffer(Badge<GUI::Application>, Core::AnonymousBuffer buffer);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue