2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 07:05:13 +00:00

Read decoration layout property from gtk

This commit is contained in:
Ilya Fedin
2020-07-18 09:06:29 +04:00
committed by John Preston
parent 9e0b046213
commit 841908fe31
11 changed files with 218 additions and 4 deletions

View File

@@ -181,6 +181,12 @@ void DarkModeChanged() {
Core::App().settings().setSystemDarkMode(Platform::IsDarkMode());
});
}
void DecorationLayoutChanged() {
Core::Sandbox::Instance().customEnterFromEventLoop([] {
Core::App().settings().setWindowControlsLayout(Platform::WindowControlsLayout());
});
}
#endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
} // namespace
@@ -289,6 +295,10 @@ void start() {
if (!gtk_check_version(3, 0, 0)) {
g_signal_connect(settings, "notify::gtk-application-prefer-dark-theme", G_CALLBACK(DarkModeChanged), nullptr);
}
if (!gtk_check_version(3, 12, 0)) {
g_signal_connect(settings, "notify::gtk-decoration-layout", G_CALLBACK(DecorationLayoutChanged), nullptr);
}
} else {
LOG(("Could not load gtk-3 or gtk-x11-2.0!"));
}