ui/common/wrapper.c

changeset 746
7899792496cb
parent 736
3ad4792ffadc
child 782
a72d7509d292
--- a/ui/common/wrapper.c	Sun Aug 31 09:44:53 2025 +0200
+++ b/ui/common/wrapper.c	Sun Aug 31 10:31:42 2025 +0200
@@ -262,3 +262,40 @@
     }
     return NULL;
 }
+
+/* ---------------------------- UiTextStyle ---------------------------- */
+
+void ui_textstyle_set_bold(UiTextStyle *style, UiBool set) {
+    if(set) {
+        style->text_style |= UI_TEXT_STYLE_BOLD;
+    } else {
+        style->text_style &= ~UI_TEXT_STYLE_BOLD;
+    }
+}
+
+void ui_textstyle_set_underline(UiTextStyle *style, UiBool set) {
+    if(set) {
+        style->text_style |= UI_TEXT_STYLE_UNDERLINE;
+    } else {
+        style->text_style &= ~UI_TEXT_STYLE_UNDERLINE;
+    }
+}
+
+void ui_textstyle_set_italic(UiTextStyle *style, UiBool set) {
+    if(set) {
+        style->text_style |= UI_TEXT_STYLE_ITALIC;
+    } else {
+        style->text_style &= ~UI_TEXT_STYLE_ITALIC;
+    }
+}
+
+void ui_textstyle_set_color(UiTextStyle *style, int r, int g, int b) {
+    style->fg_set = TRUE;
+    style->fg.red = r;
+    style->fg.green = g;
+    style->fg.blue = b;
+}
+
+void ui_textstyle_enable_color(UiTextStyle *style, UiBool enable) {
+    style->fg_set = enable;
+}

mercurial