mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Change color of wayland decoration according to theme
This commit is contained in:
@@ -456,6 +456,11 @@ void MainWindow::initHook() {
|
||||
LOG(("Not using Unity launcher counter."));
|
||||
}
|
||||
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||
|
||||
style::PaletteChanged(
|
||||
) | rpl::start_with_next([=] {
|
||||
updateWaylandDecorationColors();
|
||||
}, lifetime());
|
||||
}
|
||||
|
||||
bool MainWindow::hasTrayIcon() const {
|
||||
@@ -676,6 +681,13 @@ void MainWindow::updateIconCounters() {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateWaylandDecorationColors() {
|
||||
windowHandle()->setProperty("__material_decoration_backgroundColor", st::titleBgActive->c);
|
||||
windowHandle()->setProperty("__material_decoration_foregroundColor", st::titleFgActive->c);
|
||||
windowHandle()->setProperty("__material_decoration_backgroundInactiveColor", st::titleBg->c);
|
||||
windowHandle()->setProperty("__material_decoration_foregroundInactiveColor", st::titleFg->c);
|
||||
}
|
||||
|
||||
void MainWindow::LibsLoaded() {
|
||||
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||
qDBusRegisterMetaType<ToolTip>();
|
||||
|
@@ -94,6 +94,7 @@ private:
|
||||
Ui::PopupMenu *_trayIconMenuXEmbed = nullptr;
|
||||
|
||||
void updateIconCounters();
|
||||
void updateWaylandDecorationColors();
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||
StatusNotifierItem *_sniTrayIcon = nullptr;
|
||||
|
@@ -634,7 +634,14 @@ void start() {
|
||||
qputenv("PULSE_PROP_application.name", AppName.utf8());
|
||||
qputenv("PULSE_PROP_application.icon_name", GetIconName().toLatin1());
|
||||
|
||||
if(IsStaticBinary()
|
||||
if(IsStaticBinary()
|
||||
|| InAppImage()
|
||||
|| InSandbox()
|
||||
|| InSnap()) {
|
||||
qputenv("QT_WAYLAND_DECORATION", "material");
|
||||
}
|
||||
|
||||
if(IsStaticBinary()
|
||||
|| InAppImage()
|
||||
|| InSnap()
|
||||
|| IsGtkFileDialogForced()) {
|
||||
|
Reference in New Issue
Block a user