From 9873bef591b88199da8fb1e015933ac71f999cfe Mon Sep 17 00:00:00 2001 From: noxware <7684329+noxware@users.noreply.github.com> Date: Wed, 31 Jul 2024 16:10:15 -0300 Subject: [PATCH 1/3] use toggle panel from makepad --- Cargo.lock | 62 ++++---- Cargo.toml | 8 +- src/chat/chat_history.rs | 6 +- src/chat/chat_params.rs | 10 +- src/shared/mod.rs | 2 - src/shared/toggle_panel.rs | 286 ------------------------------------- src/shared/widgets.rs | 29 ++++ 7 files changed, 69 insertions(+), 334 deletions(-) delete mode 100644 src/shared/toggle_panel.rs diff --git a/Cargo.lock b/Cargo.lock index bcc940a9..120c4fa7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1223,7 +1223,7 @@ dependencies = [ [[package]] name = "makepad-derive-live" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-live-id", "makepad-micro-proc-macro", @@ -1232,7 +1232,7 @@ dependencies = [ [[package]] name = "makepad-derive-wasm-bridge" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-micro-proc-macro", ] @@ -1240,7 +1240,7 @@ dependencies = [ [[package]] name = "makepad-derive-widget" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-live-id", "makepad-micro-proc-macro", @@ -1249,7 +1249,7 @@ dependencies = [ [[package]] name = "makepad-draw" version = "0.6.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "ab_glyph_rasterizer", "fxhash", @@ -1264,17 +1264,17 @@ dependencies = [ [[package]] name = "makepad-futures" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" [[package]] name = "makepad-futures-legacy" version = "0.7.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" [[package]] name = "makepad-html" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-live-id", ] @@ -1282,7 +1282,7 @@ dependencies = [ [[package]] name = "makepad-http" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" [[package]] name = "makepad-jni-sys" @@ -1293,7 +1293,7 @@ checksum = "9775cbec5fa0647500c3e5de7c850280a88335d1d2d770e5aa2332b801ba7064" [[package]] name = "makepad-live-compiler" version = "0.5.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-derive-live", "makepad-live-tokenizer", @@ -1303,7 +1303,7 @@ dependencies = [ [[package]] name = "makepad-live-id" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-live-id-macros", ] @@ -1311,7 +1311,7 @@ dependencies = [ [[package]] name = "makepad-live-id-macros" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-micro-proc-macro", ] @@ -1319,7 +1319,7 @@ dependencies = [ [[package]] name = "makepad-live-tokenizer" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-live-id", "makepad-math", @@ -1329,7 +1329,7 @@ dependencies = [ [[package]] name = "makepad-markdown" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-live-id", ] @@ -1337,17 +1337,17 @@ dependencies = [ [[package]] name = "makepad-math" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" [[package]] name = "makepad-micro-proc-macro" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" [[package]] name = "makepad-micro-serde" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-micro-serde-derive", ] @@ -1355,7 +1355,7 @@ dependencies = [ [[package]] name = "makepad-micro-serde-derive" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-micro-proc-macro", ] @@ -1363,12 +1363,12 @@ dependencies = [ [[package]] name = "makepad-objc-sys" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" [[package]] name = "makepad-platform" version = "0.6.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-android-state", "makepad-futures", @@ -1386,7 +1386,7 @@ dependencies = [ [[package]] name = "makepad-rustybuzz" version = "0.8.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -1401,7 +1401,7 @@ dependencies = [ [[package]] name = "makepad-shader-compiler" version = "0.5.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-live-compiler", ] @@ -1409,7 +1409,7 @@ dependencies = [ [[package]] name = "makepad-vector" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "ttf-parser", ] @@ -1417,7 +1417,7 @@ dependencies = [ [[package]] name = "makepad-wasm-bridge" version = "0.4.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-derive-wasm-bridge", "makepad-live-id", @@ -1426,7 +1426,7 @@ dependencies = [ [[package]] name = "makepad-widgets" version = "0.6.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-derive-widget", "makepad-draw", @@ -1439,7 +1439,7 @@ dependencies = [ [[package]] name = "makepad-windows" version = "0.51.1" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "windows-core 0.51.1", "windows-targets 0.48.5", @@ -1448,7 +1448,7 @@ dependencies = [ [[package]] name = "makepad-zune-core" version = "0.2.14" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "bitflags 2.5.0", ] @@ -1456,7 +1456,7 @@ dependencies = [ [[package]] name = "makepad-zune-inflate" version = "0.2.54" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "simd-adler32", ] @@ -1464,7 +1464,7 @@ dependencies = [ [[package]] name = "makepad-zune-jpeg" version = "0.3.17" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-zune-core", ] @@ -1472,7 +1472,7 @@ dependencies = [ [[package]] name = "makepad-zune-png" version = "0.2.1" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "makepad-zune-core", "makepad-zune-inflate", @@ -2733,7 +2733,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "ttf-parser" version = "0.19.0" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" [[package]] name = "typenum" @@ -3115,7 +3115,7 @@ dependencies = [ [[package]] name = "windows-core" version = "0.51.1" -source = "git+https://github.com/jmbejar/makepad?branch=moxin-release-v1#6eba48bdc6829258cf92182fc91e20dfe94fa0c7" +source = "git+https://github.com/noxware/makepad?rev=7ebad2443#7ebad244342af37aa6e61e0982e247cd8036771f" dependencies = [ "windows-targets 0.48.5", ] diff --git a/Cargo.toml b/Cargo.toml index 87f46c7d..09c292fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,9 +7,7 @@ members = [ "moxin-backend", "moxin-fake-backend", ] -exclude = [ - "packaging/before-packaging-command" -] +exclude = ["packaging/before-packaging-command"] [package] name = "moxin" @@ -29,7 +27,7 @@ moxin-protocol = { path = "moxin-protocol" } moxin-backend = { path = "moxin-backend" } moxin-fake-backend = { path = "moxin-fake-backend" } -makepad-widgets = { git = "https://github.com/jmbejar/makepad", branch = "moxin-release-v1" } +makepad-widgets = { git = "https://github.com/noxware/makepad", rev = "7ebad2443" } robius-open = "0.1.0" robius-url-handler = { git = "https://github.com/project-robius/robius-url-handler" } @@ -130,7 +128,7 @@ section = "utils" [package.metadata.packager.appimage] ## `curl` is needed for `moxin-runner` to auto-install wasmedge. -bins = [ "/usr/bin/curl" ] +bins = ["/usr/bin/curl"] [package.metadata.packager.macos] minimum_system_version = "11.0" diff --git a/src/chat/chat_history.rs b/src/chat/chat_history.rs index 011cf139..4b65c2c1 100644 --- a/src/chat/chat_history.rs +++ b/src/chat/chat_history.rs @@ -1,5 +1,5 @@ use super::chat_history_card::ChatHistoryCardWidgetRefExt; -use crate::{data::store::Store, shared::toggle_panel::TogglePanel}; +use crate::data::store::Store; use makepad_widgets::*; live_design! { @@ -7,7 +7,7 @@ live_design! { import makepad_widgets::theme_desktop_dark::*; import crate::shared::styles::*; - import crate::shared::widgets::MoxinButton; + import crate::shared::widgets::*; import makepad_draw::shader::std::*; import crate::chat::shared::ChatAgentAvatar; @@ -15,7 +15,7 @@ live_design! { ICON_NEW_CHAT = dep("crate://self/resources/icons/new_chat.svg") - ChatHistory = {{ChatHistory}} { + ChatHistory = {{ChatHistory}} { open_content = { { width: Fill, diff --git a/src/chat/chat_params.rs b/src/chat/chat_params.rs index e99d3888..560be57f 100644 --- a/src/chat/chat_params.rs +++ b/src/chat/chat_params.rs @@ -2,7 +2,7 @@ use makepad_widgets::*; use crate::{ data::{chats::chat::ChatID, store::Store}, - shared::{actions::TooltipAction, toggle_panel::TogglePanel}, + shared::actions::TooltipAction, }; live_design! { @@ -10,11 +10,7 @@ live_design! { import makepad_widgets::theme_desktop_dark::*; import crate::shared::styles::*; - import crate::shared::widgets::FadeView; - import crate::shared::widgets::MoxinButton; - import crate::shared::widgets::MoxinSlider; - import crate::shared::widgets::MoxinSwitch; - import crate::shared::widgets::MoxinTextInput; + import crate::shared::widgets::*; import makepad_draw::shader::std::*; ICON_CLOSE_PANEL = dep("crate://self/resources/icons/close_right_panel.svg") @@ -36,7 +32,7 @@ live_design! { } } - ChatParams = {{ChatParams}} { + ChatParams = {{ChatParams}} { open_content = { { width: Fill diff --git a/src/shared/mod.rs b/src/shared/mod.rs index 117884fe..0bc4f617 100644 --- a/src/shared/mod.rs +++ b/src/shared/mod.rs @@ -8,7 +8,6 @@ pub mod modal; pub mod portal; pub mod resource_imports; pub mod styles; -pub mod toggle_panel; pub mod tooltip; pub mod utils; pub mod widgets; @@ -23,5 +22,4 @@ pub fn live_design(cx: &mut Cx) { download_notification_popup::live_design(cx); tooltip::live_design(cx); desktop_buttons::live_design(cx); - toggle_panel::live_design(cx); } diff --git a/src/shared/toggle_panel.rs b/src/shared/toggle_panel.rs deleted file mode 100644 index 571efc6e..00000000 --- a/src/shared/toggle_panel.rs +++ /dev/null @@ -1,286 +0,0 @@ -use makepad_widgets::*; - -live_design! { - import makepad_widgets::base::*; - import makepad_widgets::theme_desktop_dark::*; - import makepad_draw::shader::std::*; - - ICON_CLOSE_PANEL = dep("crate://self/resources/icons/close_left_panel.svg") - ICON_OPEN_PANEL = dep("crate://self/resources/icons/open_left_panel.svg") - - FadeView = { - draw_bg: { - instance opacity: 1.0 - - fn pixel(self) -> vec4 { - let color = sample2d_rt(self.image, self.pos * self.scale + self.shift) + vec4(self.marked, 0.0, 0.0, 0.0); - return Pal::premul(vec4(color.xyz, color.w * self.opacity)) - } - } - } - - CustomButton =