Fix style of language label in dark theme

https://bugzilla.gnome.org/show_bug.cgi?id=766532
This commit is contained in:
Jesse van den Kieboom 2016-06-05 11:47:10 +02:00
parent 8d3120375c
commit 1da1acfb1c
2 changed files with 25 additions and 2 deletions

View file

@ -363,6 +363,25 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
SettingsBindFlags.GET | SettingsBindFlags.SET);
}
protected override void style_updated()
{
base.style_updated();
var settings = Gtk.Settings.get_default();
var theme = Environment.get_variable("GTK_THEME");
var dark = settings.gtk_application_prefer_dark_theme || (theme != null && theme.has_suffix(":dark"));
if (dark)
{
get_style_context().add_class("dark");
}
else
{
get_style_context().remove_class("dark");
}
}
protected override bool delete_event(Gdk.EventAny event)
{
var ret = false;

View file

@ -77,8 +77,8 @@ gitg-diffstat.no-frame.removed-only {
border-radius: 0px 3px 3px 0px;
}
gitg-diffstat.removed.dark,
gitg-diffstat.removed-only.dark {
.dark gitg-diffstat.removed,
.dark gitg-diffstat.removed-only {
background-color: rgb(164, 0, 0);
}
@ -108,3 +108,7 @@ GitgDiffViewOptions {
border-radius: 3px;
padding: 3px;
}
.dark .language-frame {
background-color: #535353;
}