]> uap-core.de Git - uwplayer.git/commitdiff
use custom xt fallback resources
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Sun, 23 Nov 2025 09:17:43 +0000 (10:17 +0100)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Sun, 23 Nov 2025 09:17:43 +0000 (10:17 +0100)
application/main.c
ui/motif/toolkit.c
ui/motif/toolkit.h

index 3bc610156a54f47e77fa3ebb00481d654ad2f039..81c8c8f3d48d0c1386cbdb75bb373edfccc4e528 100644 (file)
@@ -45,6 +45,7 @@ static Display *display;
 
 XtAppContext ui_motif_get_app(void);
 Display* ui_motif_get_display(void);
+void ui_motif_set_fallback_resources(String *fallback);
 
 static CxList *open_file_arg;
 
@@ -59,6 +60,10 @@ static String fallback[] = {
         "*pbbutton.shadowThickness: 1",
         "*pbbutton.highlightThickness: 1",
         
+        "*window_frame.shadowThickness: 0",
+        "*togglebutton.shadowThickness: 1",
+        "*togglebutton.highlightThickness: 2",
+        
         "*XmText.baseTranslations: #override\\n" \
                                 "Ctrl~Alt~Meta<KeyPress>v: paste-clipboard()\\n" \
                                 "Ctrl~Alt~Meta<KeyPress>c: copy-clipboard()\\n" \
@@ -104,6 +109,8 @@ int main(int argc, char** argv) {
         perror("pipe");
         return 2;
     }
+    
+    ui_motif_set_fallback_resources(fallback);
        
     // initialize toolkit
     //XtToolkitInitialize();
index 3859000ec225cf4af9851e55807188b159ce2071..22190f14b7cd693bb7827b97cc6ef7acea904dd0 100644 (file)
@@ -84,11 +84,17 @@ static String fallback[] = {
        NULL
 };
 
+static String *fallback_resources = fallback;
+
 void input_proc(XtPointer data, int *source, XtInputId *iid) {
     void *ptr;
     read(event_pipe[0], &ptr, sizeof(void*));
 }
 
+void ui_motif_set_fallback_resources(String *fallbackres) {
+    fallback_resources = fallbackres;
+}
+
 void ui_init(const char *appname, int argc, char **argv) { 
     application_name = appname;
     uic_init_global_context();
@@ -96,7 +102,7 @@ void ui_init(const char *appname, int argc, char **argv) {
     XtToolkitInitialize();
     XtSetLanguageProc(NULL, NULL, NULL);
     app = XtCreateApplicationContext();
-    XtAppSetFallbackResources(app, fallback);
+    XtAppSetFallbackResources(app, fallback_resources);
     
     display =  XtOpenDisplay(app, NULL, appname, appname, NULL, 0, &argc, argv);
     
index f4255d50db1a6027a4a0e3eecfa1d03e894e9ea6..069e31c89ee1141b97d9d8f0ca2c8b689f24ea82 100644 (file)
@@ -84,6 +84,7 @@ enum UiOrientation { UI_HORIZONTAL = 0, UI_VERTICAL };
 
 XtAppContext ui_motif_get_app(void);
 Display* ui_motif_get_display(void);
+void ui_motif_set_fallback_resources(String *fallback);
 
 void ui_set_active_window(Widget w);
 Widget ui_get_active_window();