Skip to content

Commit

Permalink
Revert "Upgrade to Libadwaita 1.6"
Browse files Browse the repository at this point in the history
This reverts commit 8a8818e.

Ubuntu 24.04 LTS is stuck with Libadwaita 1.5. Since this is a fairly
minor change, it's probably worth it to hold this back for a bit.
  • Loading branch information
johnfactotum committed Nov 28, 2024
1 parent b409dac commit deb42a1
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Read books in style.

- `gjs` (>= 1.76)
- `gtk4` (>= 4.12)
- `libadwaita` (>= 1.6; `gir1.2-adw-1` in Debian-based distros)
- `libadwaita` (>= 1.4; `gir1.2-adw-1` in Debian-based distros)
- `webkitgtk-6.0` (`webkitgtk6.0` in Fedora; `gir1.2-webkit-6.0` in Debian-based distros)

#### Optional Dependencies
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ i18n = import('i18n')

gjs = dependency('gjs-1.0', version: '>= 1.76')
dependency('gtk4', version: '>= 4.12')
dependency('libadwaita-1', version: '>= 1.6')
dependency('libadwaita-1', version: '>= 1.4')
dependency('webkitgtk-6.0', version: '>= 2.40.1')

subdir('data')
Expand Down
17 changes: 13 additions & 4 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@ const ApplicationWindow = GObject.registerClass({
this.content.add_toast(toast)
}
error(heading, body) {
const dialog = new Adw.AlertDialog({
const dialog = new Adw.MessageDialog({
heading, body,
modal: true,
transient_for: this,
})
dialog.add_response('close', _('Close'))
dialog.present(this)
dialog.present()
}
actionDialog() {
const window = new Adw.Window({
Expand Down Expand Up @@ -240,6 +242,11 @@ export const Application = GObject.registerClass({
padding: 0;
}
/* fix dark mode background in popovers */
textview {
background: none;
}
.large-button {
padding: 6px;
}
Expand Down Expand Up @@ -385,7 +392,7 @@ export const Application = GObject.registerClass({
window.run_dispose()
}
about() {
const win = new Adw.AboutDialog({
const win = new Adw.AboutWindow({
application_name: pkg.localeName,
application_icon: pkg.name,
version: pkg.version,
Expand All @@ -401,6 +408,8 @@ export const Application = GObject.registerClass({
issue_url: 'https://github.com/johnfactotum/foliate/issues',
support_url: 'https://github.com/johnfactotum/foliate/blob/gtk4/docs/faq.md',
debug_info: getDebugInfo(),
modal: true,
transient_for: this.active_window,
})
win.add_link(_('Source Code'), 'https://github.com/johnfactotum/foliate')
win.add_legal_section('foliate-js', null, Gtk.License.MIT_X11, null)
Expand All @@ -413,6 +422,6 @@ export const Application = GObject.registerClass({
win.add_legal_section('PDF.js',
'©Mozilla and individual contributors',
Gtk.License.APACHE_2_0, null)
win.present(this.active_window)
win.present()
}
})
6 changes: 4 additions & 2 deletions src/book-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const ViewPreferencesWindow = GObject.registerClass({
'theme-flow-box',
'reduce-animation',
],
}, class extends Adw.PreferencesDialog {
}, class extends Adw.PreferencesWindow {
constructor(params) {
super(params)
this.font_settings.bindProperties({
Expand Down Expand Up @@ -980,8 +980,10 @@ export const BookViewer = GObject.registerClass({
const win = new ViewPreferencesWindow({
view_settings: this._view.viewSettings,
font_settings: this._view.fontSettings,
modal: true,
transient_for: this.root,
})
win.present(this.root)
win.present()
}
bookmark() {
this._bookmark_view.toggle()
Expand Down
6 changes: 4 additions & 2 deletions src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,16 @@ GObject.registerClass({
})
}
removeBook(file) {
const dialog = new Adw.AlertDialog({
const dialog = new Adw.MessageDialog({
transient_for: this.get_root(),
modal: true,
heading: _('Remove Book?'),
body: _('Reading progress, annotations, and bookmarks will be permanently lost'),
})
dialog.add_response('cancel', _('_Cancel'))
dialog.add_response('remove', _('_Remove'))
dialog.set_response_appearance('remove', Adw.ResponseAppearance.DESTRUCTIVE)
dialog.present(this.get_root())
dialog.present()
dialog.connect('response', (_, response) => {
if (response === 'remove') getBooks().delete(file)
})
Expand Down
1 change: 0 additions & 1 deletion src/ui/annotation-popover.ui
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<property name="right-margin">9</property>
<property name="left-margin">9</property>
<property name="wrap-mode">word</property>
<style><class name="inline"/></style>
</object>
</child>
</object>
Expand Down
8 changes: 7 additions & 1 deletion src/ui/book-viewer.ui
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,13 @@
<object class="GtkStackPage">
<property name="name">loading</property>
<property name="child">
<object class="AdwSpinner"/>
<object class="GtkSpinner">
<property name="spinning">True</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="width-request">32</property>
<property name="height-request">32</property>
</object>
</property>
</object>
</child>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/view-preferences-window.ui
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><interface>
<template class="FoliateViewPreferencesWindow" parent="AdwPreferencesDialog">
<template class="FoliateViewPreferencesWindow" parent="AdwPreferencesWindow">
<child>
<object class="AdwPreferencesPage">
<property name="title" translatable="yes">Font</property>
Expand Down

0 comments on commit deb42a1

Please sign in to comment.