mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-03 14:49:04 +00:00
feat: normal window for wivrn config editor
This commit is contained in:
parent
9b5d74594b
commit
cd0e55aa9b
1 changed files with 90 additions and 71 deletions
|
@ -8,7 +8,7 @@ use relm4::prelude::*;
|
|||
pub struct WivrnConfEditor {
|
||||
conf: WivrnConfig,
|
||||
#[tracker::do_not_track]
|
||||
win: Option<adw::PreferencesWindow>,
|
||||
win: Option<adw::Window>,
|
||||
#[tracker::do_not_track]
|
||||
scalex_entry: Option<adw::EntryRow>,
|
||||
#[tracker::do_not_track]
|
||||
|
@ -37,12 +37,30 @@ impl SimpleComponent for WivrnConfEditor {
|
|||
|
||||
view! {
|
||||
#[name(win)]
|
||||
adw::PreferencesWindow {
|
||||
set_hide_on_close: true,
|
||||
adw::Window {
|
||||
set_modal: true,
|
||||
set_transient_for: Some(&init.root_win),
|
||||
set_title: Some("WiVRn Configuration"),
|
||||
add: mainpage = &adw::PreferencesPage {
|
||||
set_default_height: 500,
|
||||
set_default_width: 600,
|
||||
adw::ToolbarView {
|
||||
set_top_bar_style: adw::ToolbarStyle::Flat,
|
||||
set_hexpand: true,
|
||||
set_vexpand: true,
|
||||
add_top_bar: top_bar = &adw::HeaderBar {
|
||||
set_vexpand: false,
|
||||
pack_end: save_btn = >k::Button {
|
||||
set_label: "Save",
|
||||
add_css_class: "suggested-action",
|
||||
connect_clicked[sender] => move |_| {
|
||||
sender.input(Self::Input::Save);
|
||||
},
|
||||
},
|
||||
},
|
||||
#[wrap(Some)]
|
||||
set_content: pref_page = &adw::PreferencesPage {
|
||||
set_hexpand: true,
|
||||
set_vexpand: true,
|
||||
add: scalegrp = &adw::PreferencesGroup {
|
||||
set_title: "Scale",
|
||||
set_description: Some("Render resolution scale. 1.0 is 100%."),
|
||||
|
@ -111,7 +129,8 @@ impl SimpleComponent for WivrnConfEditor {
|
|||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue