Browse Source

LibGfx: Expand TextAttributes with more information about underlining

This adds a seperate Color to be used for underlines as well as support
for different underline styles.
Tobias Christiansen 3 years ago
parent
commit
ece59948c3
1 changed files with 10 additions and 1 deletions
  1. 10 1
      Userland/Libraries/LibGfx/TextAttributes.h

+ 10 - 1
Userland/Libraries/LibGfx/TextAttributes.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2022, Tobias Christiansen <tobyase@serenityos.org>
  *
  * SPDX-License-Identifier: BSD-2-Clause
  */
@@ -12,10 +13,18 @@
 namespace Gfx {
 
 struct TextAttributes {
+    enum class UnderlineStyle {
+        Solid,
+        Wavy
+    };
+
     Color color;
-    Optional<Color> background_color;
+    Optional<Color> background_color {};
     bool underline { false };
     bool bold { false };
+
+    Optional<Color> underline_color {};
+    UnderlineStyle underline_style { UnderlineStyle::Solid };
 };
 
 }