Skip to content

Commit

Permalink
Support GTK_THEME
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpii committed Jan 3, 2018
1 parent 1377476 commit ddfb517
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ impl Widget
{
let mut stylesheet = "style_light.css";

if let Some(setting) = ::gtk::Settings::get_default() {
if let Ok(theme) = ::std::env::var("GTK_THEME") {
if theme.ends_with(":dark") {
stylesheet = "style_dark.css";
}
}
else if let Some(setting) = ::gtk::Settings::get_default() {
if setting.get_property_gtk_application_prefer_dark_theme() {
stylesheet = "style_dark.css";
}
Expand Down

0 comments on commit ddfb517

Please sign in to comment.