Fix dark style of diff-stat widget

This commit is contained in:
Jesse van den Kieboom 2015-12-21 22:33:46 +01:00
parent dd607d8007
commit df2c6cdcf8
2 changed files with 24 additions and 0 deletions

View file

@ -83,6 +83,20 @@ public class Gitg.DiffStat : Gtk.DrawingArea
d_layout = null;
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");
}
make_layout();
}

View file

@ -59,6 +59,11 @@ GitgDiffStat.no-frame.added-only {
border-radius: 3px 0px 0px 3px;
}
GitgDiffStat.added.dark,
GitgDiffStat.added-only.dark {
background-color: rgb(78, 154, 6);
}
GitgDiffStat.added:dir(rtl),
GitgDiffStat.no-frame.added:dir(rtl) {
border-radius: 0px 3px 3px 0px;
@ -72,6 +77,11 @@ GitgDiffStat.no-frame.removed-only {
border-radius: 0px 3px 3px 0px;
}
GitgDiffStat.removed.dark,
GitgDiffStat.removed-only.dark {
background-color: rgb(164, 0, 0);
}
GitgDiffStat.removed:dir(rtl),
GitgDiffStat.no-frame.removed:dir(rtl) {
border-radius: 3px 0px 0px 3px;