1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-23 02:47:34 +00:00
serenity/Libraries/LibDraw/SystemTheme.h
Andreas Kling 7b2dd7e116 LibDraw+LibGUI: Allow changing individual colors in a Palette
Palette is now a value wrapper around a NonnullRefPtr<PaletteImpl>.
A new function, set_color(ColorRole, Color) implements a simple
copy-on-write mechanism so that we're sharing the PaletteImpl in the
common case, but allowing you to create custom palettes if you like,
by getting a GWidget's palette, modifying it, and then assigning the
modified palette to the widget via GWidget::set_palette().

Use this to make PaintBrush show its palette colors once again.

Fixes #943.
2019-12-29 00:47:49 +01:00

53 lines
1 KiB
C

#pragma once
#include <AK/Types.h>
#include <LibDraw/Color.h>
#include <SharedBuffer.h>
enum class ColorRole {
NoRole,
DesktopBackground,
ActiveWindowBorder1,
ActiveWindowBorder2,
ActiveWindowTitle,
InactiveWindowBorder1,
InactiveWindowBorder2,
InactiveWindowTitle,
MovingWindowBorder1,
MovingWindowBorder2,
MovingWindowTitle,
HighlightWindowBorder1,
HighlightWindowBorder2,
HighlightWindowTitle,
MenuStripe,
MenuBase,
MenuBaseText,
MenuSelection,
MenuSelectionText,
Window,
WindowText,
Button,
ButtonText,
Base,
BaseText,
ThreedHighlight,
ThreedShadow1,
ThreedShadow2,
HoverHighlight,
Selection,
SelectionText,
__Count,
Background = Window,
DisabledText = ThreedShadow1,
};
struct SystemTheme {
Color color[(int)ColorRole::__Count];
};
const SystemTheme& current_system_theme();
int current_system_theme_buffer_id();
void set_system_theme(SharedBuffer&);
RefPtr<SharedBuffer> load_system_theme(const String& path);