From 4d915c366f55689e7d705a3d4d36a00666e6cd8b Mon Sep 17 00:00:00 2001 From: Demolemon11 Date: Mon, 2 Dec 2024 15:58:28 +0800 Subject: [PATCH 01/17] Strip Symbols --- Cargo.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index de46ba3..3fab461 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -215,4 +215,6 @@ collapsible_else_if = "allow" too_many_arguments = "allow" blocks_in_conditions = "allow" used_underscore_binding = "allow" -module_name_repetitions = "allow" \ No newline at end of file +module_name_repetitions = "allow" +[profile.dev] +debug = 0 From 3ca8d71285ff46da508fb96b6bfe53387e9f1bb1 Mon Sep 17 00:00:00 2001 From: Demolemon11 Date: Mon, 2 Dec 2024 16:10:44 +0800 Subject: [PATCH 02/17] Basic fix --- resources/icons/verification_no.svg | 4 + resources/icons/verification_unk.svg | 18 +++++ resources/icons/verification_yes.svg | 4 + src/home/spaces_dock.rs | 107 ++++++++++++++++++++++++--- src/verification.rs | 28 ++++--- 5 files changed, 138 insertions(+), 23 deletions(-) create mode 100644 resources/icons/verification_no.svg create mode 100644 resources/icons/verification_unk.svg create mode 100644 resources/icons/verification_yes.svg diff --git a/resources/icons/verification_no.svg b/resources/icons/verification_no.svg new file mode 100644 index 0000000..7059a30 --- /dev/null +++ b/resources/icons/verification_no.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/resources/icons/verification_unk.svg b/resources/icons/verification_unk.svg new file mode 100644 index 0000000..18b3e74 --- /dev/null +++ b/resources/icons/verification_unk.svg @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/resources/icons/verification_yes.svg b/resources/icons/verification_yes.svg new file mode 100644 index 0000000..a5d0283 --- /dev/null +++ b/resources/icons/verification_yes.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/home/spaces_dock.rs b/src/home/spaces_dock.rs index 70e6964..aea0ca8 100644 --- a/src/home/spaces_dock.rs +++ b/src/home/spaces_dock.rs @@ -1,4 +1,7 @@ use makepad_widgets::*; +use matrix_sdk::encryption::VerificationState; + +use crate::verification::VerificationStateAction; live_design! { import makepad_widgets::base::*; @@ -8,6 +11,7 @@ live_design! { import crate::shared::styles::*; import crate::shared::helpers::*; import crate::shared::adaptive_view::AdaptiveView; + import crate::shared::verification_icon::*; ICON_HOME = dep("crate://self/resources/icons/home.svg") ICON_SETTINGS = dep("crate://self/resources/icons/settings.svg") @@ -16,21 +20,30 @@ live_design! { height: Fill, width: Fill } - Profile = { + Profile = {{Profile}} { + flow: Overlay width: Fit, height: Fit align: { x: 0.5, y: 0.5 } text_view = { - width: 45., height: 45., + flow: Overlay + width: 60, height: 60, align: { x: 0.5, y: 0.5 } show_bg: true, - draw_bg: { instance background_color: (COLOR_AVATAR_BG_IDLE), fn pixel(self) -> vec4 { let sdf = Sdf2d::viewport(self.pos * self.rect_size); + + //The center of the circle we are going to draw. let c = self.rect_size * 0.5; - sdf.circle(c.x, c.x, c.x) + + //The radius of the circle + let r = self.rect_size * 0.38; + + //We just keeping the center position of sdf fixed, which is equal to center of the cisrcle, + //while reducing the circle's radius. + sdf.circle(c.x, c.x, r.x); sdf.fill_keep(self.background_color); return sdf.result } @@ -46,6 +59,35 @@ live_design! { text: "U" } } + { + align: {x: 0.999, y: 0.001} + + verification_icon = { + flow: Overlay + align:{x: 0.5, y: 0.5} + width: 31, height: 31 + + icon_yes = {} + icon_no = {} + icon_unk = {} + } + } + verification_notice = { + visible: false + align: { x: 0.5, y: 0.5 } + width: Fit, height: Fit + show_bg: true + draw_bg: { + color: #0000008F + } + text =