diff --git a/README.md b/README.md index 81f37f27..3b31f4b5 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,11 @@ # GPUI Compoment -A UI component library for building desktop application by using GPUI. +> This is still an early stage of development, we may change API frequently. +> But the features is ok to use, you must keep tracking our changes. -The goal of this project is to provide a set of UI components for building desktop applications, and it is based on [GPUI](https://gpui.rs). +A UI components for building desktop application by using [GPUI](https://gpui.rs). -## Showcase - -This is an example of build app by using GPUI. - - - - - - - - - -## Demo - -- [main-app-windows.zip](https://github.com/user-attachments/files/16195804/main-app.zip) - Updated at 2024/07/12 -- [main-app-windows.zip](https://github.com/user-attachments/files/16049565/main-app.zip) - Updated at 2024/07/01 -- [main-app-windows.zip](https://github.com/user-attachments/files/16039599/main-app.zip) - Updated at 2024/06/29 - -## TODO +## Features - [x] Theming - [ ] TextField @@ -81,6 +64,22 @@ This is an example of build app by using GPUI. - [ ] Drawer - [ ] Modal +## Showcase + + + + + + + + + +## Demo + +- [main-app-windows.zip](https://github.com/user-attachments/files/16195804/main-app.zip) - Updated at 2024/07/12 +- [main-app-windows.zip](https://github.com/user-attachments/files/16049565/main-app.zip) - Updated at 2024/07/01 +- [main-app-windows.zip](https://github.com/user-attachments/files/16039599/main-app.zip) - Updated at 2024/06/29 + ## How to build ```bash diff --git a/crates/story/src/input_story.rs b/crates/story/src/input_story.rs index 43e68a2a..54fa5c98 100644 --- a/crates/story/src/input_story.rs +++ b/crates/story/src/input_story.rs @@ -64,11 +64,7 @@ impl InputStory { Self { input1, - input2: cx.new_view(|cx| { - let mut input = TextInput::new(cx); - input.set_placeholder("Enter text here...", cx); - input - }), + input2: cx.new_view(|cx| TextInput::new(cx).placeholder("Enter text here...")), mash_input: mask_input, disabled_input: cx.new_view(|cx| { let mut input = TextInput::new(cx); diff --git a/crates/ui/src/input.rs b/crates/ui/src/input.rs index 537790ab..1d553a94 100644 --- a/crates/ui/src/input.rs +++ b/crates/ui/src/input.rs @@ -150,16 +150,6 @@ impl TextInput { cx.notify(); } - /// Set the placeholder text of the input field. - pub fn set_placeholder( - &mut self, - placeholder: impl Into, - cx: &mut ViewContext, - ) { - self.placeholder = placeholder.into(); - cx.notify(); - } - /// Set the disabled state of the input field. pub fn set_disabled(&mut self, disabled: bool, cx: &mut ViewContext) { self.disabled = disabled; @@ -601,7 +591,7 @@ impl Element for TextElement { }; let run = TextRun { - len: input.text.len(), + len: disaplay_text.len(), font: style.font(), color: text_color, background_color: None,