13

Some apps on the gnome desktop like the image viewer use a dark variation of the theme. What code is required to make my own gtk program use this dark variation of the theme?

4

1 回答 1

16

使用gtk-application-prefer-dark-theme设置。这应该这样做:

g_object_set(gtk_settings_get_default(),
    "gtk-application-prefer-dark-theme", TRUE,
    NULL);

您可能需要确保在创建任何小部件之前执行此操作。

于 2013-04-14T20:00:02.697 回答