File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -62,13 +62,27 @@ func main() {
6262 sharePath := filepath .Join (bundlePath , "Resources" , "share" )
6363 if _ , err := os .Stat (sharePath ); err == nil {
6464 os .Setenv ("XDG_DATA_DIRS" , sharePath )
65- os .Setenv ("GTK_THEME" , "Adwaita" )
65+ if isDarkMode () {
66+ os .Setenv ("GTK_THEME" , "Adwaita:dark" )
67+ } else {
68+ os .Setenv ("GTK_THEME" , "Adwaita" )
69+ }
6670 }
6771 }
6872 }
6973
7074 gtk .Init (nil )
7175
76+ // Robust Dark Mode application
77+ settings , _ := gtk .SettingsGetDefault ()
78+ if isDarkMode () {
79+ settings .SetProperty ("gtk-application-prefer-dark-theme" , true )
80+ settings .SetProperty ("gtk-theme-name" , "Adwaita" )
81+ } else {
82+ settings .SetProperty ("gtk-application-prefer-dark-theme" , false )
83+ settings .SetProperty ("gtk-theme-name" , "Adwaita" )
84+ }
85+
7286 app , err := gtk .ApplicationNew ("io.github.xpl0itu.wiiudownloader" , glib .APPLICATION_FLAGS_NONE )
7387 if err != nil {
7488 log .Fatal ("Error creating application." )
You can’t perform that action at this time.
0 commit comments