fix SwitchRow parent class

This commit is contained in:
yggverse 2025-07-26 09:04:03 +03:00
parent 4dc18d0d90
commit ae41ff0feb
2 changed files with 6 additions and 14 deletions

View file

@ -62,11 +62,7 @@ impl Proxy for adw::PreferencesDialog {
.title("Interface") .title("Interface")
.icon_name("preferences-desktop-display-symbolic") .icon_name("preferences-desktop-display-symbolic")
.build(); .build();
p.add(&{ p.add(&misc.widget);
let g = PreferencesGroup::new();
g.add(&misc.widget);
g
});
p p
}); });

View file

@ -1,12 +1,11 @@
use std::rc::Rc; use std::rc::Rc;
use super::Profile; use super::Profile;
use adw::SwitchRow; use adw::{PreferencesGroup, SwitchRow, prelude::PreferencesGroupExt};
use gtk::{Box, prelude::BoxExt};
pub struct Misc { pub struct Misc {
highlight_request_entry: SwitchRow, highlight_request_entry: SwitchRow,
pub widget: Box, pub widget: PreferencesGroup,
} }
impl Misc { impl Misc {
@ -19,19 +18,16 @@ impl Misc {
.active(profile.proxy.misc.is_highlight_request_entry()) .active(profile.proxy.misc.is_highlight_request_entry())
.hexpand(true) .hexpand(true)
.subtitle_selectable(true) .subtitle_selectable(true)
.subtitle("Indicate proxy connections with accent colors") .subtitle("Indicate proxy connections with the accent colors")
.title_selectable(true) .title_selectable(true)
.title("Highlight the Request entry") .title("Highlight the Request entry")
.build(); .build();
// Init widget // Init widget
let widget = Box::builder() let widget = PreferencesGroup::new();
.orientation(gtk::Orientation::Horizontal)
.spacing(8)
.build();
widget.append(&highlight_request_entry); widget.add(&highlight_request_entry);
Self { Self {
highlight_request_entry, highlight_request_entry,