mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:07:35 +00:00
SystemMonitor: Define graphs by ColorRole, not by Color
Currently, graphs are defined in terms of graph color. This means that when the system palette is changed, the old colors are still used. We switch to storing the color roles and looking up the palette colors on paint events. We also define the graph line background color as the graph color at half-transparency.
This commit is contained in:
parent
6ee499aeb0
commit
ca731e2cdd
3 changed files with 21 additions and 16 deletions
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <AK/CircularQueue.h>
|
||||
#include <LibGUI/Frame.h>
|
||||
#include <LibGfx/SystemTheme.h>
|
||||
|
||||
class GraphWidget final : public GUI::Frame {
|
||||
C_OBJECT(GraphWidget)
|
||||
|
@ -40,8 +41,7 @@ public:
|
|||
void add_value(Vector<int, 1>&&);
|
||||
|
||||
struct ValueFormat {
|
||||
Color line_color { Color::Transparent };
|
||||
Color background_color { Color::Transparent };
|
||||
Gfx::ColorRole graph_color_role { Gfx::ColorRole::Base };
|
||||
Color text_shadow_color { Color::Transparent };
|
||||
Function<String(int)> text_formatter;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue