diff --git a/README.md b/README.md index 3fb97dc2..5c49005e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You'll need the following dependencies: * libadwaita-1-dev * libswitchboard-3-dev * libflatpak-dev -* libgranite-7-dev >= 7.4.0 +* libgranite-7-dev >= 7.7.0 * libgtk-4-dev * meson >= 0.58.0 * valac diff --git a/src/Permissions/Widgets/PermissionSettingsWidget.vala b/src/Permissions/Widgets/PermissionSettingsWidget.vala index c65bfb03..8cbd989f 100644 --- a/src/Permissions/Widgets/PermissionSettingsWidget.vala +++ b/src/Permissions/Widgets/PermissionSettingsWidget.vala @@ -48,8 +48,8 @@ public class Permissions.Widgets.PermissionSettingsWidget : Gtk.ListBoxRow { wrap = true, xalign = 0 }; - description_label.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); - description_label.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL); + description_label.add_css_class (Granite.CssClass.DIM); + description_label.add_css_class (Granite.CssClass.SMALL); var allow_switch = new Gtk.Switch () { focusable = false, diff --git a/src/Permissions/Widgets/SidebarRow.vala b/src/Permissions/Widgets/SidebarRow.vala index 324c68a4..b0d19116 100644 --- a/src/Permissions/Widgets/SidebarRow.vala +++ b/src/Permissions/Widgets/SidebarRow.vala @@ -21,8 +21,7 @@ public class Permissions.SidebarRow : Gtk.ListBoxRow { public Permissions.Backend.App app { get; construct; } - private Gtk.Label description_label; - private Gtk.Revealer description_revealer; + private Granite.HeaderLabel title_label; public SidebarRow (Permissions.Backend.App app) { Object (app: app); @@ -33,22 +32,10 @@ public class Permissions.SidebarRow : Gtk.ListBoxRow { pixel_size = 32 }; - var title_label = new Gtk.Label (app.name) { - ellipsize = Pango.EllipsizeMode.END, - valign = Gtk.Align.END, - xalign = 0 - }; - title_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL); - - description_label = new Gtk.Label ("") { - ellipsize = Pango.EllipsizeMode.END, - valign = Gtk.Align.START, - xalign = 0 - }; - description_label.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL); - - description_revealer = new Gtk.Revealer () { - child = description_label + title_label = new Granite.HeaderLabel (app.name) { + size = H3, + valign = START, + ellipsize = END }; var grid = new Gtk.Grid () { @@ -56,7 +43,6 @@ public class Permissions.SidebarRow : Gtk.ListBoxRow { }; grid.attach (image, 0, 0, 1, 2); grid.attach (title_label, 1, 0); - grid.attach (description_revealer, 1, 1); accessible_role = TAB; child = grid; @@ -82,14 +68,14 @@ public class Permissions.SidebarRow : Gtk.ListBoxRow { if (current_permissions.length > 0) { /// Translators: This is a delimiter that separates types of permissions in the sidebar description var description = string.joinv (_(", "), current_permissions.data); - description_label.label = description; - description_revealer.reveal_child = true; + title_label.secondary_text = description; tooltip_text = description; update_property (Gtk.AccessibleProperty.DESCRIPTION, description, -1); } else { - description_revealer.reveal_child = false; + title_label.secondary_text = ""; tooltip_text = null; + update_property (Gtk.AccessibleProperty.DESCRIPTION, null, -1); } } diff --git a/src/Sidebar.vala b/src/Sidebar.vala index b91bc7ab..b7dbcf8a 100644 --- a/src/Sidebar.vala +++ b/src/Sidebar.vala @@ -174,11 +174,9 @@ public class Applications.Sidebar : Gtk.Box { icon_size = LARGE }; - var title_label = new Gtk.Label (label) { - ellipsize = END, - xalign = 0 + var title_label = new Granite.HeaderLabel (label) { + size = H3 }; - title_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL); var box = new Gtk.Box (HORIZONTAL, 6); box.append (image); diff --git a/src/Startup/Widgets/AppChooserRow.vala b/src/Startup/Widgets/AppChooserRow.vala index 57823e35..e5a5e778 100644 --- a/src/Startup/Widgets/AppChooserRow.vala +++ b/src/Startup/Widgets/AppChooserRow.vala @@ -26,7 +26,7 @@ public class Startup.Widgets.AppChooserRow : Gtk.Grid { xalign = 0, ellipsize = Pango.EllipsizeMode.END }; - app_comment.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL); + app_comment.add_css_class (Granite.CssClass.SMALL); column_spacing = 6; attach (image, 0, 0, 1, 2); diff --git a/src/Startup/Widgets/AppRow.vala b/src/Startup/Widgets/AppRow.vala index a31a55b8..1f067d82 100644 --- a/src/Startup/Widgets/AppRow.vala +++ b/src/Startup/Widgets/AppRow.vala @@ -40,7 +40,7 @@ public class Startup.Widgets.AppRow : Gtk.ListBoxRow { hexpand = true, xalign = 0 }; - app_comment.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL); + app_comment.add_css_class (Granite.CssClass.SMALL); var remove_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic") { tooltip_text = _("Remove this app from startup") diff --git a/src/meson.build b/src/meson.build index 4435884c..fd71e3e0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -36,7 +36,8 @@ shared_module( dependency('glib-2.0', version: '>=2.34'), dependency('gio-2.0'), dependency('gobject-2.0'), - dependency('granite-7', version: '>=7.4.0'), + # TODO Require >= 7.8.0 when released + dependency('granite-7', version: '>=7.7.0'), dependency('gtk4'), dependency('libadwaita-1', version: '>=1.4'), switchboard_dep