Skip to content

Commit

Permalink
Application: hard code elementary styles (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Aug 28, 2023
1 parent 0e20e05 commit 476a9fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions data/wingpanel.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
<description>
<p>The extensible top panel for Pantheon. Wingpanel is an empty container that accepts indicators as extensions, including the applications menu.</p>
</description>

<releases>
<release version="3.0.4" date="2023-18-25" urgency="medium">
<description>
<p>Improvements:</p>
<ul>
<li>Always use elementary visual resources</li>
<li>Esc to close popovers</li>
<li>Updated translations</li>
</ul>
Expand All @@ -23,6 +25,7 @@
<issue url="https://github.com/elementary/wingpanel/issues/106">Indicators re-animate when an icon is removed</issue>
</issues>
</release>

<release version="3.0.3" date="2022-10-17" urgency="medium">
<description>
<p>Improvements:</p>
Expand Down
9 changes: 7 additions & 2 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,16 @@ public class Wingpanel.Application : Gtk.Application {

var granite_settings = Granite.Settings.get_default ();
var gtk_settings = Gtk.Settings.get_default ();
gtk_settings.gtk_icon_theme_name = "elementary";

gtk_settings.gtk_application_prefer_dark_theme = granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK;
if (!gtk_settings.gtk_theme_name.has_prefix ("io.elementary")) {
gtk_settings.gtk_theme_name = "io.elementary.stylesheet.blueberry";
}

gtk_settings.gtk_application_prefer_dark_theme = granite_settings.prefers_color_scheme == DARK;

granite_settings.notify["prefers-color-scheme"].connect (() => {
gtk_settings.gtk_application_prefer_dark_theme = granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK;
gtk_settings.gtk_application_prefer_dark_theme = granite_settings.prefers_color_scheme == DARK;
});
}

Expand Down

0 comments on commit 476a9fd

Please sign in to comment.