summaryrefslogtreecommitdiffstats
path: root/src/gui/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/mod.rs')
-rw-r--r--src/gui/mod.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gui/mod.rs b/src/gui/mod.rs
new file mode 100644
index 0000000..a7cc4ff
--- /dev/null
+++ b/src/gui/mod.rs
@@ -0,0 +1,32 @@
+use anyhow::Result;
+use iced::Application;
+
+#[derive(Debug)]
+struct DistroxGui;
+
+impl Application for DistroxGui {
+ type Executor = iced::executor::Default; // tokio
+ type Message = ();
+ type Flags = ();
+
+ fn new(_flags: ()) -> (Self, iced::Command<Self::Message>) {
+ (DistroxGui, iced::Command::none())
+ }
+
+ fn title(&self) -> String {
+ String::from("distrox")
+ }
+
+ fn update(&mut self, _message: Self::Message, _clipboard: &mut iced::Clipboard) -> iced::Command<Self::Message> {
+ iced::Command::none()
+ }
+
+ fn view(&mut self) -> iced::Element<Self::Message> {
+ iced::Text::new("Hello, world!").into()
+ }
+
+}
+
+pub fn run() -> Result<()> {
+ DistroxGui::run(iced::Settings::default()).map_err(anyhow::Error::from)
+}