mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 22:38:12 +00:00
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.
This commit is contained in:
parent
3b2f20ed4d
commit
fd64e97c8a
9 changed files with 56 additions and 6 deletions
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -38,6 +38,9 @@ enum class ColorRole {
|
|||
SelectionText,
|
||||
RubberBandFill,
|
||||
RubberBandBorder,
|
||||
Link,
|
||||
ActiveLink,
|
||||
VisitedLink,
|
||||
|
||||
__Count,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue