Skip to content

Commit

Permalink
Continue work on NewRepo Dialog window
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoneybun committed May 21, 2024
1 parent 147e0ee commit b41fba0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl ContextPage {

#[derive(Clone, Debug, Eq, PartialEq)]
pub enum DialogPage {
New(String),
NewRepo(String),
}

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -226,7 +226,7 @@ impl Application for App {
let spacing = cosmic::theme::active().cosmic().spacing;

let dialog = match dialog_page {
DialogPage::New(name) => widget::dialog(fl!("create-repo"))
DialogPage::NewRepo(name) => widget::dialog(fl!("create-repo"))
.primary_action(
widget::button::suggested(fl!("save"))
.on_press_maybe(Some(Message::DialogComplete)),
Expand All @@ -239,7 +239,7 @@ impl Application for App {
widget::text::body(fl!("repo-location")).into(),
widget::text_input("", name.as_str())
.id(self.dialog_text_input.clone())
.on_input(move |name| Message::DialogUpdate(DialogPage::New(name)))
.on_input(move |name| Message::DialogUpdate(DialogPage::NewRepo(name)))
.into(),
])
.spacing(spacing.space_xxs),
Expand Down Expand Up @@ -299,7 +299,7 @@ impl Application for App {
self.set_context_title(context_page.title());
}
Message::OpenNewRepoDialog => {
self.dialog_pages.push_back(DialogPage::New(String::new()));
self.dialog_pages.push_back(DialogPage::NewRepo(String::new()));
return widget::text_input::focus(self.dialog_text_input.clone());
}
Message::NewSnap => {
Expand All @@ -311,7 +311,8 @@ impl Application for App {
Message::DialogComplete => {
if let Some(dialog_page) = self.dialog_pages.pop_front() {
match dialog_page {
DialogPage::New(name) => {}
DialogPage::NewRepo(name) => {
}
}
}
}
Expand Down

0 comments on commit b41fba0

Please sign in to comment.