FedoraQt / QGnomePlatform

QPlatformTheme for a better Qt application inclusion in GNOME
GNU Lesser General Public License v2.1
262 stars 38 forks source link

Fix applying dark scheme when QT_STYLE_OVERRIDE is set #117

Closed polter-rnd closed 2 years ago

polter-rnd commented 2 years ago

When QT_STYLE_OVERRIDE is set to something like Adwaita-dark it breaks the theme since it doesn't apply the corresponding color scheme. We should check if we should force dark color sheme similarly to how it's done in GnomeSettings::styleNames().

P.S. it's fix for a regression that likely appeared in 28f14d370e5e7a6b9f68e90837ea58a60d9ef65b

grulja commented 2 years ago

Can you please rebase on top of my last change where I ran clang-formatting?

grulja commented 2 years ago

I'm not sure it's the right place where to put your fix. Wouldn't https://github.com/FedoraQt/QGnomePlatform/blob/master/src/common/gnomesettings.cpp#L214 be a better place? Do you want to know whether tu use dark theme based on QT_STYLE_OVERRIDE, right?

polter-rnd commented 2 years ago

Do you want to know whether tu use dark theme based on QT_STYLE_OVERRIDE, right?

Yes, exactly

Wouldn't https://github.com/FedoraQt/QGnomePlatform/blob/master/src/common/gnomesettings.cpp#L214 be a better place?

Seems right, thank you. I've updated my commit, it works this way too.