Commit 99e154ef authored by Diego Gangl's avatar Diego Gangl Committed by Alexandru Băluț

Preferences: Add borders for shortcuts list

parent 7549f2f9
......@@ -307,11 +307,14 @@ class PreferencesDialog(Loggable):
self.list_store.append(item)
self.action_ids[action] = index
index += 1
self.content_box.bind_model(self.list_store, self._create_widget_func, None)
self.content_box.set_header_func(self._add_header_func, None)
self.content_box.connect("row_activated", self.__row_activated_cb)
self.content_box.set_selection_mode(Gtk.SelectionMode.NONE)
self.content_box.props.margin = PADDING * 3
self.content_box.get_style_context().add_class('prefs_list')
viewport = Gtk.Viewport()
viewport.add(self.content_box)
......@@ -386,6 +389,9 @@ class PreferencesDialog(Loggable):
prev_group = None
if prev_group != group:
if before is not None:
before.get_style_context().add_class("last")
header = Gtk.Label()
header.set_use_markup(True)
group_title = self.app.shortcuts.group_titles[group]
......@@ -402,8 +408,7 @@ class PreferencesDialog(Loggable):
box.get_style_context().add_class("background")
box.show_all()
row.set_header(box)
else:
row.set_header(Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL))
row.get_style_context().add_class("first")
def __reset_accelerator_cb(self, unused_button, item):
"""Resets the accelerator to the default value."""
......
......@@ -236,6 +236,24 @@ PREFERENCES_CSS = """
.sidebar row {
padding: 10px 40px 10px 4px;
}
.prefs_list row {
border-left: 1px solid rgb(32, 32, 32);
border-right: 1px solid rgb(32, 32, 32);
border-bottom: 1px solid rgba(25, 25, 25, 0.2);
}
.prefs_list .first {
border-top: 1px solid rgb(32, 32, 32);
}
/* This covers the case for the last item in a group,
and the last item in the list */
.prefs_list,
.prefs_list .last {
border-bottom: 1px solid rgb(32, 32, 32);
}
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment