소스 검색

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 년 전
부모
커밋
ece59948c3
1개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  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 };
 };
 
 }