From 1c58c3f97396fba4427da662aaea726a50a22bf0 Mon Sep 17 00:00:00 2001 From: DaPigGuy Date: Sun, 29 Oct 2023 03:19:04 -0700 Subject: [PATCH] Port to AdwSpinRow --- src/welcome.blp | 16 ++++------------ src/welcome.js | 6 ++++-- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/welcome.blp b/src/welcome.blp index 08dcf83..692c21d 100644 --- a/src/welcome.blp +++ b/src/welcome.blp @@ -25,24 +25,16 @@ Adw.ApplicationWindow window { title: _("Preferences"); Adw.PreferencesRow { - Adw.ActionRow { + Adw.SpinRow button_hint { title: _("Title maximum length (in characters)"); - - SpinButton button_hint { - numeric: true; - valign: center; - } + numeric: true; } } Adw.PreferencesRow { - Adw.ActionRow { + Adw.SpinRow button_wrap { title: _("Body lines maximum length (in characters)"); - - SpinButton button_wrap { - numeric: true; - valign: center; - } + numeric: true; } } } diff --git a/src/welcome.js b/src/welcome.js index 27cc7dc..8840e96 100644 --- a/src/welcome.js +++ b/src/welcome.js @@ -15,7 +15,8 @@ export default function Welcome({ application }) { const button_hint = builder.get_object("button_hint"); button_hint.set_range(...getRange("title-length-hint")); - button_hint.set_increments(1, 10); + button_hint.get_adjustment().set_step_increment(1); + button_hint.get_adjustment().set_page_increment(10); settings.bind( "title-length-hint", button_hint, @@ -25,7 +26,8 @@ export default function Welcome({ application }) { const button_wrap = builder.get_object("button_wrap"); button_wrap.set_range(...getRange("body-length-wrap")); - button_wrap.set_increments(1, 10); + button_wrap.get_adjustment().set_step_increment(1); + button_wrap.get_adjustment().set_page_increment(10); settings.bind( "body-length-wrap", button_wrap,