diff --git a/data/ui/about.ui b/data/ui/about.ui
index 60ed63f..ae1bdec 100644
--- a/data/ui/about.ui
+++ b/data/ui/about.ui
@@ -7,14 +7,13 @@
-->
-
diff --git a/data/ui/bible_item.ui b/data/ui/bible_item.ui
index c37fd66..c1930db 100644
--- a/data/ui/bible_item.ui
+++ b/data/ui/bible_item.ui
@@ -32,6 +32,7 @@
+ end
true
0.0
+ 300
+
+
+ max-width: 450sp
+ True
+
+
@@ -107,187 +114,139 @@
-
- true
- true
-
-
- false
- true
- false
- ADW_LEAFLET_TRANSITION_TYPE_SLIDE
-
-
- never
-
-
- 8
+
+
+
+ Selector
+
+
+
+
+ Book Selection
-
- true
-
-
- /arpa/sp1rit/Fidei/ui/factory_bookitem.ui
+
+ never
+
+
+ 8
+
+
+ true
+
+
+ /arpa/sp1rit/Fidei/ui/factory_bookitem.ui
+
+
+
+
+
-
-
-
-
-
-
- vertical
-
-
- go-previous-symbolic
- 8
- 8
- 12
- 8
-
-
-
-
-
- horizontal
-
-
- 187
- never
- true
+
+ Chapter Selection
-
- 8
- 8
- 12
- 8
-
-
- true
-
-
- /arpa/sp1rit/Fidei/ui/factory_chapteritem.ui
+
+
+
+
+
+
+ 187
+ never
+ true
+
+
+ 8
+ 8
+ 12
+ 8
+
+
+ true
+
+
+ /arpa/sp1rit/Fidei/ui/factory_chapteritem.ui
+
+
+
+
+
-
-
-
-
-
-
- false
-
-
- vertical
-
-
-
-
- vertical
- 360
-
-
- horizontal
- false
-
-
- horizontal
- true
- start
- 8
- 8
- 8
- 8
-
-
- go-first-symbolic
-
-
-
-
-
-
-
-
- horizontal
- 8
- 8
- 8
- 8
-
-
- go-previous-symbolic
-
-
-
-
-
- go-next-symbolic
-
+
+
+
+ Content
+
+
+
+
-
-
-
-
- horizontal
-
-
-
-
-
- never
- true
-
-
- daytime-sunrise-symbolic
- Welcome to Fidei!
- Pick a book from the sidebar on the left
- true
+
+
+ never
true
+
+
+ daytime-sunrise-symbolic
+ Welcome to Fidei!
+ Pick a book from the sidebar on the left
+ true
+ true
+
+
-
+
-
+
diff --git a/data/ui/info.ui b/data/ui/info.ui
index 3a69318..1e7affd 100644
--- a/data/ui/info.ui
+++ b/data/ui/info.ui
@@ -7,82 +7,88 @@
-->
-
- true
+
-
-
-
+
+
+
+
+
+
-
- 12
- 12
- 12
- 12
- vertical
-
-
- none
+
+
+
+ 12
+ 12
+ 12
+ 12
+ vertical
-
- Title
-
+
+ none
+
+
+ Title
+
+
+
+
+
+ Path
+
+
+
+
+
+ Publisher
+
+
+
+
+
+ Language identifier
+
+
+
+
+
+ Unique identifier
+
+
+
+
+
+ Rights
+
+
+
+
-
-
- Path
-
-
-
-
-
- Publisher
-
-
-
-
-
- Language identifier
-
-
-
-
-
- Unique identifier
-
-
-
-
-
- Rights
-
-
-
-
-
+
diff --git a/data/ui/prefs.ui b/data/ui/prefs.ui
index 05ba64c..9639d6d 100644
--- a/data/ui/prefs.ui
+++ b/data/ui/prefs.ui
@@ -7,7 +7,7 @@
-->
-
+
General
diff --git a/meson.build b/meson.build
index d007241..4e32bc1 100644
--- a/meson.build
+++ b/meson.build
@@ -24,7 +24,7 @@ app_id = 'arpa.sp1rit.Fidei'
i18n = import('i18n')
gtk_dep = dependency('gtk4', version: '>= 4.10.0')
-adw_dep = dependency('libadwaita-1', version: '>= 1.2.0')
+adw_dep = dependency('libadwaita-1', version: '>= 1.5.0')
xml_dep = dependency('libxml-2.0')
icu_dep = dependency('icu-uc', required: get_option('libicu'))
diff --git a/src/about.c b/src/about.c
deleted file mode 100644
index a658eab..0000000
--- a/src/about.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Fidei - Take back your faith
- Copyright (C) 2022 Florian "sp1rit"
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-*/
-
-#include "about.h"
-
-GtkWidget* fidei_get_aboutdiag(GtkWindow* parent) {
- g_return_val_if_fail(GTK_IS_WINDOW(parent), NULL);
- GtkBuilder* bld = gtk_builder_new_from_resource("/arpa/sp1rit/Fidei/ui/about.ui");
- GtkWidget* dialog = GTK_WIDGET(gtk_builder_get_object(bld, "diag"));
-
- GdkTexture* icon = gdk_texture_new_from_resource("/arpa/sp1rit/Fidei/icons/scalable/apps/arpa.sp1rit.Fidei.svg");
- gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(dialog), GDK_PAINTABLE(icon));
- g_object_unref(icon);
-
-#ifdef FIDEI_VERSION
- gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), FIDEI_VERSION);
-#endif
-
- gtk_window_set_transient_for(GTK_WINDOW(dialog), parent);
- gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
-
- g_object_unref(bld);
- return dialog;
-}
-
diff --git a/src/about.h b/src/about.h
deleted file mode 100644
index fb6a327..0000000
--- a/src/about.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Fidei - Take back your faith
- Copyright (C) 2022 Florian "sp1rit"
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-*/
-
-#ifndef __ABOUT_H__
-#define __ABOUT_H__
-
-#include
-
-G_BEGIN_DECLS
-
-GtkWidget* fidei_get_aboutdiag(GtkWindow* parent);
-
-G_END_DECLS
-
-#endif // __ABOUT_H__
diff --git a/src/app.c b/src/app.c
index e0e6cb4..479e541 100644
--- a/src/app.c
+++ b/src/app.c
@@ -94,7 +94,7 @@ static GListStore* create_bible_list() {
static void activate(GtkApplication* app, GListStore* store) {
GtkWidget* win = fidei_appwindow_new(app, G_LIST_MODEL(store));
gtk_window_set_title(GTK_WINDOW(win), "Fidei");
- gtk_widget_show(win);
+ gtk_window_present(GTK_WINDOW(win));
}
int main(int argc, char** argv) {
@@ -114,7 +114,7 @@ int main(int argc, char** argv) {
GListStore* bibles = create_bible_list();
g_resources_register(fidei_resource_get_resource());
- app = adw_application_new("arpa.sp1rit.Fidei", G_APPLICATION_FLAGS_NONE);
+ app = adw_application_new("arpa.sp1rit.Fidei", G_APPLICATION_DEFAULT_FLAGS);
g_signal_connect(app, "activate", G_CALLBACK(activate), bibles);
status = g_application_run(G_APPLICATION(app), argc, argv);
g_object_unref(app);
diff --git a/src/bibleinfo_diag.c b/src/bibleinfo_diag.c
index bde19c5..8f3ad24 100644
--- a/src/bibleinfo_diag.c
+++ b/src/bibleinfo_diag.c
@@ -33,10 +33,10 @@ typedef struct {
} FideiBibleInfoDiagPrivate;
struct _FideiBibleInfoDiag {
- GtkDialog parent_instance;
+ AdwDialog parent_instance;
};
-G_DEFINE_TYPE_WITH_PRIVATE(FideiBibleInfoDiag, fidei_bibleinfo_diag, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_PRIVATE(FideiBibleInfoDiag, fidei_bibleinfo_diag, ADW_TYPE_DIALOG)
enum {
PROP_PARENT = 1,
@@ -143,7 +143,7 @@ void fidei_bibleinfo_diag_init(FideiBibleInfoDiag* self) {
priv->bible = NULL;
g_type_ensure(FIDEI_TYPE_BIBLEINFO_ROW);
- gtk_window_set_title(GTK_WINDOW(self), _t("Bible information"));
+ adw_dialog_set_title(ADW_DIALOG(self), _t("Bible information"));
gtk_widget_init_template(GTK_WIDGET(self));
@@ -171,8 +171,6 @@ void fidei_bibleinfo_diag_set_parent(FideiBibleInfoDiag* self, GtkWindow* parent
priv->parent = parent;
- gtk_window_set_transient_for(GTK_WINDOW(self), priv->parent);
-
g_object_notify_by_pspec(G_OBJECT(self), obj_properties[PROP_PARENT]);
}
diff --git a/src/fidei.c b/src/fidei.c
index f009f93..7565261 100644
--- a/src/fidei.c
+++ b/src/fidei.c
@@ -17,7 +17,6 @@
*/
#include "fidei.h"
-#include "about.h"
#include "bibleinfo_diag.h"
#include "bible_item.h"
#include "num.h"
@@ -65,17 +64,16 @@ typedef struct {
GtkButton* bibledir_btn;
// content-parent
- AdwLeaflet* main;
+ AdwNavigationSplitView* main;
// book/chapter select
- AdwLeaflet* selector_stack;
+ AdwNavigationView* selector_stack;
GtkScrolledWindow* booksel_scroll;
GtkListView* book_selector;
+ AdwNavigationPage* chaptersel_page;
GtkBox* chaptersel_box;
- GtkButton* chapter_back_book_navbtn;
GtkGridView* chapter_selector;
// content
GtkBox* content_actions;
- GtkButton* leaflet_back_navbtn;
GtkButton* chapter_prev_navbtn;
GtkButton* chapter_fwd_navbtn;
GtkScrolledWindow* content;
@@ -151,11 +149,9 @@ void fidei_appwindow_class_init(FideiAppWindowClass* class) {
gtk_widget_class_bind_template_child_private(widget_class, FideiAppWindow, selector_stack);
gtk_widget_class_bind_template_child_private(widget_class, FideiAppWindow, booksel_scroll);
gtk_widget_class_bind_template_child_private(widget_class, FideiAppWindow, book_selector);
- gtk_widget_class_bind_template_child_private(widget_class, FideiAppWindow, chaptersel_box);
- gtk_widget_class_bind_template_child_private(widget_class, FideiAppWindow, chapter_back_book_navbtn);
+ gtk_widget_class_bind_template_child_private(widget_class, FideiAppWindow, chaptersel_page);
gtk_widget_class_bind_template_child_private(widget_class, FideiAppWindow, chapter_selector);
gtk_widget_class_bind_template_child_private(widget_class, FideiAppWindow, content_actions);
- gtk_widget_class_bind_template_child_private(widget_class, FideiAppWindow, leaflet_back_navbtn);
gtk_widget_class_bind_template_child_private(widget_class, FideiAppWindow, chapter_prev_navbtn);
gtk_widget_class_bind_template_child_private(widget_class, FideiAppWindow, chapter_fwd_navbtn);
gtk_widget_class_bind_template_child_private(widget_class, FideiAppWindow, content);
@@ -172,16 +168,21 @@ static void navigate_picker_activated(GSimpleAction*, GVariant*, FideiAppWindow*
}
static void open_aboutwin_activated(GSimpleAction*, GVariant*, FideiAppWindow* self) {
- gtk_widget_show(fidei_get_aboutdiag(GTK_WINDOW(self)));
+ GtkBuilder* builder = gtk_builder_new_from_resource("/arpa/sp1rit/Fidei/ui/about.ui");
+ AdwAboutDialog* dialog = ADW_ABOUT_DIALOG(gtk_builder_get_object(builder, "diag"));
+ #ifdef FIDEI_VERSION
+ adw_about_dialog_set_version(ADW_ABOUT_DIALOG(dialog), FIDEI_VERSION);
+ #endif
+
+ adw_dialog_present(ADW_DIALOG(dialog), GTK_WIDGET(self));
+ g_object_unref(builder);
}
static void open_preferences_activated(GSimpleAction*, GVariant*, FideiAppWindow* self) {
FideiAppWindowPrivate* priv = fidei_appwindow_get_instance_private(self);
GtkWidget* prefs = fidei_preferences_new(priv->settings);
- gtk_window_set_transient_for(GTK_WINDOW(prefs), GTK_WINDOW(self));
- gtk_window_set_modal(GTK_WINDOW(prefs), TRUE);
- gtk_widget_show(prefs);
+ adw_dialog_present(ADW_DIALOG(prefs), GTK_WIDGET(self));
}
static void fidei_appwindow_setup_window_size(FideiAppWindow* self) {
@@ -212,7 +213,7 @@ static void fidei_appwindow_captions_changed(GSettings*, gchar* key, FideiAppWin
static void info_btn_clicked(GtkButton*, FideiAppWindow* self) {
FideiAppWindowPrivate* priv = fidei_appwindow_get_instance_private(self);
- gtk_widget_show(fidei_bibleinfo_diag_new(GTK_WINDOW(self), priv->active_bible));
+ adw_dialog_present(ADW_DIALOG(fidei_bibleinfo_diag_new(GTK_WINDOW(self), priv->active_bible)), GTK_WIDGET(self));
}
static void bible_selector_clicked(GtkListBox*, GtkListBoxRow* row, FideiAppWindow* self) {
@@ -285,12 +286,7 @@ static void book_clicked(GtkListView* view, guint pos, FideiAppWindow* self) {
gtk_grid_view_set_model(priv->chapter_selector, GTK_SELECTION_MODEL(chaptermodel));
g_object_unref(chaptermodel);
- adw_leaflet_navigate(priv->selector_stack, ADW_NAVIGATION_DIRECTION_FORWARD);
-}
-
-static void chapter_back_book_navbtn_clicked(GtkButton*, FideiAppWindow* self) {
- FideiAppWindowPrivate* priv = fidei_appwindow_get_instance_private(self);
- adw_leaflet_navigate(priv->selector_stack, ADW_NAVIGATION_DIRECTION_BACK);
+ adw_navigation_view_push(priv->selector_stack, priv->chaptersel_page);
}
static void chapter_clicked(GtkListView*, guint pos, FideiAppWindow* self) {
@@ -299,10 +295,6 @@ static void chapter_clicked(GtkListView*, guint pos, FideiAppWindow* self) {
fidei_appwindow_open_chapter(self, fidei_biblebook_get_booknum(priv->active_biblebook), pos);
}
-static void leaflet_back_navbtn_clicked(GtkButton*, FideiAppWindow* self) {
- FideiAppWindowPrivate* priv = fidei_appwindow_get_instance_private(self);
- adw_leaflet_navigate(priv->main, ADW_NAVIGATION_DIRECTION_BACK);
-}
static void chapter_prev_navbtn_clicked(GtkButton*, FideiAppWindow* self) {
FideiAppWindowPrivate* priv = fidei_appwindow_get_instance_private(self);
fidei_appwindow_open_chapter(self, fidei_biblebook_get_booknum(priv->active_biblebook), priv->active_chapter - 1);
@@ -346,10 +338,8 @@ void fidei_appwindow_init(FideiAppWindow* self) {
g_signal_connect(priv->book_selector, "activate", G_CALLBACK(book_clicked), self);
- g_signal_connect(priv->chapter_back_book_navbtn, "clicked", G_CALLBACK(chapter_back_book_navbtn_clicked), self);
g_signal_connect(priv->chapter_selector, "activate", G_CALLBACK(chapter_clicked), self);
- g_signal_connect(priv->leaflet_back_navbtn, "clicked", G_CALLBACK(leaflet_back_navbtn_clicked), self);
g_signal_connect(priv->chapter_prev_navbtn, "clicked", G_CALLBACK(chapter_prev_navbtn_clicked), self);
g_signal_connect(priv->chapter_fwd_navbtn, "clicked", G_CALLBACK(chapter_fwd_navbtn_clicked), self);
}
@@ -611,7 +601,7 @@ void fidei_appwindow_open_chapter(FideiAppWindow* self, gint book, gint chapter)
gtk_widget_set_sensitive(GTK_WIDGET(priv->chapter_prev_navbtn), (gboolean)chapter);
gtk_widget_set_sensitive(GTK_WIDGET(priv->chapter_fwd_navbtn), chapter+1 < fidei_biblebook_get_num_chapters(priv->active_biblebook));
- adw_leaflet_navigate(priv->main, ADW_NAVIGATION_DIRECTION_FORWARD);
+ adw_navigation_split_view_set_show_content(priv->main, true);
priv->active_chapter = chapter;
priv->current_view = GTK_TEXT_VIEW(chapterview);
diff --git a/src/meson.build b/src/meson.build
index 6271ac4..1004f4e 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -20,7 +20,6 @@ src = [
'app.c',
'fidei.c',
'bible.c',
- 'about.c',
'bibleinfo_diag.c',
'bibleinfo_row.c',
'bible_item.c',
diff --git a/src/preferences.c b/src/preferences.c
index 5576cb5..955b34d 100644
--- a/src/preferences.c
+++ b/src/preferences.c
@@ -33,10 +33,10 @@ typedef struct {
} FideiPreferencesPrivate;
struct _FideiPreferences {
- AdwPreferencesWindow parent_instance;
+ AdwPreferencesDialog parent_instance;
};
-G_DEFINE_TYPE_WITH_PRIVATE (FideiPreferences, fidei_preferences, ADW_TYPE_PREFERENCES_WINDOW)
+G_DEFINE_TYPE_WITH_PRIVATE (FideiPreferences, fidei_preferences, ADW_TYPE_PREFERENCES_DIALOG)
enum {
PROP_SETTINGS = 1,
diff --git a/src/preferences.h b/src/preferences.h
index ab4682e..a0bae4b 100644
--- a/src/preferences.h
+++ b/src/preferences.h
@@ -25,7 +25,7 @@
G_BEGIN_DECLS
#define FIDEI_TYPE_PREFERENCES (fidei_preferences_get_type())
-G_DECLARE_FINAL_TYPE(FideiPreferences, fidei_preferences, FIDEI, PREFERENCES, AdwPreferencesWindow)
+G_DECLARE_FINAL_TYPE(FideiPreferences, fidei_preferences, FIDEI, PREFERENCES, AdwPreferencesDialog)
GtkWidget* fidei_preferences_new(GSettings* settings);