feat: show a build button instead of start if profile isn't built
Some checks failed
/ cargo-fmtcheck (push) Has been cancelled
/ cargo-clippy (push) Has been cancelled
/ cargo-test (push) Has been cancelled
/ appimage (push) Has been cancelled

This commit is contained in:
Gabriele Musco 2024-09-03 22:14:40 +02:00
parent a5c5687e56
commit b63b63efaf
2 changed files with 14 additions and 0 deletions

View file

@ -552,6 +552,9 @@ impl AsyncComponent for App {
self.build_window
.sender()
.emit(BuildWindowMsg::UpdateCanClose(true));
self.main_view
.sender()
.emit(MainViewMsg::UpdateSelectedProfile(profile));
}
errcode => {
self.build_window

View file

@ -179,6 +179,15 @@ impl SimpleComponent for MainView {
set_spacing: 12,
set_margin_all: 12,
set_orientation: gtk::Orientation::Vertical,
gtk::Button {
#[track = "model.changed(Self::selected_profile())"]
set_visible: !model.selected_profile.can_start(),
add_css_class: "pill",
add_css_class: "suggested-action",
set_hexpand: true,
set_label: "Build Profile",
set_action_name: Some("win.buildprofileclean"),
},
gtk::Box {
set_hexpand: true,
set_orientation: gtk::Orientation::Horizontal,
@ -187,6 +196,8 @@ impl SimpleComponent for MainView {
add_css_class: "suggested-action",
add_css_class: "destructive-action",
set_hexpand: true,
#[track = "model.changed(Self::selected_profile())"]
set_visible: model.selected_profile.can_start(),
#[track = "model.changed(Self::xrservice_active())"]
set_class_active: ("suggested-action", !model.xrservice_active),
#[track = "model.changed(Self::xrservice_active())"]