mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 03:57:15 +02: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:
committed by
Andreas Kling
parent
6ee499aeb0
commit
ca731e2cdd
Notes:
sideshowbarker
2024-07-18 22:19:36 +09:00
Author: https://github.com/ccapitalK Commit: https://github.com/SerenityOS/serenity/commit/ca731e2cdd7 Pull-request: https://github.com/SerenityOS/serenity/pull/5338
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user