[baobab/wip/cdavis/hdy-restyle: 1/2] location-list: Use libhandy styles instead of GtkFrame and headers
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/wip/cdavis/hdy-restyle: 1/2] location-list: Use libhandy styles instead of GtkFrame and headers
- Date: Sun, 27 Dec 2020 07:14:15 +0000 (UTC)
commit 5062fb3cda93e6492cad485e03f36044dc88a450
Author: Christopher Davis <brainblasted disroot org>
Date: Sat Dec 26 23:07:15 2020 -0800
location-list: Use libhandy styles instead of GtkFrame and headers
Makes use of libhandy's .content style class.
data/ui/baobab-location-list.ui | 32 ++++++++++++--------------------
meson.build | 3 ++-
src/baobab-application.vala | 2 ++
src/baobab-location-list.vala | 10 ----------
src/meson.build | 1 +
5 files changed, 17 insertions(+), 31 deletions(-)
---
diff --git a/data/ui/baobab-location-list.ui b/data/ui/baobab-location-list.ui
index e616e65..869bb65 100644
--- a/data/ui/baobab-location-list.ui
+++ b/data/ui/baobab-location-list.ui
@@ -21,17 +21,13 @@
</object>
</child>
<child>
- <object class="GtkFrame">
+ <object class="GtkListBox" id="local_list_box">
<property name="visible">True</property>
- <child>
- <object class="GtkListBox" id="local_list_box">
- <property name="visible">True</property>
- <property name="selection_mode">none</property>
- <style>
- <class name="view"/>
- </style>
- </object>
- </child>
+ <property name="selection_mode">none</property>
+ <style>
+ <class name="view"/>
+ <class name="content"/>
+ </style>
</object>
</child>
</object>
@@ -51,17 +47,13 @@
</object>
</child>
<child>
- <object class="GtkFrame">
+ <object class="GtkListBox" id="remote_list_box">
<property name="visible">True</property>
- <child>
- <object class="GtkListBox" id="remote_list_box">
- <property name="visible">True</property>
- <property name="selection_mode">none</property>
- <style>
- <class name="view"/>
- </style>
- </object>
- </child>
+ <property name="selection_mode">none</property>
+ <style>
+ <class name="view"/>
+ <class name="content"/>
+ </style>
</object>
</child>
</object>
diff --git a/meson.build b/meson.build
index ff35546..4eb1e66 100644
--- a/meson.build
+++ b/meson.build
@@ -12,7 +12,8 @@ python = import('python')
glib = dependency('glib-2.0', version: '>=2.44')
gio = dependency('gio-2.0', version: '>=2.44')
gobject = dependency('gobject-2.0', version: '>=2.44')
-gtk = dependency('gtk+-3.0', version: '>=3.20')
+gtk = dependency('gtk+-3.0', version: '>=3.24.1')
+libhandy = dependency('libhandy-1', version: '>=1.0.0')
cc = meson.get_compiler('c')
math = cc.find_library('m', required: false)
diff --git a/src/baobab-application.vala b/src/baobab-application.vala
index 9df2bcf..dee0a03 100644
--- a/src/baobab-application.vala
+++ b/src/baobab-application.vala
@@ -80,6 +80,8 @@ namespace Baobab {
protected override void startup () {
base.startup ();
+ Hdy.init ();
+
// Load custom CSS
var css_provider = new Gtk.CssProvider ();
css_provider.load_from_resource ("/org/gnome/baobab/baobab.css");
diff --git a/src/baobab-location-list.vala b/src/baobab-location-list.vala
index 5467b98..5287ddc 100644
--- a/src/baobab-location-list.vala
+++ b/src/baobab-location-list.vala
@@ -116,10 +116,8 @@ namespace Baobab {
monitor.volume_removed.connect (volume_removed);
monitor.volume_added.connect (volume_added);
- local_list_box.set_header_func (update_header);
local_list_box.row_activated.connect (row_activated);
- remote_list_box.set_header_func (update_header);
remote_list_box.row_activated.connect (row_activated);
populate ();
@@ -265,14 +263,6 @@ namespace Baobab {
}
}
- void update_header (Gtk.ListBoxRow row, Gtk.ListBoxRow? before_row) {
- if (before_row != null && row.get_header () == null) {
- row.set_header (new Gtk.Separator (Gtk.Orientation.HORIZONTAL));
- } else {
- row.set_header (null);
- }
- }
-
void row_activated (Gtk.ListBoxRow row) {
var location_widget = row as LocationRow;
location_activated (location_widget.location);
diff --git a/src/meson.build b/src/meson.build
index c43e5d1..b857f3d 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -39,6 +39,7 @@ baobab_dependencies = [
gio,
gobject,
gtk,
+ libhandy,
math
]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]