debug-viewer: app: Switch for rc_parse to css

This gets us the line shading back and some size savings.
This commit is contained in:
Stefan Sauer 2016-10-08 22:23:39 +02:00
parent 2019397059
commit 0ccab37b65
2 changed files with 30 additions and 10 deletions

View file

@ -22,6 +22,7 @@
import os.path
from gi.repository import GObject
from gi.repository import Gdk
from gi.repository import Gtk
from GstDebugViewer import Common
@ -89,18 +90,36 @@ class App (object):
self.windows = []
# we override expander size because of:
# https://bugzilla.gnome.org/show_bug.cgi?id=615985
rcstring = """
style "no-expander-treeview-style" {
GtkTreeView::expander_size = 1
#GtkTreeView::vertical-separator = 0
GtkWidget::focus-line-width = 0
# Apply custom widget stying
# TODO: check for dark theme
css = """
@define-color normal_bg_color #FFFFFF;
@define-color shade_bg_color shade(@normal_bg_color, 0.95);
#log_view row:nth-child(even) {
background-color: @normal_bg_color;
}
#log_view row:nth-child(odd) {
background-color: @shade_bg_color;
}
#log_view row:selected {
background-color: #4488FF;
}
#log_view {
-GtkTreeView-horizontal-separator: 0;
-GtkTreeView-vertical-separator: 1;
outline-width: 0;
outline-offset: 0;
}
widget "*.log_view" style "no-expander-treeview-style"
"""
Gtk.rc_parse_string(rcstring)
style_provider = Gtk.CssProvider()
style_provider.load_from_data(css)
Gtk.StyleContext.add_provider_for_screen(
Gdk.Screen.get_default(),
style_provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
)
self.open_window()

View file

@ -29,6 +29,7 @@
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="log_view">
<property name="name">log_view</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="reorderable">True</property>