diff options
| author | pml68 <contact@pml68.dev> | 2025-02-21 21:22:52 +0100 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-02-21 21:25:38 +0100 |
| commit | 256e3ba587d0aba7f78189b6a18ea5952a1e7c57 (patch) | |
| tree | b54978347382ae182a87703644fc3cfaf103292a /src/main.rs | |
| parent | Merge pull request #6 from pml68/feat/0.14 (diff) | |
| download | iced-builder-256e3ba587d0aba7f78189b6a18ea5952a1e7c57.tar.gz | |
feat: update to Rust 2024
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/main.rs b/src/main.rs index 743797c..13510b9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,8 +16,8 @@ use dialogs::{error_dialog, unsaved_changes_dialog, warning_dialog}; use error::Error; use iced::advanced::widget::Id; use iced::widget::pane_grid::{self, Pane, PaneGrid}; -use iced::widget::{container, pick_list, row, text_editor, Column}; -use iced::{clipboard, keyboard, Alignment, Element, Length, Task, Theme}; +use iced::widget::{Column, container, pick_list, row, text_editor}; +use iced::{Alignment, Element, Length, Task, Theme, clipboard, keyboard}; use iced_anim::transition::Easing; use iced_anim::{Animated, Animation}; use panes::{code_view, designer_view, element_list}; @@ -148,7 +148,7 @@ impl App { self.theme.update(event); } Message::CopyCode => { - return clipboard::write(self.editor_content.text()) + return clipboard::write(self.editor_content.text()); } Message::SwitchPage(page) => self.designer_page = page, Message::EditorAction(action) => { @@ -171,7 +171,7 @@ impl App { point, None, None, - ) + ); } Message::HandleNew(name, zones) => { let ids: Vec<Id> = zones.into_iter().map(|z| z.0).collect(); @@ -200,7 +200,7 @@ impl App { point, None, None, - ) + ); } Message::HandleMove(element, zones) => { let ids: Vec<Id> = zones.into_iter().map(|z| z.0).collect(); @@ -242,11 +242,13 @@ impl App { self.project = Project::new(); self.project_path = None; self.editor_content = text_editor::Content::new(); - } else if unsaved_changes_dialog("You have unsaved changes. Do you wish to discard these and create a new project?") { - self.is_dirty = false; - self.project = Project::new(); - self.project_path = None; - self.editor_content = text_editor::Content::new(); + } else if unsaved_changes_dialog( + "You have unsaved changes. Do you wish to discard these and create a new project?", + ) { + self.is_dirty = false; + self.project = Project::new(); + self.project_path = None; + self.editor_content = text_editor::Content::new(); } } } @@ -259,10 +261,15 @@ impl App { Project::from_file(self.config.clone()), Message::FileOpened, ); - } else if unsaved_changes_dialog("You have unsaved changes. Do you wish to discard these and open another project?") { - self.is_dirty = false; - self.is_loading = true; - return Task::perform(Project::from_file(self.config.clone()), Message::FileOpened); + } else if unsaved_changes_dialog( + "You have unsaved changes. Do you wish to discard these and open another project?", + ) { + self.is_dirty = false; + self.is_loading = true; + return Task::perform( + Project::from_file(self.config.clone()), + Message::FileOpened, + ); } } } |
