From 343b64d92b436c6f3c9607770b18fcc2ed870c6a Mon Sep 17 00:00:00 2001 From: Guocork Date: Fri, 24 Jan 2025 17:30:43 +0800 Subject: [PATCH] adding multiple suggestion buttons to the chat panel --- src/chat/chat_panel.rs | 82 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/src/chat/chat_panel.rs b/src/chat/chat_panel.rs index f51ed37e..cdef609e 100644 --- a/src/chat/chat_panel.rs +++ b/src/chat/chat_panel.rs @@ -183,6 +183,86 @@ live_design! { } } + PromptExample = { + width: Fit, + height: Fit, + flow: Right, + spacing: 10, + + prompt1 = { + width: 150 + height: 100, + + draw_text: { + text_style: {font_size: 14}, + color: #98A2B3, + } + + text: "prompt 1", + + draw_bg: { + radius: 10.0, + border_width: 1.0, + border_color: #98A2B3, + } + } + + prompt2 = { + width: 150 + height: 100, + + draw_text: { + text_style: {font_size: 14}, + color: #98A2B3, + } + + text: "prompt 2", + + draw_bg: { + radius: 10.0, + border_width: 1.0, + border_color: #98A2B3, + } + } + + prompt3 = { + width: 150 + height: 100, + + draw_text: { + text_style: {font_size: 14}, + color: #98A2B3, + } + + text: "prompt 3", + + draw_bg: { + radius: 10.0, + border_width: 1.0, + border_color: #98A2B3, + } + } + + prompt4 = { + width: 150 + height: 100, + + draw_text: { + text_style: {font_size: 14}, + color: #98A2B3, + } + + text: "prompt 4", + + draw_bg: { + radius: 10.0, + border_width: 1.0, + border_color: #98A2B3, + } + } + } + + pub ChatPanel = {{ChatPanel}} { flow: Overlay width: Fill @@ -312,6 +392,8 @@ live_design! { } text: "How can I help you?" } + + prompt_example = {} } main = {