ui/gtk/display.c

branch
newapi
changeset 358
98b26a19cbeb
parent 352
1b4aae4e8432
--- a/ui/gtk/display.c	Sun Oct 27 10:23:02 2024 +0100
+++ b/ui/gtk/display.c	Sun Oct 27 10:33:24 2024 +0100
@@ -51,24 +51,41 @@
     
     const char *css_class = NULL;
     char *markup = NULL;
-#if GTK_MAJOR_VERSION < 3
-    switch(args.type && args.label) {
-        case UI_LABEL_STYLE_DEFAULT: break;
-        case UI_LABEL_STYLE_HEADING: {
-            cxmutstr m = cx_asprintf("<b>%s</b>", args.label);
-            markup = m.ptr;
-            args.label = NULL;
-        }
+    if(args.label) {
+        #if GTK_MAJOR_VERSION < 3
+            switch(args.style) {
+                case UI_LABEL_STYLE_DEFAULT: break;
+                case UI_LABEL_STYLE_TITLE: {
+                    cxmutstr m = cx_asprintf("<b>%s</b>", args.label);
+                    markup = m.ptr;
+                    args.label = NULL;
+                }
+                case UI_LABEL_STYLE_SUBTITLE: {
+                    break;
+                }
+                case UI_LABEL_STYLE_DIM: {
+                    break;
+                }
+            }
+#       else
+            switch(args.style) {
+                case UI_LABEL_STYLE_DEFAULT: break;
+                case UI_LABEL_STYLE_TITLE: {
+                    css_class = "ui_label_title";
+                    break;
+                }
+                case UI_LABEL_STYLE_SUBTITLE: {
+                    css_class = "subtitle";
+                    break;
+                }
+                case UI_LABEL_STYLE_DIM: {
+                    css_class = "dim-label";
+                    break;
+                }
+            }
+#       endif
     }
-#else
-    switch(args.type && args.label) {
-        case UI_LABEL_STYLE_DEFAULT: break;
-        case UI_LABEL_STYLE_HEADING: {
-            css_class = "ui_label_heading";
-            break;
-        }
-    }
-#endif
+
     
     GtkWidget *widget = gtk_label_new(args.label);
     if(markup) {

mercurial