gtk-demo/dnd: Fix, generalise detecting dark theme
authorDaniel Boles <dboles.src@gmail.com>
Wed, 28 Jun 2023 13:40:06 +0000 (14:40 +0100)
committerDaniel Boles <dboles.src@gmail.com>
Wed, 28 Jun 2023 13:40:06 +0000 (14:40 +0100)
commit15458b5af3343e23f147cb2ace9cd6aa6f7dcffc
tree1c40ae79ababfaf9c6ec6f44fe02a03bf47d0864
parentd9cfb94a80b18f3b5933b62f45f1bcfddb7b5eda
gtk-demo/dnd: Fix, generalise detecting dark theme

Our default theme is now Default, not Adwaita, & HighContrastInverse was
renamed to Default-hc. So these checks did not work anymore. Rather than
hard-coding the new names, & possibly running into the same issue again,
we can just look for the convention of appending -dark to the theme name
and/or the Settings:prefer-dark-theme prop. The latter, we can & likely
SHOULD also apply to all themes - not just ours as before. We also check
for the :dark suffix as that means the theme variant - & before checking
GtkSettings check the GTK_THEME env var, just as GtkSettings itself does
demos/gtk-demo/dnd.c