[pitivi] Preferences: Add borders for shortcuts list
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Preferences: Add borders for shortcuts list
- Date: Tue, 2 Jul 2019 08:03:38 +0000 (UTC)
commit 99e154ef0f594f03df94d0f2bc8da91e4ae5988f
Author: Diego Garcia Gangl <dnicolas gmail com>
Date: Sat Apr 27 21:08:28 2019 -0300
Preferences: Add borders for shortcuts list
pitivi/dialogs/prefs.py | 9 +++++++--
pitivi/utils/ui.py | 18 ++++++++++++++++++
2 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/dialogs/prefs.py b/pitivi/dialogs/prefs.py
index 91f1bb3b..576ac7bb 100644
--- a/pitivi/dialogs/prefs.py
+++ b/pitivi/dialogs/prefs.py
@@ -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."""
diff --git a/pitivi/utils/ui.py b/pitivi/utils/ui.py
index 99e97660..fe447b4f 100644
--- a/pitivi/utils/ui.py
+++ b/pitivi/utils/ui.py
@@ -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);
+ }
+
"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]