Skip to content

Commit

Permalink
Make password prompt dialog vertical
Browse files Browse the repository at this point in the history
Co-authored-by: madonuko <[email protected]>
  • Loading branch information
korewaChino and madonuko committed Feb 8, 2025
1 parent 42212c6 commit 25b2cbd
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions src/pages/installationtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,12 @@ impl SimpleComponent for InstallationTypePage {
InstallationTypePageMsg::Navigate(action) => {
if INSTALLATION_STATE.read().encrypt {
let dialogue = EncryptPassDialogue::builder()
.launch(self.root.as_ref().unwrap().toplevel_window().unwrap());
dialogue.forward(
sender.input_sender(),
InstallationTypePageMsg::EncryptDialogue,
);
.launch(self.root.as_ref().unwrap().toplevel_window().unwrap())
.forward(
sender.input_sender(),
InstallationTypePageMsg::EncryptDialogue,
);
dialogue.widget().present();
self.act = Some(action);
return;
}
Expand Down Expand Up @@ -255,7 +256,7 @@ kurage::generate_component!(EncryptPassDialogue {
}:
init[tf_repeat](root, sender, model, widgets) for root_window: gtk::Window {
libhelium::prelude::WindowExt::set_parent(&root, Some(&root_window));
// model.btn_confirm = widgets.btn_confirm.clone();
model.btn_confirm = widgets.btn_confirm.clone();
}

update(self, message, sender) {
Expand All @@ -275,6 +276,9 @@ kurage::generate_component!(EncryptPassDialogue {

#[wrap(Some)]
set_child = &gtk::Box {
set_orientation: gtk::Orientation::Vertical,


#[name = "tf_passwd"]
gtk::PasswordEntry {
set_hexpand: true,
Expand All @@ -299,8 +303,23 @@ kurage::generate_component!(EncryptPassDialogue {
},
connect_activate => Self::Input::Enter,
},

gtk::Box {
set_orientation: gtk::Orientation::Horizontal,
#[name(btn_confirm)]
libhelium::Button {
set_label: &gettext("Confirm"),
set_sensitive: false,
connect_activate => Self::Input::Enter,
},

libhelium::Button {
set_label: &gettext("Cancel"),
connect_activate[sender] => move |_| sender.output(false).unwrap(),
},
},
},

// FIXME: for some reason the libhelium crate does not contain these methods
// (actually DialogExt is just totally missing)

Expand Down

0 comments on commit 25b2cbd

Please sign in to comment.