fix: format code
This commit is contained in:
1 parent
a0ffe66a37
commit
e4eb982a36
2 files changed
+3
-11
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
use dioxus::{events::onmousedown, prelude::*};
|
use dioxus::prelude::*;
|
||||||
use dioxus_desktop::desktop_context::DesktopContext;
|
use dioxus_desktop::desktop_context::DesktopContext;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@@ -12,7 +12,6 @@ fn app(cx: Scope) -> Element {
|
|||||||
|
|
||||||
let drag = desktop.clone();
|
let drag = desktop.clone();
|
||||||
let close = desktop.clone();
|
let close = desktop.clone();
|
||||||
let min = desktop.clone();
|
|
||||||
|
|
||||||
cx.render(rsx!(
|
cx.render(rsx!(
|
||||||
link { href:"https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css", rel:"stylesheet" }
|
link { href:"https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css", rel:"stylesheet" }
|
||||||
@@ -24,16 +23,11 @@ fn app(cx: Scope) -> Element {
|
|||||||
a { class: "flex title-font font-medium items-center text-white mb-4 md:mb-0",
|
a { class: "flex title-font font-medium items-center text-white mb-4 md:mb-0",
|
||||||
span { class: "ml-3 text-xl", "Dioxus"}
|
span { class: "ml-3 text-xl", "Dioxus"}
|
||||||
}
|
}
|
||||||
nav { class: "md:ml-auto flex flex-wrap items-center text-base justify-center",
|
nav { class: "md:ml-auto flex flex-wrap items-center text-base justify-center" }
|
||||||
// a { class: "mr-5 hover:text-white", "First Link"}
|
|
||||||
// a { class: "mr-5 hover:text-white", "Second Link"}
|
|
||||||
// a { class: "mr-5 hover:text-white", "Third Link"}
|
|
||||||
// a { class: "mr-5 hover:text-white", "Fourth Link"}
|
|
||||||
}
|
|
||||||
button {
|
button {
|
||||||
class: "inline-flex items-center bg-gray-800 border-0 py-1 px-3 focus:outline-none hover:bg-gray-700 rounded text-base mt-4 md:mt-0",
|
class: "inline-flex items-center bg-gray-800 border-0 py-1 px-3 focus:outline-none hover:bg-gray-700 rounded text-base mt-4 md:mt-0",
|
||||||
onmousedown: |evt| evt.cancel_bubble(),
|
onmousedown: |evt| evt.cancel_bubble(),
|
||||||
onclick: move |_| min.minimize(true),
|
onclick: move |_| desktop.minimize(true),
|
||||||
"Minimize"
|
"Minimize"
|
||||||
}
|
}
|
||||||
button {
|
button {
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ pub struct DesktopContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl DesktopContext {
|
impl DesktopContext {
|
||||||
|
|
||||||
pub(crate) fn new(proxy: ProxyType) -> Self {
|
pub(crate) fn new(proxy: ProxyType) -> Self {
|
||||||
Self { proxy }
|
Self { proxy }
|
||||||
}
|
}
|
||||||
@@ -50,5 +49,4 @@ impl DesktopContext {
|
|||||||
pub fn close(&self) {
|
pub fn close(&self) {
|
||||||
let _ = self.proxy.send_event(UserWindowEvent::CloseWindow);
|
let _ = self.proxy.send_event(UserWindowEvent::CloseWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user