[gnome-break-timer/gtk-4: 3/3] Add libadwaita
- From: Dylan McCall <dylanmccall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-break-timer/gtk-4: 3/3] Add libadwaita
- Date: Thu, 21 Jul 2022 21:08:55 +0000 (UTC)
commit 5874277d66d6d747b9e96a6aef31852bf7043400
Author: Dylan McCall <dylan dylanmccall ca>
Date: Thu Jul 21 16:05:16 2022 -0500
Add libadwaita
This commit uses Adw.Application and Adw.ApplicationWindow for the main
window.
meson.build | 1 +
src/settings/Application.vala | 2 +-
src/settings/MainWindow.vala | 15 ++++++++-------
src/settings/meson.build | 1 +
4 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/meson.build b/meson.build
index 7ffd66f..44aca02 100644
--- a/meson.build
+++ b/meson.build
@@ -17,6 +17,7 @@ gobject_dep = dependency('gobject-2.0')
gsound_dep = dependency('gsound')
gtk_dep = dependency('gtk4')
json_glib_dep = dependency('json-glib-1.0')
+libadwaita_dep = dependency('libadwaita-1')
libcanberra_dep = dependency('libcanberra')
libnotify_dep = dependency('libnotify')
diff --git a/src/settings/Application.vala b/src/settings/Application.vala
index 13da188..5aed44f 100644
--- a/src/settings/Application.vala
+++ b/src/settings/Application.vala
@@ -20,7 +20,7 @@
namespace BreakTimer.Settings {
-public class Application : Gtk.Application {
+public class Application : Adw.Application {
private const string STYLE_DATA =
"""
._settings-title {
diff --git a/src/settings/MainWindow.vala b/src/settings/MainWindow.vala
index e018c1c..cd77ea3 100644
--- a/src/settings/MainWindow.vala
+++ b/src/settings/MainWindow.vala
@@ -24,7 +24,7 @@ using BreakTimer.Settings.Panels;
namespace BreakTimer.Settings {
-public class MainWindow : Gtk.ApplicationWindow, GLib.Initable {
+public class MainWindow : Adw.ApplicationWindow, GLib.Initable {
private BreakManager break_manager;
private GLib.DBusConnection dbus_connection;
@@ -33,7 +33,7 @@ public class MainWindow : Gtk.ApplicationWindow, GLib.Initable {
private GLib.Menu app_menu;
- private Gtk.HeaderBar header;
+ private Adw.HeaderBar header;
private Gtk.Stack main_stack;
private Gtk.Box messages_box;
@@ -129,14 +129,15 @@ public class MainWindow : Gtk.ApplicationWindow, GLib.Initable {
this.break_settings_dialog.set_transient_for (this);
Gtk.Box content = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
- this.set_child (content);
+ this.set_content (content);
content.set_orientation (Gtk.Orientation.VERTICAL);
content.set_vexpand (true);
- this.header = new Gtk.HeaderBar ();
- this.set_titlebar (this.header);
- this.header.set_show_title_buttons (true);
- this.header.set_hexpand (true);
+ this.header = new Adw.HeaderBar ();
+ content.append (this.header);
+ // this.set_titlebar (this.header);
+ // this.header.set_show_title_buttons (true);
+ // this.header.set_hexpand (true);
this.master_switch = new Gtk.Switch ();
master_switch.set_valign (Gtk.Align.CENTER);
diff --git a/src/settings/meson.build b/src/settings/meson.build
index 55ca366..6d3495c 100644
--- a/src/settings/meson.build
+++ b/src/settings/meson.build
@@ -35,6 +35,7 @@ settings_lib_dependencies = [
gtk_dep,
json_glib_dep,
gsound_dep,
+ libadwaita_dep,
libnotify_dep,
m_dep,
posix_dep,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]