Jason Lee
c4c948b177
theme: Fix reload theme to keep last selected. ( #1164 )
2025-08-20 17:33:12 +08:00
Jason Lee
eb5fa06809
theme: Use more lighter group_box fallback color. ( #1163 )
2025-08-20 17:19:10 +08:00
Jason Lee
396c8dbe63
theme: Improve theme color fallback to use blend to avoid alpha. ( #1162 )
...
Also updated the themes colors to match this default rule.
2025-08-20 16:37:46 +08:00
Floyd Wang
9b3900b6cf
plot: Fix the full circle cannot be drawn ( #1161 )
2025-08-20 16:01:15 +08:00
Jason Lee
1bbc4b9f23
list: Fix List scroll to item by use deferred. ( #1160 )
2025-08-20 13:42:25 +08:00
Jason Lee
8ae4ffbb0c
dropdown: Fix dropdown menu width align to input width. ( #1159 )
...
This caused by the `bounds` of `canvas` prepaint callback now is not
including the border widths.
## Before
<img width="1070" height="967" alt="image"
src="https://github.com/user-attachments/assets/9ad963bb-c2b0-4b21-bbd6-8e961f779d2f "
/>
## After
<img width="1229" height="1097" alt="image"
src="https://github.com/user-attachments/assets/568f71be-932f-4126-b37a-b92aea3bf88a "
/>
2025-08-20 11:36:42 +08:00
Jason Lee
e29418e9e4
list: Fix List scroll_to_item position. ( #1158 )
2025-08-20 11:30:14 +08:00
Jason Lee
fb41e63ea8
input: Fix visible range when multi-line text have soft wrap. ( #1155 )
...
## Before
<img width="1130" height="783" alt="image"
src="https://github.com/user-attachments/assets/3e0db5f4-bb84-480f-8b38-dbe24e6c6214 "
/>
## After
https://github.com/user-attachments/assets/fdaed71e-3ab8-4258-a1eb-b731181ca31c
2025-08-19 19:21:12 +08:00
Floyd Wang
7fc1544a10
virtual_list: Do not trigger scrolling if content is smaller than container ( #1156 )
2025-08-19 19:18:38 +08:00
Jason Lee
fc764d8e96
modal: Avoid background color with alpha. ( #1154 )
2025-08-19 14:10:32 +08:00
Jason Lee
8e525c6c99
modal: Improve paddings and gap in Modal. ( #1153 )
2025-08-19 11:41:12 +08:00
Jason Lee
6ae7558c44
theme: Add ThemeRegistry to load and watch themes dir. ( #1148 )
2025-08-18 19:29:27 +08:00
Jason Lee
dcca730d65
group_box: Add GroupBox element. ( #1146 )
...
Close #1144
## Break Changes
- Renamed used theme variable `card`, `card_foreground` to `group_box`,
`group_box_foreground` for GroupBox.
<img width="1088" height="958" alt="image"
src="https://github.com/user-attachments/assets/adb1cbe6-fd6f-4d22-a434-39455f57ce09 "
/>
2025-08-18 11:36:07 +08:00
Floyd Wang
566f5b0d4d
fixup! plot: Fix the point scale cannot selecting the last point ( #1143 )
2025-08-15 17:23:42 +08:00
Floyd Wang
4c545165eb
plot: Fix the point scale cannot selecting the last point ( #1143 )
2025-08-15 17:09:41 +08:00
Floyd Wang
d559b56fb0
plot: Improve the band scale least_index ( #1141 )
2025-08-15 11:23:11 +08:00
Jason Lee
406bf8d929
chore: Fork html5minify for HTML render. ( #1140 )
...
Continue #1137
Forked html5minify to improve:
- Resolve `\n` not replaced issue, now no need Regexp to replace.
- Resolve the difference version of html5ever dependency.
2025-08-15 11:10:23 +08:00
Jason Lee
31fbec5393
story: Fix list group color in story. ( #1139 )
2025-08-15 10:28:00 +08:00
Jason Lee
eaeabdb0ef
scrollbar: Remove max_fps method. ( #1138 )
2025-08-15 10:17:07 +08:00
Jason Lee
899fbd693a
chore: Use html5minify instead of minify-html. ( #1137 )
...
Ref #1132
This change to reduce release mode binary size from 21MB to 12MB.
## HTML Render example
<img width="1712" height="1312" alt="image"
src="https://github.com/user-attachments/assets/f07c02c9-1b0e-4aa4-b81a-d2b0ac4f7260 "
/>
2025-08-15 09:52:38 +08:00
Jason Lee
9a389224f3
chore: Update GPUI and other crates. ( #1136 )
2025-08-14 19:57:53 +08:00
Jason Lee
63f61dca04
chore: Avoid built-in tree-sitter languages in default. ( #1135 )
...
With a `tree-sitter-languages` feature to enable it (Default not
enable).
Changed this for reduce the application size (From 52 MB to 22MB), Ref
#1132
Now default only includes `tree-sitter-json`, if you want more:
```toml
[dependencies]
gpui-component = { features = ["tree-sitter-languages"] }
```
---
```
cargo bloat -p hello_world --release -n 10
Finished `release` profile [optimized] target(s) in 0.27s
Analyzing target/release/hello_world
File .text Size Crate Name
0.4% 1.4% 88.5KiB simple_minify_html simple_minify_html::code_gen::attrs::ATTRS::{{closure}}
0.3% 1.0% 62.1KiB taffy taffy::compute::grid::track_sizing::resolve_intrinsic_track_sizes
0.1% 0.5% 32.6KiB gpui_component gpui_component::theme::theme_color::ThemeColor::dark
0.1% 0.5% 30.0KiB gpui_component gpui_component::theme::theme_color::ThemeColor::light
0.1% 0.5% 29.9KiB html5ever html5ever::tree_builder::TreeBuilder<Handle,Sink>::step
0.1% 0.4% 27.2KiB gpui taffy::compute::flexbox::compute_flexbox_layout
0.1% 0.4% 23.3KiB usvg usvg::text::layout::layout_text
0.1% 0.4% 22.5KiB resvg resvg::filter::apply_inner
0.1% 0.3% 21.4KiB gpui jpeg_decoder::decoder::Decoder<R>::decode_internal
0.1% 0.3% 21.2KiB image_webp image_webp::lossless::LosslessDecoder<R>::decode_image_stream
25.3% 94.3% 5.7MiB And 14091 smaller methods. Use -n N to show more.
26.8% 100.0% 6.0MiB .text section size, the file size is 22.4MiB
```
2025-08-14 18:02:27 +08:00
Jason Lee
a73273a0f1
text_view: Use simple-minify-html instead of minify-html. ( #1134 )
...
To avoid depends on lightningcss, this is a heavy crate.
Ref #1132
```
cargo bloat --release -n 200 --crates
Finished `release` profile [optimized] target(s) in 0.30s
Analyzing target/release/story
File .text Size Crate
4.6% 16.9% 3.4MiB lightningcss
```
2025-08-14 13:54:00 +08:00
Jason Lee
c86b0222ce
example: Add a HelloWorld example. ( #1133 )
...
Ref #1132 to make a minimized app
2025-08-14 11:15:55 +08:00
Floyd Wang
37de698a61
list: Fix the scroll_to_item not working ( #1129 )
2025-08-13 15:12:54 +08:00
Floyd Wang
e37369ea16
plot: Support multiple directions for the tooltip cross line ( #1128 )
2025-08-12 14:16:31 +08:00
Jason Lee
7f64f8798e
virtual_list: Avoid scroll when list contents not overflow. ( #1125 )
...
- Fix scrollbar position in popup menu.
2025-08-08 19:13:18 +08:00
Jason Lee
b1f4a4f642
tabs: Remove underline variant TabBar paddings. ( #1126 )
...
<img width="1167" height="1044" alt="image"
src="https://github.com/user-attachments/assets/0a2b34b7-5629-402b-a54a-f975aab77e78 "
/>
2025-08-08 19:06:26 +08:00
Jason Lee
85e2a72d03
slider: Add to support range to Slider. ( #1121 )
...
- Add to support Styled for Slider, and `bg`, `text_color`, `radius` can
change the slider bar and thumb.
## Break Changes
- The `reverse` method is removed from Slider, the Slider with vertical
now is always display from bottom to top.
<img width="1401" height="1176" alt="image"
src="https://github.com/user-attachments/assets/656592d6-ffac-4fd1-b569-848092c081bc "
/>
2025-08-08 16:59:23 +08:00
Jason Lee
900a4aa652
modal: Fix escape to dismiss Modal when list have selected item. ( #1124 )
2025-08-08 12:36:27 +08:00
Jason Lee
880d023834
virtual_list: Fix scroll to item not align to paddings. ( #1122 )
...
- Fixed List scroll to item at first time rendering.
2025-08-08 11:56:18 +08:00
Jason Lee
123a4a9fcd
chore: Update GPUI to fix click_count API changes. ( #1123 )
...
Closes #1116
2025-08-08 11:53:45 +08:00
Floyd Wang
0ab497ea1d
radio: Render the label based on its own size ( #1114 )
2025-08-06 15:29:07 +08:00
Jason Lee
9a040eaaac
list: Refactor List, Dropdown delegate API to support section. ( #1107 )
...
Ref UITableView API:
https://developer.apple.com/documentation/uikit/uitableviewdatasource
## Changes
- Added some section related API to `ListDelegeate` and
`DropdownDelegate` with default implement, so if you don't need section
that you can just keep the default.
- Added `sections_count` method to get the number of sections, default
is 1.
- Added `render_section_header` for special the section header by if
needed, default return None.
- Added `render_section_footer` for special the section footer by if
needed, default return None.
## Break Changes
- The `DropdownState` have change new method to use IndexPath type:
```diff
- DropdownState::new(vec![], Some(1), window, cx);
+ DropdownState::new(vec![], Some(IndexPath::new(1)), window, cx);
```
- The `ListDelegeate`, `DropdownDelegate` has changed API:
- The `ix` are change from `usize` to `IndexPath`.
```diff
- fn render_item(&self, ix: usize, window: &mut Window, cx: &mut
Context<List<Self>>) -> Option<Self::Item>
+ fn render_item(&self, ix: IndexPath, window: &mut Window, cx: &mut
Context<List<Self>>) -> Option<Self::Item>
- fn set_selected_index(&mut self, ix: Option<usize>, window: &mut
Window, cx: &mut Context<List<Self>>)
+ fn set_selected_index(&mut self, ix: Option<IndexPath>, window: &mut
Window, cx: &mut Context<List<Self>>)
```
- The `items_count` method have added `section` argument to support list
section.
```diff
- fn items_count(&self, cx: &App) -> usize
+ fn items_count(&self, section: usize, cx: &App) -> usize
```
- The `can_load_more` method has renamed to `is_eof` in `ListDelegate`
and `TableDelegate`.
```diff
- fn can_load_more(&self, cx: &App) -> bool
+ fn is_eof(&self, cx: &App) -> bool
```
- The `can_search` method has renamed to `searchable` in `ListDelegate`.
```diff
- fn can_search(&self) -> bool
+ fn searchable(&self) -> bool
```
## Showcase
<img width="1196" height="925" alt="image"
src="https://github.com/user-attachments/assets/22750abe-cc3f-427e-903b-51758bd4e027 "
/>
<img width="1214" height="934" alt="image"
src="https://github.com/user-attachments/assets/52d42546-e6e7-4448-9c0f-43cd659fb630 "
/>
---------
Co-authored-by: Floyd Wang <gassnake999@gmail.com>
2025-08-05 19:23:32 +08:00
Floyd Wang
16f4fc0456
drawer: Fix the overlay_closable not working ( #1113 )
2025-08-05 19:10:38 +08:00
ihavecoke
163b540681
tiles: Add panels method. ( #1112 )
2025-08-04 19:33:28 +08:00
Jason Lee
fe8a1e8e9f
scrollbar: Show scrollbar immediately when scroll offset changed. ( #1111 )
...
https://github.com/user-attachments/assets/823f3ac7-4335-4dae-a540-a2ccd11b8fc8
2025-08-04 17:00:20 +08:00
Floyd Wang
4b85cf6ad2
table: Fix the border overlap issue ( #1110 )
...
| Before | After |
| - | - |
| <img width="355" height="165" alt="SCR-20250801-kaof"
src="https://github.com/user-attachments/assets/ac073913-7813-43f2-a860-690a2366640b "
/> <img width="268" height="137" alt="SCR-20250801-kgqk"
src="https://github.com/user-attachments/assets/6a01df6d-fbf9-42a3-bfa3-4120a28b1401 "
/> | <img width="378" height="176" alt="SCR-20250801-kags"
src="https://github.com/user-attachments/assets/c5a3196d-4d0f-469b-b0d4-ce60b8dbe3f1 "
/> <img width="274" height="136" alt="SCR-20250801-kgik"
src="https://github.com/user-attachments/assets/649ff866-f153-40f3-97fa-7715f7480a2f "
/> |
2025-08-01 11:42:58 +08:00
Jason Lee
6c7a28c818
kbd: Fix Kdb to support display - key. ( #1109 )
2025-07-31 20:39:19 +08:00
Jason Lee
efa2c7c9ef
virtual_list: Add VirtualListScrollHandle to support scroll_to_item. ( #1108 )
...
- Also fixed Table scroll to selected column support.
https://github.com/user-attachments/assets/3b7c51a7-addf-4657-9f9f-de9047fffab8
2025-07-31 18:09:23 +08:00
Jason Lee
cb6695c774
dock: Adjust tab panel menu button position to align with content. ( #1106 )
...
## Before
<img width="1316" height="981" alt="image"
src="https://github.com/user-attachments/assets/ad2a96a0-5e82-4caa-85da-76f24d4deef1 "
/>
## After
<img width="1306" height="796" alt="image"
src="https://github.com/user-attachments/assets/abc2d5d5-d9de-4cf0-9c39-eb965ffb9c46 "
/>
2025-07-30 16:35:25 +08:00
Jason Lee
b2ce262da9
chore: Fix release unused method warning.
2025-07-30 15:44:41 +08:00
Jason Lee
e2153c9198
dock: Hide panel toolbar when dock is collapsed. ( #1105 )
2025-07-30 15:38:14 +08:00
Cyandev
b8db00dd3c
scrollbar: Reduce unnecessary frame updates ( #1104 )
...
The current scrollbar implementation calls
`Window::request_animation_frame` during the delay phase, which causes
unnecessary CPU usage. This PR updates the scrollbar to use a timer to
wait before starting the fade-out animation, allowing the CPU to remain
idle during this phase.
There is the comparison with Instruments.
**Before:**
<img width="632" height="75" alt="image"
src="https://github.com/user-attachments/assets/b407f1e5-8337-4f8f-b308-2cc16f6bf7ba "
/>
**After:**
<img width="608" height="75" alt="image"
src="https://github.com/user-attachments/assets/965787cf-1a42-413a-9a5e-ad0910c5cbee "
/>
2025-07-30 09:55:24 +08:00
Jason Lee
518004a014
input: Fix to let set_value works when Input is disabled. ( #1103 )
2025-07-29 17:55:53 +08:00
obito
7487662343
chrore: Refactor the disabled API for NumberInput, DatePicker, OtpInput, Calandar. ( #1102 )
...
- Added `disabled` method to OtpInput.
- Added `disabled` method to DatePicker.
- Added `disabled_matcher` method to CalendarState.
## Break Changes
- The `InputState` has been removed `disabled` and `set_disabled`
method, the disabled state should assign from TextInput element.
```diff
- let state = InputState::new("input1").disabled(true)
+ let state = InputState::new("input1");
+ TextInput::new(&state).disabled(true)
```
- Renamed `set_disabled` method to `set_disabled_matcher` from
`CalendarState`.
- Removed `set_disabled` method from `DatePickerState`, use
`disabled_matcher` method in `DatePicker` element.
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-07-29 17:31:52 +08:00
Floyd Wang
c07bc4aaad
list: Add support for scrolling to item with the given strategy ( #1100 )
...
## Breaking Change
- Add `strategy` to the `scroll_to_item` method.
```diff
+ list.scroll_to_item(selected, ScrollStrategy::Center, window, cx);
- list.scroll_to_item(selected, window, cx);
```
2025-07-29 15:14:26 +08:00
Jason Lee
771fd78416
tabs: Fix tab_bar_segmented default fallback color to secondary. ( #1101 )
2025-07-29 14:42:46 +08:00
Jason Lee
f423b8ffa2
table: Fix table head size. ( #1099 )
...
Close #1098 , this issue was included from #1094
2025-07-29 10:03:25 +08:00
Jason Lee
058dd27687
tab: Fix tab text vertical center in small, xsmall size. ( #1097 )
2025-07-28 19:33:04 +08:00
Jason Lee
461ed9c173
chore: Fix Slider, Progress width in horizontal mode. ( #1096 )
...
This bug included since Taffy 0.8 update in
[#taffy](https://github.com/zed-industries/zed/pull/34939 )
2025-07-28 18:56:09 +08:00
Jason Lee
93b578294c
list: Update ListItem and DropdownListItem style. ( #1095 )
...
## Break Change
- The `Selectable` trait has been removed `element_id` method, this is
necessary.
- The `item` of `List` now must impl `Selectable` trait.
## List
> NOTE: The default ListItem is no rounded and paddings.
<img width="1144" height="762" alt="image"
src="https://github.com/user-attachments/assets/32348682-f89a-487a-af9f-5ed379a7f2d8 "
/>
## Dropdown
<img width="537" height="387" alt="image"
src="https://github.com/user-attachments/assets/3cc99d9f-3714-4d10-b467-6c91917bcbf0 "
/>
2025-07-28 18:38:39 +08:00
Floyd Wang
6d0443998c
table: Fix the incorrect rendering of the header border ( #1094 )
2025-07-28 10:32:11 +08:00
Floyd Wang
75af2b31ba
story: Fix the startup error in the dock example ( #1093 )
2025-07-28 09:43:29 +08:00
Jason Lee
37aa26d655
check, radio: Add fade in animation to Checkbox and Radio. ( #1092 )
2025-07-24 11:41:34 +00:00
Jason Lee
479ab8f0d6
switch: Apply use_keyed_state to store toggle state for animation. ( #1091 )
...
Ref https://github.com/zed-industries/zed/pull/34741
Now `Switch` can use impl RenderOnce.
2025-07-24 19:22:55 +08:00
Jason Lee
76a64eb072
theme: Fix some theme's scrollbar background color. ( #1090 )
2025-07-24 16:54:04 +08:00
Jason Lee
579c7a3cbb
virtual_list: Fix scrollable size calculate in VirtualList. ( #1087 )
...
The `virtual_list` scroll range issue because recently GPUI changed the
`ScrollHandle` API, now we only get the `max_offset`.
So #1086 have fixed this to implementation a `content_size` method to
calculate `max_offset` and `bounds` of the `ScrollHandle`.
But I found that the `Interactivity` prepaint (This is used in
VirtualList) was not to update the `bounds` of the `ScrollHandle`.
Wait https://github.com/zed-industries/zed/pull/35013 to merge.
| Before | After |
| -- | --- |
| <img width="620" alt="image"
src="https://github.com/user-attachments/assets/6ffb8f30-93b4-42ec-a837-90f80ecb2bf5 "
/> | <img width="620" alt="image"
src="https://github.com/user-attachments/assets/21466332-030c-495f-8c84-e3a2c6eeb403 "
/> |
- Split `Scrollbale` and `VirtualList` story.
## Break Changes
- The `content_size` argument has been removed from `virtual_list`
callback.
2025-07-24 08:30:42 +00:00
Jason Lee
56cf05b749
table: Fix horizontal scroll range when no fixed columns. ( #1089 )
2025-07-24 15:35:14 +08:00
Floyd Wang
634ab14306
button: Use muted foreground as disabled text color ( #1088 )
2025-07-24 14:19:10 +08:00
Cyandev
e9d8741835
scrollbar: Fix content size ( #1086 )
...
Caused by PR #1078 incorrect changes, and GPUI was changed API
https://github.com/zed-industries/zed/pull/34832
The content size of the scrollable area should be its max scroll offset
plus the container size.
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-07-24 10:20:04 +08:00
Jason Lee
fcf447d612
theme: Fix scrollbar default color and list hover color. ( #1085 )
2025-07-23 11:50:42 +00:00
Floyd Wang
6d28cce719
notification: Fix display issues caused by the taffy upgrade ( #1084 )
2025-07-23 19:12:13 +08:00
Jason Lee
f458cb83f8
accordion: Fix accordion to size full. ( #1083 )
...
- Remove `accordion.background` color from themes.
2025-07-23 10:45:02 +00:00
Floyd Wang
a2b91a7a2b
input(state): Provide context to the validate method ( #1082 )
2025-07-23 14:30:16 +08:00
Jason Lee
271116926c
code-editor: Add go_to_line method to CodeEditor. ( #1081 )
...
- Fix to emit `enter` press key in Input single-line mode.
2025-07-23 13:33:09 +08:00
Cyandev
dfbda3999a
modal: Refine enter animation ( #1080 )
...
This PR adds a fade in animation for modals, which makes the UI looks
smoother.
https://github.com/user-attachments/assets/7671aa78-a3bd-43a6-ace7-d051d24f2523
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-07-23 10:29:42 +08:00
Jason Lee
7d3301d695
tab_bar: Fix some incorrect style in TabBar. ( #1078 )
...
This change to fix some incorrect style use, that will break in Taffy
0.5.2+
Ref https://github.com/zed-industries/zed/pull/34827
- Add `Tab::empty` to create a Tab without label.
- Fix form layout in Taffy new version.
- Update GPUI for scroll API changes.
2025-07-22 13:30:04 +08:00
Jason Lee
61b7e54bfa
table: Refactor the Table API for describe the columns. ( #1072 )
...
## Break Changes
- The `ColFixed` has renamed to `ColumnFixed`.
- The `ColSort` has renamed to `ColumnSort`.
### TableDelegate
- Removed `col_name`, `col_resizable`, `col_selectable`, `col_width`,
`col_sort`, `col_fixed`, `col_paddings`, `col_movable` method, now use
`col` method to return a TableCol for describe of them.
- The `cols_count` method renamed to `columns_count`.
```diff
- fn cols_count(&self, _: &App) -> usize
+ fn columns_count(&self, _: &App) -> usize
```
- The `move_col` has renamed to `move_column`.
- The `visible_cols_changed` has renamed to `visible_columns_changed`.
### TableEvent
```diff
- TableEvent::SelectCol
+ TableEvent::SelectColumn
- TableEvent::MoveCol
+ TableEvent::MoveColumn
- TableEvent::ColWidthsChanged
+ TableEvent::ColumnWidthsChanged
```
2025-07-21 11:16:35 +08:00
Floyd Wang
b7f443b73f
label: Streamline the test cases ( #1074 )
2025-07-18 17:10:36 +08:00
Floyd Wang
b553ca8dcc
label: Add support for highlighting specified text ( #1073 )
...
<img width="1712" height="1312" alt="SCR-20250718-ogsp"
src="https://github.com/user-attachments/assets/5f0043ef-77c7-4d91-ad99-4061b14497ff "
/>
<img width="1712" height="1312" alt="SCR-20250718-oguh"
src="https://github.com/user-attachments/assets/ed0bf114-37d0-458d-9321-82766fe75076 "
/>
2025-07-18 16:33:36 +08:00
Jason Lee
7f3f2a3940
button: Fix selected style for outline button. ( #1070 )
2025-07-17 14:20:19 +08:00
Jason Lee
9c782796c2
theme: Improve theme color fallbacks based on base colors. ( #1069 )
...
- Added a lot of default fallbacks for theme colors based on `base`
colors.
- Added `hue`, `saturation`, `lightness` method to change Hsla color.
- Update stories to use theme colors, not a direct color.
- Improve `Badge`, `Avatar` to use theme colors.
- Added a new theme: `Fahrenheit`.
2025-07-17 11:43:40 +08:00
Jason Lee
977ce5df29
theme: Refactor Theme config to support JSONSchama. ( #1068 )
2025-07-16 19:22:09 +08:00
Jason Lee
ed75659765
table: Update to standardization the TableDelegate API. ( #1067 )
...
## Break Changes
- Renamed some method name of the TableDelegate.
```diff
- fn can_select_col
+ fn col_selectable
- fn can_resize_col
+ fn col_resizable
- fn col_padding
+ fn col_paddings
- fn can_move_col
+ fn col_movable
```
- Removed `fn can_loop_select` remove TableDelegate, instead of to use
`loop_selection` option on `Table`.
2025-07-16 17:11:49 +08:00
Jason Lee
ea1f5331c8
input: Hide cursor and selection when window is deactivated. ( #1066 )
2025-07-16 14:01:46 +08:00
Jason Lee
eca7949583
input: Update input behaviors to do not unselect on blur or press escape. ( #1065 )
...
- Also to pub `unselect` for manually use, and fix this method will
incorrect to move right 1 char.
2025-07-16 13:29:58 +08:00
Jason Lee
0fbe32c7d7
highlighter: Fix to support custom language register. ( #1064 )
2025-07-15 19:24:25 +08:00
Jason Lee
ac026e26c9
theme: Improve theme color fallbacks and add more themes. ( #1063 )
2025-07-15 18:33:36 +08:00
Jason Lee
d139198c15
theme: Impl Default for Theme. ( #1061 )
2025-07-15 16:35:12 +08:00
Jason Lee
c9b5993472
story: Improve story case style. ( #1060 )
2025-07-15 11:56:07 +08:00
Jason Lee
cfd1551575
theme: Add more theme and fix to use default color from base color. ( #1058 )
2025-07-14 20:17:11 +08:00
Jason Lee
6508927e7f
input: Add appearance option to NumberInput, Dropdown, DatePicker to render without style. ( #1054 )
...
<img width="1100" height="935" alt="image"
src="https://github.com/user-attachments/assets/b213c778-eef0-4d63-8d07-b68da9a078b1 "
/>
2025-07-14 19:57:56 +08:00
Jason Lee
867b4ff3a6
dock: Open dock if clicked on the tab of the collapsed bottom dock. ( #1057 )
2025-07-14 18:49:31 +08:00
Jason Lee
1df450d3b0
story: Fix tiles story. ( #1056 )
2025-07-14 18:06:46 +08:00
Jason Lee
44427afacb
theme: Add to support highlight color to theme config. ( #1055 )
...
<img width="1058" height="1026" alt="image"
src="https://github.com/user-attachments/assets/300fb16b-c5e4-4eef-9690-54fcabc4fe47 "
/>
<img width="836" height="855" alt="image"
src="https://github.com/user-attachments/assets/3fdc8301-375d-4223-a2ea-8d4f411a90bd "
/>
2025-07-14 17:04:18 +08:00
Jason Lee
82b87d92ab
text_view: Fix nested Blockquote render in Markdown and HTML. ( #1053 )
...
<img width="986" height="271" alt="image"
src="https://github.com/user-attachments/assets/1de04629-2bdc-48f2-ae69-45c33482aeff "
/>
- Also fixed short language name in code block, e.g.: `rs` -> `rust`.
2025-07-14 14:30:40 +08:00
Floyd Wang
3b759cd448
plot: Use f32 instead of f64 ( #1052 )
...
## Break Change
- Convert all `f64` parameters to `f32`.
Since the GPUI geometry module uses f32 for rendering, we are also
switching to f32. This helps avoid many as operators and unnecessary
conversions.
2025-07-08 16:24:59 +08:00
Jason Lee
8bf66443b2
theme: Add theme schema to support JSON theme config. ( #1050 )
2025-07-07 19:40:00 +08:00
Jason Lee
463c3ebfea
chore: Remove unnecessary examples that have includes in gallery. ( #1049 )
2025-07-07 12:11:19 +08:00
Jason Lee
40a2467374
virtual_list: Add element state to cache item size calculate. ( #1048 )
2025-07-07 11:47:35 +08:00
Jason Lee
4156c831c6
chore: Refactor code for Input. ( #1046 )
2025-07-05 14:37:12 +08:00
Jason Lee
89ee8c0630
otp_input: Fix to keep showing focus border when all code has filled. ( #1047 )
...
https://github.com/user-attachments/assets/dd10793e-668e-4c01-9bc9-fe00b539a5d1
2025-07-05 14:12:20 +08:00
Jason Lee
1f46b6b81c
story: Add more case to markdown example. ( #1045 )
2025-07-04 16:35:30 +08:00
Jason Lee
9b0ce145f6
alert: Improve Alert styles. ( #1044 )
...
<img width="1201" alt="image"
src="https://github.com/user-attachments/assets/7484132b-8bdd-4353-a6f0-f038189d9b15 "
/>
2025-07-04 15:29:05 +08:00
Jason Lee
cafb03777b
chore: Remove shadow_xs, now GPUI has this method. ( #1043 )
...
https://github.com/zed-industries/zed/pull/33361
2025-07-04 15:17:55 +08:00
Jason Lee
1a4b7ce76a
highlighter: Fix some case update will get incorrect syntax highlight. ( #1041 )
2025-07-04 12:46:59 +08:00
Jason Lee
1069469c46
theme: Update secondary color and fix toggle selected color. ( #1039 )
...
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/9ec4f4ea-f318-4db6-b9cd-7911cc4f9462 "
/>
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/85d52c62-1e51-49d3-905e-30865555cfd8 "
/>
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/eb71f364-730d-4f55-a84d-95235a3545f0 "
/>
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/3383e8f7-500d-4348-b391-c764a35fd6a9 "
/>
2025-07-03 19:23:40 +08:00
Jason Lee
6886ae746e
story: Add Indicator, Skeleton story. ( #1038 )
2025-07-03 18:54:23 +08:00
Jason Lee
d70d649a67
story: Move DescriptionList into main story. ( #1037 )
2025-07-03 18:09:30 +08:00
Jason Lee
4075447c63
text_view: Fix list item to merge inline paragraphs, and fix paragraphs margin. ( #1036 )
...
## Before
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/579385e6-a206-45e4-80a1-e1e2cdd6b164 "
/>
## After
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/2f551d22-5662-4c3c-a0e5-5ce9f26e1e66 "
/>
2025-07-03 18:02:08 +08:00
Jason Lee
9eb7e10a1d
button: Adjust outline button active color. ( #1035 )
2025-07-03 15:35:19 +08:00
Floyd Wang
f4025a9447
form: Fix label text wrapping issue ( #1034 )
...
| Before | After |
| - | - |
| <img width="752" alt="image"
src="https://github.com/user-attachments/assets/32abd11a-39c6-4045-9727-3188c46e482c "
/> | <img width="752" alt="image"
src="https://github.com/user-attachments/assets/98e45484-1c05-4d90-977f-efd9b89d9dd9 "
/> |
2025-07-03 15:09:57 +08:00
Floyd Wang
32d0beff22
plot: Tooltip support multiple dots ( #1030 )
2025-07-03 11:28:48 +08:00
Jason Lee
b80d3a95b1
badge: Add icon variant to Badge. ( #1029 )
...
<img width="1248" alt="image"
src="https://github.com/user-attachments/assets/5d80a3d9-4d4e-4eea-89c9-cea9ab33be9e "
/>
2025-07-03 11:13:39 +08:00
Jason Lee
66a9b3e9df
avatar: Add Avatar element. ( #1028 )
...
<img width="1384" alt="image"
src="https://github.com/user-attachments/assets/1e66aa8c-0c87-4d8d-abb7-38e5f616fe3e "
/>
<img width="1384" alt="image"
src="https://github.com/user-attachments/assets/bd32b6e0-aa0f-4d01-af9f-4bfaea1a3718 "
/>
2025-07-02 18:58:06 +08:00
Jason Lee
a28ad0b1f1
text_view: Fix list item text wrap. ( #1027 )
...
## Before
<img width="911" alt="image"
src="https://github.com/user-attachments/assets/cfe01686-48da-4140-84d0-ead361833131 "
/>
## After
<img width="902" alt="image"
src="https://github.com/user-attachments/assets/fb97f8e8-3f16-43c4-8223-b7c6fdcc269f "
/>
2025-07-02 15:25:58 +08:00
Jason Lee
41663ca030
chore: Update GPUI and fix FocusableWrapper removed error. ( #1026 )
...
Close #1024
Ref https://github.com/zed-industries/zed/pull/32436
2025-07-02 11:06:04 +08:00
Jason Lee
646b8b7206
button: Fix loading style when disabled. ( #1021 )
...
## Before
<img width="1193" alt="image"
src="https://github.com/user-attachments/assets/e7a82f21-2ec8-42fa-8daa-05d4f086e0b2 "
/>
## After
<img width="1196" alt="image"
src="https://github.com/user-attachments/assets/f387c591-a4a1-4220-9318-badfb8a133e6 "
/>
2025-06-30 15:44:26 +08:00
Jason Lee
deb1187c40
story: Fix #1017 duplicate action name error. ( #1020 )
2025-06-30 11:18:57 +08:00
Jason Lee
21dbaffcf4
input: Add Cursor and Selection type and export line number, cursor. ( #1012 )
2025-06-27 20:48:26 +08:00
Jason Lee
5b17281374
text_view: Fix li > strong render not in same line. ( #1016 )
...
## Before
<img width="1294" alt="image"
src="https://github.com/user-attachments/assets/0620f33a-914e-4d2a-8832-16c037351352 "
/>
## After
<img width="1131" alt="image"
src="https://github.com/user-attachments/assets/a31b9b5a-6d41-4c04-a415-ff97e7cd1f31 "
/>
2025-06-27 18:41:28 +08:00
Jason Lee
b18a3ff7a9
menu: Fix menu item hover to use accent color. ( #1015 )
2025-06-26 18:38:36 +08:00
Jason Lee
babb04fcaa
text_view: Fix code block background to use accent color. ( #1014 )
2025-06-26 18:30:34 +08:00
Jason Lee
819161ec58
form: Fix form label required not in same line. ( #1013 )
...

2025-06-25 22:30:09 +08:00
Floyd Wang
f7d536531d
dropdown_button: Fix incorrect rounded when ghost button selected ( #1011 )
...
| Before | After |
| - | - |
| <img width="218" alt="SCR-20250625-psed"
src="https://github.com/user-attachments/assets/873db4e9-d169-4273-bee9-58332b41c00f "
/> | <img width="222" alt="SCR-20250625-prxz"
src="https://github.com/user-attachments/assets/48f8cb35-cd67-47ac-bbb9-2739e1aa16b9 "
/> |
2025-06-25 18:11:30 +08:00
Jason Lee
692ee83b61
chore: Move shadow_xs to StyledExt trait. ( #1010 )
...
This PR for fix https://github.com/longbridge/gpui-component/pull/1009
mistake.
2025-06-25 16:54:48 +08:00
Jason Lee
c8481bee19
theme: Update theme details to match Shadcn. ( #1009 )
...
## Light
<img width="1393" alt="image"
src="https://github.com/user-attachments/assets/b1893648-5994-4c08-a79a-30b10dc62c47 "
/>
<img width="1393" alt="image"
src="https://github.com/user-attachments/assets/de5b4e13-7889-473b-b0c0-9ac11de0a4b0 "
/>
<img width="1393" alt="image"
src="https://github.com/user-attachments/assets/9f17c2a1-3a71-4d56-be6c-49f26f5e7406 "
/>
<img width="1393" alt="image"
src="https://github.com/user-attachments/assets/a4e99a61-a618-4c3b-a237-93bbc17d4cae "
/>
<img width="1393" alt="image"
src="https://github.com/user-attachments/assets/64313ae5-8284-46ff-a75f-5a14a1e3b339 "
/>
<img width="1193" alt="image"
src="https://github.com/user-attachments/assets/5c134172-0ab6-4299-950d-bac3dda7b61d "
/>
<img width="1374" alt="image"
src="https://github.com/user-attachments/assets/c8816288-d008-490d-9db3-4fa796278001 "
/>
<img width="1428" alt="image"
src="https://github.com/user-attachments/assets/d903a854-15e3-48aa-8ebd-969c1c91c624 "
/>
## Dark
<img width="1467" alt="image"
src="https://github.com/user-attachments/assets/720418b4-8a9b-42c9-814b-a0be660e8eba "
/>
<img width="1393" alt="image"
src="https://github.com/user-attachments/assets/4ca20f31-c998-40bb-b4bf-6079c506f9ec "
/>
<img width="1393" alt="image"
src="https://github.com/user-attachments/assets/ae828624-55b3-4d33-8a20-2c71a0a838cc "
/>
<img width="1393" alt="image"
src="https://github.com/user-attachments/assets/7014c76c-5e18-4cd5-9cf1-6bccbb58e56a "
/>
<img width="1393" alt="image"
src="https://github.com/user-attachments/assets/6e1c514d-5f76-460a-9c7e-a38f2f0e712a "
/>
<img width="1374" alt="image"
src="https://github.com/user-attachments/assets/07ad8c20-317b-4209-9f92-b500f53dd4c0 "
/>
<img width="1428" alt="image"
src="https://github.com/user-attachments/assets/6bd2969d-9bec-4ed7-9280-109a81144dfa "
/>
2025-06-25 16:40:27 +08:00
Jason Lee
67f0ffbc9c
chore: Upgrade GPUI and fix action API changes. ( #1008 )
...
Ref https://github.com/zed-industries/zed/pull/33263
2025-06-25 11:06:12 +08:00
Jason Lee
ed0887420f
chore: Impl Styled for more elements. ( #1007 )
...
This PR for continuing #1005 was missed commits.
2025-06-24 19:36:42 +08:00
Jason Lee
dfa3c9a29e
menu: Fix sub menu gap. ( #1006 )
...
<img width="334" alt="image"
src="https://github.com/user-attachments/assets/1f1a9515-f52d-4171-9e53-56d18f923be0 "
/>
2025-06-24 19:33:22 +08:00
Jason Lee
9aa593ce0b
chore: Apply Styled to elements to support flexable style refinement. ( #1005 )
...
## Break Changes
- date_picker, dropdown: Removed `width` method, use `w`, `w_full`
instead.
```diff
- .width(px(100.))
+ .w(px(100.))
```
- calendar: Removed `bordered` method, use `border` method from GPUI
instead.
```diff
- .bordered(false)
+ .border_0()
```
2025-06-24 18:56:35 +08:00
Jason Lee
c05d63dfbe
accordion: Improve Accordion style, and remove item gap when no border. ( #1004 )
...
<img width="635" alt="image"
src="https://github.com/user-attachments/assets/a18aaa73-9cca-4adb-bee9-8cac2178bda0 "
/>
<img width="650" alt="image"
src="https://github.com/user-attachments/assets/02b10d8c-47a3-4226-9585-d1d970679dde "
/>
2025-06-24 17:46:55 +08:00
Jason Lee
21c8844377
notification: Improve Notification animation. ( #1003 )
2025-06-24 17:25:55 +08:00
Michael Angerman
eb9a0ed881
chore: Fix button example so that it scrolls in the y direction ( #999 )
...
The button example was not scrolling in the y direction and therefore
you were *NOT* able to see the entire ButtonStory.
This minor fix now enables one to see the entire ButtonStory.
The only code that needed to be added was
```rust
.id("button_example")
.overflow_y_scroll()
```
2025-06-24 11:54:51 +08:00
ihavecoke
cf24614bd2
title_bar: Add macOS double-click functionality to title bar ( #996 ) ( #1002 )
2025-06-24 07:45:28 +08:00
Jason Lee
3a6741f990
input: Fix wrap text not draw in multi-line mode. ( #998 )
...
Close #997
https://github.com/user-attachments/assets/6ad9f431-b5a2-42f1-93e6-6425f0851898
2025-06-23 18:14:29 +08:00
Jason Lee
7360d2834d
theme: Update default radius to 6px, and modal to 8px. ( #995 )
2025-06-20 20:07:19 +08:00
Jason Lee
fdeb46b293
modal: Update modal inner padding from p_4 to p_6.
2025-06-20 18:16:35 +08:00
Jason Lee
35623f47d7
menu: Fix MenuItem Separator to use border color. ( #993 )
2025-06-20 15:08:21 +08:00
Jason Lee
b5922f9d92
dropdown_button: Keep rounded when is a ghost variant. ( #992 )
...
<img width="159" alt="image"
src="https://github.com/user-attachments/assets/fcb08439-34fc-42f6-bbf4-ca0efbca8e89 "
/>
2025-06-19 22:45:16 +08:00
Michael Angerman
389c25c287
chore: Fix spelling of the word masked ( #990 )
2025-06-19 12:34:19 +08:00
Jason Lee
d7e04ecdd0
scrollbar: Improve Scrollbar to get correct scroll size. ( #985 )
...
Continue #984
- Fixes there may Scrollbar size not match the content size. Close #979
- Improved Table scrollbar to only render at scrollable area when there
have fixed columns.
<img width="850" alt="image"
src="https://github.com/user-attachments/assets/84f54515-e61a-484f-b2b4-ea5abb98ddb8 "
/>
## Break Changes
- The `Scrollbar` has been removed `entity_id` and `scroll_size`
argument from new method, it will get that value from `scroll_handle`.
- There still have a `scroll_size` optional method, if you want to give
your own.
- Also changed the `scroll_state`, `scroll_handle` to receive a ref.
```diff
- Scrollbar::vertical(entity_id, scroll_state, scroll_handle, scroll_size);
+ Scrollbar::vertical(&scroll_state, &scroll_handle);
+ Scrollbar::vertical(&scroll_state, &scroll_handle).scroll_size(scroll_size);
```
2025-06-18 19:09:34 +08:00
Jason Lee
4c87c72f60
menu: Fix scrollbar can't drag to bottom of scrollable PopupMenu. ( #984 )
...
| Before | After |
|--| -- |
| <img width="166" alt="image"
src="https://github.com/user-attachments/assets/883eb78b-9ea3-4f1b-b01e-81fbbbdd39ed "
/> | <img width="166" alt="image"
src="https://github.com/user-attachments/assets/9ba551aa-5d9e-49ed-adfa-3da6c654f0c4 "
/>|
Ref #979 but not fix.
2025-06-18 17:31:56 +08:00
Jason Lee
1752d3e2b4
chore: Improve Scrollbar and Scrollable to support Axis and ScrollbarAxis. ( #983 )
2025-06-18 16:00:35 +08:00
Floyd Wang
c5fed17941
notification: Better style details ( #982 )
...
| Before | After |
| - | - |
| <img width="752" alt="Before"
src="https://github.com/user-attachments/assets/d4e08e87-100a-4b8d-90f3-909900d41e66 "
/> | <img width="752" alt="After"
src="https://github.com/user-attachments/assets/e84c145e-8990-4c47-bbff-0d4e86acca64 "
/> |
2025-06-18 14:21:25 +08:00
Jason Lee
da0063cb57
list: Fix search input padding. ( #981 )
...
This change to fix #965 affected search input size.
<img width="513" alt="image"
src="https://github.com/user-attachments/assets/f8fce042-2f53-4dc3-a725-64a1b0ed6630 "
/>
<img width="550" alt="image"
src="https://github.com/user-attachments/assets/048e9ef8-da2d-4b9b-ad24-ccda55695c8b "
/>
<img width="517" alt="image"
src="https://github.com/user-attachments/assets/f06f7e9a-bf30-4e01-a0aa-0a1db6b2c6e1 "
/>
2025-06-18 14:07:21 +08:00
Floyd Wang
1055131ffe
notification: Support remove notification with the given id ( #980 )
2025-06-18 14:02:07 +08:00
Floyd Wang
fe342919e6
notification: Show the close button when auto-hide is enabled ( #977 )
2025-06-18 11:34:11 +08:00
Sunli
934d08c332
wef: Fixed some issues ( #975 )
2025-06-18 10:46:55 +08:00
Floyd Wang
c39e7af50c
number_input_story: Fix subtraction overflow ( #976 )
2025-06-18 10:16:57 +08:00
Jason Lee
a478f000d4
input: Add MovePageUp, MovePageDown keymap to multi-line mode. ( #969 )
2025-06-17 20:57:53 +08:00
Jason Lee
8762e3482a
wef: Fix doc and warnings. ( #972 )
...

2025-06-17 20:10:34 +08:00
Sunli
b70b229370
wef: Added a new WebView component named "Wef" based on CEF. ( #877 )
...
Wef is a Rust library for embedding WebView functionality using Chromium
Embedded Framework (CEF3) with offscreen rendering support.
2025-06-17 18:57:44 +08:00
Jason Lee
64e3653bc9
modal: Add scrollbar to modal again. ( #971 )
2025-06-17 18:49:49 +08:00
Jason Lee
0e3b61a704
Revert "modal: Add scrollbar to Modal for overflow contents. #960 " ( #970 )
2025-06-17 17:48:42 +08:00
Jason Lee
edf9ed7e5f
input: Fix move up/down to keep same column. ( #968 )
...
Close #908
https://github.com/user-attachments/assets/f050dd1a-501c-4784-a45b-78ba77cdf19c
2025-06-17 15:23:37 +08:00
Jason Lee
3d7f1f8a73
input: Keep showing the blink cursor when typing or moving. ( #967 )
...
https://github.com/user-attachments/assets/3b7d2cfd-50b0-4744-bb74-1deafc5710e3
2025-06-17 14:20:27 +08:00
Jason Lee
869d48b446
input: Fix Input cursor x position when scrolled. ( #966 )
...
https://github.com/user-attachments/assets/db76d3a3-ecd6-45c6-8377-0afa4746f2db
2025-06-17 14:14:23 +08:00
Jason Lee
de491a790c
input: Fix Input prefix, suffix position, and mask * in vertical center. ( #965 )
...
- Fix Input, NumberInput padding x with prefix, suffix.
- Fix Input mask char to render in vertical center.
<img width="498" alt="image"
src="https://github.com/user-attachments/assets/f7b34e17-2503-4a24-9e16-3a30b48bacb5 "
/>
- Fix to only use `Tab`, `Shift-Tab` to indent in multi-line mode.
- Improve blink cursor to render with 1.5px width and same as
line-height.
2025-06-17 13:59:02 +08:00