darkfi 1 год назад
Родитель
Сommit
b6eec36fb8

+ 7 - 1
bin/darkwallet/src/app/schema/chat.rs

@@ -922,7 +922,7 @@ pub async fn make(
         let sg_root = sg_root.clone();
         let chatview_node = chatview_node.clone();
         async move {
-            let text = editz_text.get();
+            let mut text = editz_text.get();
             info!(target: "app::chat", "Send '{text}' to channel: #{channel}");
             editz_text.set("");
 
@@ -949,6 +949,12 @@ pub async fn make(
                 return
             }
 
+            // Limit line length
+            if text.len() > 300 {
+                text.truncate(300);
+                text.push('…');
+            }
+
             let timest = UNIX_EPOCH.elapsed().unwrap().as_millis() as u64;
             let nick = darkirc.get_property_str("nick").unwrap();
             let msg = darkirc::Privmsg::new(channel, nick, text);

+ 8 - 8
bin/darkwallet/src/app/schema/test.rs

@@ -252,11 +252,16 @@ pub async fn make(app: &App, window: SceneNodePtr) {
     let prop = node.get_property("rect").unwrap();
     prop.set_f32(Role::App, 0, 100.).unwrap();
     prop.set_f32(Role::App, 1, 100.).unwrap();
-    prop.set_f32(Role::App, 2, 800.).unwrap();
+    prop.set_f32(Role::App, 2, 2000.).unwrap();
     prop.set_f32(Role::App, 3, 200.).unwrap();
     node.set_property_f32(Role::App, "baseline", 40.).unwrap();
     node.set_property_f32(Role::App, "font_size", 60.).unwrap();
-    node.set_property_str(Role::App, "text", "anon1🍆 ≌ 🏳️‍⚧️").unwrap();
+    node.set_property_str(
+        Role::App,
+        "text",
+        "hel \u{01f3f3}\u{fe0f}\u{200d}\u{26a7}\u{fe0f} 123 '\u{01f44d}\u{01f3fe}' br",
+    )
+    .unwrap();
     //node.set_property_str(Role::App, "text", "anon1").unwrap();
     let prop = node.get_property("text_color").unwrap();
     prop.set_f32(Role::App, 0, 0.).unwrap();
@@ -300,12 +305,7 @@ pub async fn make(app: &App, window: SceneNodePtr) {
     node.set_property_f32(Role::App, "baseline", 40.).unwrap();
     node.set_property_f32(Role::App, "font_size", 20.).unwrap();
     node.set_property_f32(Role::App, "font_size", 40.).unwrap();
-    node.set_property_str(
-        Role::App,
-        "text",
-        "hello king!😁🍆jelly 🍆1234 '\u{01f3f3}\u{fe0f}\u{200d}\u{26a7}\u{fe0f}'",
-    )
-    .unwrap();
+    node.set_property_str(Role::App, "text", "\u{01f3f3}\u{fe0f}\u{200d}\u{26a7}\u{fe0f}").unwrap();
     let prop = node.get_property("text_color").unwrap();
     if LIGHTMODE {
         prop.set_f32(Role::App, 0, 0.).unwrap();

+ 0 - 2
bin/darkwallet/src/mesh.rs

@@ -104,8 +104,6 @@ impl MeshBuilder {
         let (u2, v2) = uv.bottom_right().unpack();
 
         // Interpolate UV coords
-        assert!(obj.w >= clipped.w);
-        assert!(obj.h >= clipped.h);
 
         let i = (clipped.x - obj.x) / obj.w;
         let clip_u1 = u1 + i * (u2 - u1);

+ 12 - 7
bin/darkwallet/src/ui/chatedit.rs

@@ -1951,6 +1951,7 @@ impl UIObject for ChatEdit {
     }
 
     async fn handle_char(&self, key: char, mods: KeyMods, repeat: bool) -> bool {
+        //debug!(target: "ui::chatedit", "handle_char({key}, {mods:?}, {repeat})");
         // First filter for only single digit keys
         if DISALLOWED_CHARS.contains(&key) {
             return false
@@ -1960,6 +1961,11 @@ impl UIObject for ChatEdit {
             return false
         }
 
+        let actions = {
+            let mut repeater = self.key_repeat.lock();
+            repeater.key_down(PressedKey::Char(key), repeat)
+        };
+
         if mods.ctrl || mods.alt {
             if repeat {
                 return false
@@ -1967,10 +1973,6 @@ impl UIObject for ChatEdit {
             return self.handle_shortcut(key, &mods).await
         }
 
-        let actions = {
-            let mut repeater = self.key_repeat.lock();
-            repeater.key_down(PressedKey::Char(key), repeat)
-        };
         //debug!(target: "ui::chatedit", "Key {:?} has {} actions", key, actions);
         for _ in 0..actions {
             self.insert_char(key).await;
@@ -1979,6 +1981,7 @@ impl UIObject for ChatEdit {
     }
 
     async fn handle_key_down(&self, key: KeyCode, mods: KeyMods, repeat: bool) -> bool {
+        //debug!(target: "ui::chatedit", "handle_key_down({key:?}, {mods:?}, {repeat})")
         // First filter for only single digit keys
         // Avoid processing events handled by insert_char()
         if !ALLOWED_KEYCODES.contains(&key) {
@@ -1993,10 +1996,12 @@ impl UIObject for ChatEdit {
             let mut repeater = self.key_repeat.lock();
             repeater.key_down(PressedKey::Key(key), repeat)
         };
+
         // Suppress noisy message
-        /*if actions > 0 {
-            debug!(target: "ui::chatedit", "Key {:?} has {} actions", key, actions);
-        }*/
+        //if actions > 0 {
+        //    debug!(target: "ui::chatedit", "Key {:?} has {} actions", key, actions);
+        //}
+
         let mut is_handled = false;
         for _ in 0..actions {
             if self.handle_key(&key, &mods).await {

+ 564 - 36
bin/darkwallet/src/ui/emoji_picker/emoji.rs

@@ -1,38 +1,566 @@
 pub static EMOJI_LIST: &[&str] = &[
-    "😀", "😃", "😄", "😁", "😆", "😅", "🤣", "😂", "🙂", "🙃", "🫠", "😉", "😊", "😇", "🥰", "😍",
-    "🤩", "😘", "😗", "😚", "😙", "🥲", "😋", "😛", "😜", "🤪", "😝", "🤑", "🤗", "🤭", "🫢", "🫣",
-    "🤫", "🤔", "🫡", "🤐", "🤨", "😐", "😑", "😶", "😏", "😒", "🙄", "😬", "🤥", "🫨", "😌", "😔",
-    "😪", "🤤", "😴", "😷", "🤒", "🤕", "🤢", "🤮", "🤧", "🥵", "🥶", "🥴", "😵", "🤯", "🤠", "🥳",
-    "🥸", "😎", "🤓", "🧐", "😕", "🫤", "😟", "🙁", "😮", "😯", "😲", "😳", "🥺", "🥹", "😦", "😧",
-    "😨", "😰", "😥", "😢", "😭", "😱", "😖", "😣", "😞", "😓", "😩", "😫", "🥱", "😤", "😡", "😠",
-    "🤬", "😈", "👿", "💀", "💩", "🤡", "👹", "👺", "👻", "👽", "👾", "🤖", "😺", "😸", "😹", "😻",
-    "😼", "😽", "🙀", "😿", "😾", "🙈", "🙉", "🙊", "💘", "💝", "💖", "💗", "💓", "💞", "💕", "💔",
-    "🩷", "🧡", "💛", "💚", "💙", "🩵", "💜", "🤎", "🖤", "🩶", "🤍", "💋", "💯", "💢", "💥", "💫",
-    "💦", "💨", "💬", "🗨", "🗯", "💭", "💤", "👋", "🤚", "✋", "🖖", "🫱", "🫲", "🫳", "🫴", "🫷",
-    "🫸", "👌", "🤌", "🤏", "🤞", "🫰", "🤟", "🤘", "🤙", "👈", "👉", "👆", "🖕", "👇", "🫵", "👍",
-    "👎", "✊", "👊", "🤛", "🤜", "👏", "🙌", "🫶", "👐", "🤲", "🤝", "🙏", "💅", "🤳", "💪", "🦾",
-    "🦿", "🦵", "🦶", "👂", "🦻", "👃", "🧠", "🫀", "🫁", "🦷", "🦴", "👀", "👁", "👅", "👄", "🫦",
-    "👶", "🧒", "👦", "👧", "🧑", "👱", "👨", "🧔", "👩", "🧓", "👴", "👵", "🙍", "🙎", "🙅", "🙆",
-    "💁", "🙋", "🧏", "🙇", "🤦", "🤷", "👮", "💂", "🥷", "👷", "🫅", "🤴", "👸", "👳", "👲", "🧕",
-    "🤵", "👰", "🤰", "🫃", "🫄", "🤱", "👼", "🎅", "🤶", "🦸", "🦹", "🧙", "🧚", "🧛", "🧜", "🧝",
-    "🧞", "🧟", "🧌", "💆", "💇", "🚶", "🧍", "🧎", "🏃", "💃", "🕺", "🕴", "👯", "🧖", "🧗", "🤺",
-    "🏇", "⛷", "🏂", "🏌", "🏄", "🚣", "🏊", "⛹", "🏋", "🚴", "🚵", "🤸", "🤼", "🤽", "🤾", "🤹",
-    "🧘", "🛀", "🛌", "👭", "👫", "👬", "💏", "💑", "🗣", "👤", "👥", "🫂", "👪", "👣", "🐵", "🐒",
-    "🦍", "🦧", "🐶", "🐕", "🦮", "🐩", "🐺", "🦊", "🦝", "🐱", "🐈", "🦁", "🐯", "🐅", "🐆", "🐴",
-    "🫎", "🫏", "🐎", "🦄", "🦓", "🦌", "🦬", "🐮", "🐂", "🐃", "🐄", "🐷", "🐖", "🐗", "🐽", "🐏",
-    "🐑", "🐐", "🐪", "🐫", "🦙", "🦒", "🐘", "🦣", "🦏", "🦛", "🐭", "🐁", "🐀", "🐹", "🐰", "🐇",
-    "🐿", "🦫", "🦔", "🦇", "🐻", "🐨", "🐼", "🦥", "🦦", "🦨", "🦘", "🦡", "🐾", "🦃", "🐔", "🐓",
-    "🐣", "🐤", "🐥", "🐦", "🐧", "🕊", "🦅", "🦆", "🦢", "🦉", "🦤", "🪶", "🦩", "🦚", "🦜", "🪽",
-    "🪿", "🐸", "🐊", "🐢", "🦎", "🐍", "🐲", "🐉", "🦕", "🦖", "🐳", "🐋", "🐬", "🦭", "🐟", "🐠",
-    "🐡", "🦈", "🐙", "🐚", "🪸", "🪼", "🦀", "🦞", "🦐", "🦑", "🦪", "🐌", "🦋", "🐛", "🐜", "🐝",
-    "🪲", "🐞", "🦗", "🪳", "🕷", "🕸", "🦂", "🦟", "🪰", "🪱", "🦠", "💐", "🌸", "💮", "🪷", "🏵",
-    "🌹", "🥀", "🌺", "🌻", "🌼", "🌷", "🪻", "🌱", "🪴", "🌲", "🌳", "🌴", "🌵", "🌾", "🌿", "☘",
-    "🍀", "🍁", "🍂", "🍃", "🪹", "🪺", "🍄", "🍇", "🍈", "🍉", "🍊", "🍋", "🍌", "🍍", "🥭", "🍎",
-    "🍏", "🍐", "🍑", "🍒", "🍓", "🫐", "🥝", "🍅", "🫒", "🥥", "🥑", "🍆", "🥔", "🥕", "🌽", "🌶",
-    "🫑", "🥒", "🥬", "🥦", "🧄", "🧅", "🥜", "🫘", "🌰", "🫚", "🫛", "🍞", "🥐", "🥖", "🫓", "🥨",
-    "🥯", "🥞", "🧇", "🧀", "🍖", "🍗", "🥩", "🥓", "🍔", "🍟", "🍕", "🌭", "🥪", "🌮", "🌯", "🫔",
-    "🥙", "🧆", "🥚", "🍳", "🥘", "🍲", "🫕", "🥣", "🥗", "🍿", "🧈", "🧂", "🥫", "🍱", "🍘", "🍙",
-    "🍚", "🍛", "🍜", "🍝", "🍠", "🍢", "🍣", "🍤", "🍥", "🥮", "🍡", "🥟", "🥠", "🥡", "🍦", "🍧",
-    "🍨", "🍩", "🍪", "🎂", "🍰", "🧁", "🥧", "🍫", "🍬", "🍭", "🍮", "🍯", "🍼", "🥛", "☕", "🫖",
-    "🍵", "🍶",
+    "😀",
+    "😃",
+    "😄",
+    "😁",
+    "😆",
+    "😅",
+    "🤣",
+    "😂",
+    "🙂",
+    "🙃",
+    "🫠",
+    "😉",
+    "😊",
+    "😇",
+    "🥰",
+    "😍",
+    "🤩",
+    "😘",
+    "😗",
+    "😚",
+    "😙",
+    "🥲",
+    "😋",
+    "😛",
+    "😜",
+    "🤪",
+    "😝",
+    "🤑",
+    "🤗",
+    "🤭",
+    "🫢",
+    "🫣",
+    "🤫",
+    "🤔",
+    "🫡",
+    "🤐",
+    "🤨",
+    "😐",
+    "😑",
+    "😶",
+    "😏",
+    "😒",
+    "🙄",
+    "😬",
+    "🤥",
+    "🫨",
+    "😌",
+    "😔",
+    "😪",
+    "🤤",
+    "😴",
+    "😷",
+    "🤒",
+    "🤕",
+    "🤢",
+    "🤮",
+    "🤧",
+    "🥵",
+    "🥶",
+    "🥴",
+    "😵",
+    "🤯",
+    "🤠",
+    "🥳",
+    "🥸",
+    "😎",
+    "🤓",
+    "🧐",
+    "😕",
+    "🫤",
+    "😟",
+    "🙁",
+    "😮",
+    "😯",
+    "😲",
+    "😳",
+    "🥺",
+    "🥹",
+    "😦",
+    "😧",
+    "😨",
+    "😰",
+    "😥",
+    "😢",
+    "😭",
+    "😱",
+    "😖",
+    "😣",
+    "😞",
+    "😓",
+    "😩",
+    "😫",
+    "🥱",
+    "😤",
+    "😡",
+    "😠",
+    "🤬",
+    "😈",
+    "👿",
+    "💀",
+    "💩",
+    "🤡",
+    "👹",
+    "👺",
+    "👻",
+    "👽",
+    "👾",
+    "🤖",
+    "😺",
+    "😸",
+    "😹",
+    "😻",
+    "😼",
+    "😽",
+    "🙀",
+    "😿",
+    "😾",
+    "🙈",
+    "🙉",
+    "🙊",
+    "💘",
+    "💝",
+    "💖",
+    "💗",
+    "💓",
+    "💞",
+    "💕",
+    "💔",
+    "🩷",
+    "🧡",
+    "💛",
+    "💚",
+    "💙",
+    "🩵",
+    "💜",
+    "🤎",
+    "🖤",
+    "🩶",
+    "🤍",
+    "💋",
+    "💯",
+    "💢",
+    "💥",
+    "💫",
+    "💦",
+    "💨",
+    "💬",
+    "🗨",
+    "🗯",
+    "💭",
+    "💤",
+    "👋",
+    "🤚",
+    "✋",
+    "🖖",
+    "🫱",
+    "🫲",
+    "🫳",
+    "🫴",
+    "🫷",
+    "🫸",
+    "👌",
+    "🤌",
+    "🤏",
+    "🤞",
+    "🫰",
+    "🤟",
+    "🤘",
+    "🤙",
+    "👈",
+    "👉",
+    "👆",
+    "🖕",
+    "👇",
+    "🫵",
+    "👍",
+    "👎",
+    "✊",
+    "👊",
+    "🤛",
+    "🤜",
+    "👏",
+    "🙌",
+    "🫶",
+    "👐",
+    "🤲",
+    "🤝",
+    "🙏",
+    "💅",
+    "🤳",
+    "💪",
+    "🦾",
+    "🦿",
+    "🦵",
+    "🦶",
+    "👂",
+    "🦻",
+    "👃",
+    "🧠",
+    "🫀",
+    "🫁",
+    "🦷",
+    "🦴",
+    "👀",
+    "👁",
+    "👅",
+    "👄",
+    "🫦",
+    "👶",
+    "🧒",
+    "👦",
+    "👧",
+    "🧑",
+    "👱",
+    "👨",
+    "🧔",
+    "👩",
+    "🧓",
+    "👴",
+    "👵",
+    "🙍",
+    "🙎",
+    "🙅",
+    "🙆",
+    "💁",
+    "🙋",
+    "🧏",
+    "🙇",
+    "🤦",
+    "🤷",
+    "👮",
+    "💂",
+    "🥷",
+    "👷",
+    "🫅",
+    "🤴",
+    "👸",
+    "👳",
+    "👲",
+    "🧕",
+    "🤵",
+    "👰",
+    "🤰",
+    "🫃",
+    "🫄",
+    "🤱",
+    "👼",
+    "🎅",
+    "🤶",
+    "🦸",
+    "🦹",
+    "🧙",
+    "🧚",
+    "🧛",
+    "🧜",
+    "🧝",
+    "🧞",
+    "🧟",
+    "🧌",
+    "💆",
+    "💇",
+    "🚶",
+    "🧍",
+    "🧎",
+    "🏃",
+    "💃",
+    "🕺",
+    "🕴",
+    "👯",
+    "🧖",
+    "🧗",
+    "🤺",
+    "🏇",
+    "⛷",
+    "🏂",
+    "🏌",
+    "🏄",
+    "🚣",
+    "🏊",
+    "⛹",
+    "🏋",
+    "🚴",
+    "🚵",
+    "🤸",
+    "🤼",
+    "🤽",
+    "🤾",
+    "🤹",
+    "🧘",
+    "🛀",
+    "🛌",
+    "👭",
+    "👫",
+    "👬",
+    "💏",
+    "💑",
+    "🗣",
+    "👤",
+    "👥",
+    "🫂",
+    "👪",
+    "👣",
+    "🐵",
+    "🐒",
+    "🦍",
+    "🦧",
+    "🐶",
+    "🐕",
+    "🦮",
+    "🐩",
+    "🐺",
+    "🦊",
+    "🦝",
+    "🐱",
+    "🐈",
+    "🦁",
+    "🐯",
+    "🐅",
+    "🐆",
+    "🐴",
+    "🫎",
+    "🫏",
+    "🐎",
+    "🦄",
+    "🦓",
+    "🦌",
+    "🦬",
+    "🐮",
+    "🐂",
+    "🐃",
+    "🐄",
+    "🐷",
+    "🐖",
+    "🐗",
+    "🐽",
+    "🐏",
+    "🐑",
+    "🐐",
+    "🐪",
+    "🐫",
+    "🦙",
+    "🦒",
+    "🐘",
+    "🦣",
+    "🦏",
+    "🦛",
+    "🐭",
+    "🐁",
+    "🐀",
+    "🐹",
+    "🐰",
+    "🐇",
+    "🐿",
+    "🦫",
+    "🦔",
+    "🦇",
+    "🐻",
+    "🐨",
+    "🐼",
+    "🦥",
+    "🦦",
+    "🦨",
+    "🦘",
+    "🦡",
+    "🐾",
+    "🦃",
+    "🐔",
+    "🐓",
+    "🐣",
+    "🐤",
+    "🐥",
+    "🐦",
+    "🐧",
+    "🕊",
+    "🦅",
+    "🦆",
+    "🦢",
+    "🦉",
+    "🦤",
+    "🪶",
+    "🦩",
+    "🦚",
+    "🦜",
+    "🪽",
+    "🪿",
+    "🐸",
+    "🐊",
+    "🐢",
+    "🦎",
+    "🐍",
+    "🐲",
+    "🐉",
+    "🦕",
+    "🦖",
+    "🐳",
+    "🐋",
+    "🐬",
+    "🦭",
+    "🐟",
+    "🐠",
+    "🐡",
+    "🦈",
+    "🐙",
+    "🐚",
+    "🪸",
+    "🪼",
+    "🦀",
+    "🦞",
+    "🦐",
+    "🦑",
+    "🦪",
+    "🐌",
+    "🦋",
+    "🐛",
+    "🐜",
+    "🐝",
+    "🪲",
+    "🐞",
+    "🦗",
+    "🪳",
+    "🕷",
+    "🕸",
+    "🦂",
+    "🦟",
+    "🪰",
+    "🪱",
+    "🦠",
+    "💐",
+    "🌸",
+    "💮",
+    "🪷",
+    "🏵",
+    "🌹",
+    "🥀",
+    "🌺",
+    "🌻",
+    "🌼",
+    "🌷",
+    "🪻",
+    "🌱",
+    "🪴",
+    "🌲",
+    "🌳",
+    "🌴",
+    "🌵",
+    "🌾",
+    "🌿",
+    "☘",
+    "🍀",
+    "🍁",
+    "🍂",
+    "🍃",
+    "🪹",
+    "🪺",
+    "🍄",
+    "🍇",
+    "🍈",
+    "🍉",
+    "🍊",
+    "🍋",
+    "🍌",
+    "🍍",
+    "🥭",
+    "🍎",
+    "🍏",
+    "🍐",
+    "🍑",
+    "🍒",
+    "🍓",
+    "🫐",
+    "🥝",
+    "🍅",
+    "🫒",
+    "🥥",
+    "🥑",
+    "🍆",
+    "🥔",
+    "🥕",
+    "🌽",
+    "🌶",
+    "🫑",
+    "🥒",
+    "🥬",
+    "🥦",
+    "🧄",
+    "🧅",
+    "🥜",
+    "🫘",
+    "🌰",
+    "🫚",
+    "🫛",
+    "🍞",
+    "🥐",
+    "🥖",
+    "🫓",
+    "🥨",
+    "🥯",
+    "🥞",
+    "🧇",
+    "🧀",
+    "🍖",
+    "🍗",
+    "🥩",
+    "🥓",
+    "🍔",
+    "🍟",
+    "🍕",
+    "🌭",
+    "🥪",
+    "🌮",
+    "🌯",
+    "🫔",
+    "🥙",
+    "🧆",
+    "🥚",
+    "🍳",
+    "🥘",
+    "🍲",
+    "🫕",
+    "🥣",
+    "🥗",
+    "🍿",
+    "🧈",
+    "🧂",
+    "🥫",
+    "🍱",
+    "🍘",
+    "🍙",
+    "🍚",
+    "🍛",
+    "🍜",
+    "🍝",
+    "🍠",
+    "🍢",
+    "🍣",
+    "🍤",
+    "🍥",
+    "🥮",
+    "🍡",
+    "🥟",
+    "🥠",
+    "🥡",
+    "🍦",
+    "🍧",
+    "🍨",
+    "🍩",
+    "🍪",
+    "🎂",
+    "🍰",
+    "🧁",
+    "🥧",
+    "🍫",
+    "🍬",
+    "🍭",
+    "🍮",
+    "🍯",
+    "🍼",
+    "🥛",
+    "☕",
+    "🫖",
+    "🍵",
+    "🍶",
+    "\u{01f3f3}\u{fe0f}\u{200d}\u{26a7}\u{fe0f}",
+    "\u{01f44d}\u{01f3fe}",
 ];