From ae41ff0feb257fa1a5fdfd377de38eafecf09343 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 26 Jul 2025 09:04:03 +0300 Subject: [PATCH] fix `SwitchRow` parent class --- src/app/browser/proxy.rs | 6 +----- src/app/browser/proxy/misc.rs | 14 +++++--------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/app/browser/proxy.rs b/src/app/browser/proxy.rs index 6983f1cb..ab09905b 100644 --- a/src/app/browser/proxy.rs +++ b/src/app/browser/proxy.rs @@ -62,11 +62,7 @@ impl Proxy for adw::PreferencesDialog { .title("Interface") .icon_name("preferences-desktop-display-symbolic") .build(); - p.add(&{ - let g = PreferencesGroup::new(); - g.add(&misc.widget); - g - }); + p.add(&misc.widget); p }); diff --git a/src/app/browser/proxy/misc.rs b/src/app/browser/proxy/misc.rs index a3f49af4..b9a6c43b 100644 --- a/src/app/browser/proxy/misc.rs +++ b/src/app/browser/proxy/misc.rs @@ -1,12 +1,11 @@ use std::rc::Rc; use super::Profile; -use adw::SwitchRow; -use gtk::{Box, prelude::BoxExt}; +use adw::{PreferencesGroup, SwitchRow, prelude::PreferencesGroupExt}; pub struct Misc { highlight_request_entry: SwitchRow, - pub widget: Box, + pub widget: PreferencesGroup, } impl Misc { @@ -19,19 +18,16 @@ impl Misc { .active(profile.proxy.misc.is_highlight_request_entry()) .hexpand(true) .subtitle_selectable(true) - .subtitle("Indicate proxy connections with accent colors") + .subtitle("Indicate proxy connections with the accent colors") .title_selectable(true) .title("Highlight the Request entry") .build(); // Init widget - let widget = Box::builder() - .orientation(gtk::Orientation::Horizontal) - .spacing(8) - .build(); + let widget = PreferencesGroup::new(); - widget.append(&highlight_request_entry); + widget.add(&highlight_request_entry); Self { highlight_request_entry,