summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main.rs35
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,
+ );
}
}
}