diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-13 20:33:15 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-13 20:33:15 +0100 |
commit | fd64e97c8afb46b5e152bd18d0376c2094c9f3f3 (patch) | |
tree | 678728c143762318a1b09dd8645521f5668feec3 /Libraries/LibDraw | |
parent | 3b2f20ed4d393b93de3dd84cf6290ec5fb089593 (diff) | |
download | serenity-fd64e97c8afb46b5e152bd18d0376c2094c9f3f3.zip |
LibDraw+LibHTML: Make link colors themeable
Add "Link", "ActiveLink" and "VisitedLink" colors to the system theme
definition, and implement support for them in LibHTML.
Note that <body link="foo" alink="bar" vlink="baz"> takes precedence
over the system colors. Author style also takes precedence, since we
only fetch the system color in case the CSS color is -libhtml-link.
Diffstat (limited to 'Libraries/LibDraw')
-rw-r--r-- | Libraries/LibDraw/Palette.h | 4 | ||||
-rw-r--r-- | Libraries/LibDraw/SystemTheme.cpp | 3 | ||||
-rw-r--r-- | Libraries/LibDraw/SystemTheme.h | 3 |
3 files changed, 10 insertions, 0 deletions
diff --git a/Libraries/LibDraw/Palette.h b/Libraries/LibDraw/Palette.h index 52d375fdec..501e59e82d 100644 --- a/Libraries/LibDraw/Palette.h +++ b/Libraries/LibDraw/Palette.h @@ -63,6 +63,10 @@ public: Color rubber_band_fill() const { return color(ColorRole::RubberBandFill); } Color rubber_band_border() const { return color(ColorRole::RubberBandBorder); } + Color link() const { return color(ColorRole::Link); } + Color active_link() const { return color(ColorRole::ActiveLink); } + Color visited_link() const { return color(ColorRole::VisitedLink); } + Color color(ColorRole role) const { return m_impl->color(role); } void set_color(ColorRole, Color); diff --git a/Libraries/LibDraw/SystemTheme.cpp b/Libraries/LibDraw/SystemTheme.cpp index f6a0ba508b..e352841baa 100644 --- a/Libraries/LibDraw/SystemTheme.cpp +++ b/Libraries/LibDraw/SystemTheme.cpp @@ -74,6 +74,9 @@ RefPtr<SharedBuffer> load_system_theme(const String& path) DO_COLOR(MenuSelectionText); DO_COLOR(RubberBandFill); DO_COLOR(RubberBandBorder); + DO_COLOR(Link); + DO_COLOR(ActiveLink); + DO_COLOR(VisitedLink); buffer->seal(); buffer->share_globally(); diff --git a/Libraries/LibDraw/SystemTheme.h b/Libraries/LibDraw/SystemTheme.h index 74d3d90c44..d1528dfd37 100644 --- a/Libraries/LibDraw/SystemTheme.h +++ b/Libraries/LibDraw/SystemTheme.h @@ -38,6 +38,9 @@ enum class ColorRole { SelectionText, RubberBandFill, RubberBandBorder, + Link, + ActiveLink, + VisitedLink, __Count, |