Jason Lee
4b8775f7d3
chore: Remove unused image example. ( #1510 )
...
Close #1494
2025-11-04 14:55:02 +00:00
Jason Lee
5f39b99fe4
list: Avoid select item when selectable(false). ( #1508 )
...
Close #1500
2025-11-04 14:12:31 +00:00
Jason Lee
d037f074dc
chore: Move searchable to ListState and SelectState. ( #1507 )
2025-11-04 21:26:11 +08:00
Jason Lee
087cb70d00
select, list: Update searchable default to false. ( #1504 )
...
Continue #1503 to update the `searchable` default to `false`.
2025-11-04 20:59:38 +08:00
Jason Lee
2870bc6e36
list: Add searchable, search_placeholder option to List and Select. ( #1503 )
...
## Break Change
- Removed `set_query_input`, `query_input` and `no_query` method from
List. Now use `List::new(&state).searchable(false)` to intead of
`no_query`.
- Removed `searchable` method from `SelectDelegate`, use
`Select::searchable` instead.
2025-11-04 19:06:50 +08:00
ihavecoke
fbaddbe9e3
tiles: Add scrollbar_show option to Tiles ( #1496 )
2025-11-04 17:42:46 +08:00
Jason Lee
893e323692
Fix state internal update to refresh for List, Tree, Table and Select. ( #1492 )
...
This to fix #1468 , #1449 changes broken the state (e.g.: `SelectState`
to call `cx.notify()`) update not notify parent element (e.g.: `Select`)
to rerender.
2025-11-04 16:25:37 +08:00
Jason Lee
faee23eef8
table: Change context_menu method in TableDelegate to mutable window and cx. ( #1487 )
...
## Break Change
- The `window`, `cx` has changed from `&Window`, `&App` to `&mut
Window`, `&mut App`.
```diff
- fn context_menu(&self, row_ix: usize, menu: PopupMenu, window: &Window, cx: &App)
+ fn context_menu(&self, row_ix: usize, menu: PopupMenu, window: &mut Window, cx: &mut App)
```
2025-11-03 18:06:29 +08:00
Jason Lee
9fa2669ff4
list, table: Refactor List, Table to have ListState, TableState. ( #1468 )
...
## Break Change
- Like Select, Input API design, now `List`, `Table` also has ListState
and TableState.
```diff
- let table = cx.new(|_| Table::new(delegate, window, cx).stripe(true).border(true))
+ let table = cx.new(|_| TableState::new(delegate, window, cx))
+ Table::new(&table).stripe(true).border(true) // for render
- let list = cx.new(|_| List::new(delegate, window, cx))
+ let list = cx.new(|_| ListState::new(delegate, window, cx))
+ List::new(&list) // for render
```
- ListDelegate, TableDelegate methods has changed some argument type:
- If first argument is `&mut self`, the `cx` has been changed to `&mut
Context<ListState<Self>>` or `&mut Context<TableState<Self>>`.
```diff
- fn confirm(&mut self, _secondary: bool, _: &mut Window, cx: &mut
Context<List<Self>>)
+ fn confirm(&mut self, _secondary: bool, _: &mut Window, cx: &mut
Context<ListState<Self>>)
```
- If first argument is `&self`, the `cx` has been changed to `&mut App`.
```diff
- fn render_item(&self, ix: IndexPath, _: &mut Window, _: &mut
Context<List<Self>>)
+ fn render_item(&self, ix: IndexPath, _: &mut Window, _: &mut App)
```
2025-11-02 12:59:37 +00:00
Floyd Wang
123934237a
Bump v0.4.0-preview0
2025-10-30 15:50:45 +08:00
Jason Lee
e75c37a1ac
chore: Update List, Tree, Kbd exports. ( #1467 )
...
## Break Change
- Removed `Kbd` from root export, use `gpui_component::kbd::Kbd`
instead.
- Removed `List` from root export, use `gpui_component::list::*`
instead.
- Removed `Tree` from root export, use `gpui_component::tree:*` instead.
2025-10-30 07:19:39 +00:00
Jason Lee
2727a65494
resizable: Simplify Resizable API. ( #1459 )
...
- Added `on_resize` callback method to `ResizabelPanelGroup`.
## Break Changes
- Remove `state` argument from `h_resizable`, `v_resizable` method.
```diff
- v_resizable("resizable-1", state)
+ v_resizable("resizable-1")
```
- Removed `group` method from `ResizabelPanelGroup`, use `child`
instead.
```diff
- v_resizable(..).group(..)
+ v_resizable(..).child(..)
```
2025-10-29 23:01:05 +08:00
Jason Lee
a1ca8624af
example: Add file tree to Editor example. ( #1457 )
...
<img width="1205" height="861" alt="image"
src="https://github.com/user-attachments/assets/4b3814cd-7dc0-4fc1-8f0f-d98d7cc29294 "
/>
2025-10-29 12:58:40 +00:00
Jason Lee
7036415662
chore: Keep spawn task on it owner. ( #1456 )
2025-10-29 19:11:49 +08:00
Jason Lee
55db53a46d
select: Impl SelectItem for &'static str. ( #1451 )
2025-10-28 13:37:00 +00:00
Jason Lee
34ef0ff6d0
chore: Rename Dropdown to Select, TextInput to Input. ( #1449 )
...
## Break Change
- The `Dropdown` has been renamed to `Select`.
- The `TextInput` has been renamed to `Input`.
| Before | After |
| --- | --- |
| TextInput | Input |
| Dropdown | Select |
| DropdownItem | SelectItem |
| DropdownItemGroup | SelectGroup |
| DropdownState | SelectState |
| DropdownEvent | SelectEvent |
| DropdownDelegate | SelectDelegate |
| dropdown::ListEvent | ~~Removed~~ |
- Renamed `PopupMenuExt` to `DropdownMenu`.
- Removed pub mod `menu::popup_menu`, `menu::context_menu`, they are
moved into `menu` mod.
- Renamed `popup_menu` method to `dropdown_menu` for `DropdownMenu`,
`Panel`, `PanelView` and `DropdownButton`.
| Before | After |
| --- | --- |
| popup_menu::PopupMenuExt | menu::DropdownMenu |
| popup_menu | dropdown_menu |
| popup_menu_with_anchor | dropdown_menu_with_anchor |
2025-10-28 21:22:31 +08:00
Jason Lee
38a10fe05c
menu: Add item and export PopupMenuItem with builder methods to PopupMenu. ( #1445 )
...
Now we can be easy to add a menu item without define `action`, just use
`on_click` callback.
## Break Changes
- Removed complex methods: `menu_element_with_check_and_disabled`,
`menu_element_with_icon_and_disabled`, you can use `item` and
`PopupMenuItem` instead.
2025-10-28 14:42:56 +08:00
Floyd Wang
19a54d6065
chart(pie): Support dynamic inner and outer radius ( #1444 )
...
## ⚠️ Breaking Change
Add `inner_radius` and `outer_radius` options for `Arc` paint function.
```diff
- arc.paint(a, "#9d9d9d", bounds, window)
+ arc.paint(a, "#9d9d9d", Some(20.), Some(30.), bounds, window)
```
## Demo
<img width="410" height="442" alt="SCR-20251028-kohu"
src="https://github.com/user-attachments/assets/8b849053-22e6-4d6f-933f-b9fb2a47f5e3 "
/>
2025-10-28 13:53:28 +08:00
Jason Lee
904c9f3fa7
theme: Export more theme options for schema. ( #1442 )
...
- Fix theme switch to support other UI settings (e.g.: radius, shadow,
font_size).
- Update `matrix` theme to use rounded 0px.
<img width="1380" height="1139" alt="image"
src="https://github.com/user-attachments/assets/24832fde-5b5e-4508-9b38-6c3c2890aedb "
/>
2025-10-28 03:28:18 +00:00
Jason Lee
cc0f936348
tiles: Add tile_radius theme option and default 0px. ( #1441 )
2025-10-28 02:54:41 +00:00
Floyd Wang
183d17731d
Bump v0.3.1
2025-10-27 13:52:29 +08:00
Jason Lee
6ebb9418a0
editor: Use measure_indent_width for indent guides width. ( #1428 )
...
Continue #1426 , this changes I was forgotten to push before #1426
merged.
2025-10-24 20:18:30 +08:00
Jason Lee
178269be63
editor: Add indent guides. ( #1426 )
...
<img width="1070" height="1006" alt="image"
src="https://github.com/user-attachments/assets/a456b055-b45f-45ae-84b0-452a952cc19c "
/>
2025-10-24 19:03:09 +08:00
Jason Lee
ab7af9c01d
Bump v0.3.0
2025-10-24 10:47:04 +08:00
Jason Lee
6dd857a7f7
input: Fix may flash scroll when move cursor in auto grow mode. ( #1419 )
2025-10-23 17:43:33 +08:00
Floyd Wang
b80fca28c1
Bump v0.3.0-preview2
2025-10-23 16:36:23 +08:00
Jason Lee
17ec395853
Bump v0.3.0-preview0
2025-10-17 10:37:49 +08:00
Jason Lee
f16487a2cb
chore: Fix license link in crate meta. ( #1393 )
...
Close #1392
2025-10-17 10:32:09 +08:00
Jason Lee
1adaf3ec55
tree: Add Tree. ( #1373 )
...
Close #318
https://github.com/user-attachments/assets/1fed12e2-df53-4213-a3f5-c57bd8b4cadb
2025-10-15 18:39:47 +08:00
Copilot
4fef96e407
story: Fix story panic when save state failed. ( #1384 )
...
Close #1383
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: huacnlee <5518+huacnlee@users.noreply.github.com>
2025-10-15 08:20:44 +00:00
han
1bc5ff03df
story: Add interactive brush drawing canvas ( #1370 )
...
<img width="2175" height="1358" alt="image"
src="https://github.com/user-attachments/assets/41716d72-655f-440a-ac9e-cdb91e1b4417 "
/>
---------
Co-authored-by: hl <hl@nmcsoft.com>
2025-10-15 15:27:59 +08:00
Jason Lee
59f4e26c7b
input: Fix Input panics when masked have non-ASCII characters. ( #1382 )
...
Close #1377
2025-10-15 07:15:50 +00:00
Jason Lee
0c0c36cb87
menu: Fix trigger action with context. ( #1372 )
...
Fix previous #1338 broken trigger action with context.
2025-10-14 19:58:11 +08:00
Floyd Wang
47978bc50e
button: Support specified anchor to dropdown button ( #1367 )
2025-10-14 11:19:22 +08:00
Jason Lee
5b2fed0ccb
markdown: Use list for Markdown render and add scrollbar. ( #1357 )
2025-10-13 22:06:07 +08:00
Jason Lee
2574e7f812
story: Add open file to Markdown and Editor example. ( #1363 )
...
Close #1352
2025-10-13 11:52:16 +08:00
Jason Lee
97df4efd46
input: Fix set_value when Input is disabled. ( #1362 )
...
Close #1350
2025-10-13 11:15:32 +08:00
Sunli
8a63fd67ab
chore: Fix webview example ( #1360 )
2025-10-13 10:10:35 +08:00
Martí Gimeno Ortí
32b8d65075
plot: Add StepAfter kind to StokeStrike ( #1356 )
...
Implements new `StokeStrike::StepAfter` for plot component
<img width="1700" height="1030" alt="step-after-plot-stoke-style"
src="https://github.com/user-attachments/assets/89252ba9-2834-4c9a-9020-7977ffea6865 "
/>
2025-10-13 09:59:51 +08:00
Jason Lee
6817c8d3cc
menu: Add AppMenuBar. ( #1338 )
...
- input: Change Input to not unselect when blur.
- popup_menu: Fix get key binding on PopupMenu with action context.
<img width="935" height="694" alt="image"
src="https://github.com/user-attachments/assets/295fa84e-f1d8-4f6f-8a77-601a45f8ad6d "
/>
## TODO
- [x] Keyboard support.
- [x] Add submenu to example.
- [ ] ~~Icon~~ and check support. Wait
https://github.com/zed-industries/zed/pull/39876
2025-10-10 21:03:16 +08:00
ihavecoke
9d01ac26bc
menu: Fix submenu item selection when multiple submenus exist ( #1342 )
...
Before:
https://github.com/user-attachments/assets/8653953e-4e9d-49e6-946a-1696ea6abee0
After:
https://github.com/user-attachments/assets/f5bfbf19-69e1-4e64-81c1-072c61e8a8f7
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-10-09 21:32:51 +08:00
Floyd Wang
7a8be9a628
button: Add Support for on_hover event ( #1341 )
2025-10-09 18:43:50 +08:00
Jason Lee
ca9d5b77e2
chore: Release v0.2.0
2025-10-09 15:21:10 +08:00
Jason Lee
6ca9ac46fa
chore: Bump crate version. ( #1340 )
2025-10-09 15:20:34 +08:00
Jason Lee
d0396d779e
editor: Add document_colors LSP. ( #1329 )
2025-10-06 18:08:12 +08:00
Floyd Wang
1358b2906e
Bump gpui ( #1324 )
...
* Wireup the `Pixels` change
https://github.com/zed-industries/zed/pull/39367 .
2025-10-03 14:32:29 +08:00
Jason Lee
cfd060b66d
editor: Split Input and Editor background color. ( #1323 )
...
Keep input to use window background color, the `editor.background` only
for Editor mode.
2025-10-03 11:20:01 +08:00
Jason Lee
e84e8ebaad
button: Fix button label display has overflow hidden. ( #1322 )
2025-10-03 10:18:00 +08:00
Carlo Corradini
908c022efe
chore: Assets interpolate folder path via rust embed ( #1318 )
...
Use `rust-embed` feature `interpolate-folder-path` to always
(`debug`/`release`) load assets from the correct `assets` directory
2025-10-02 16:04:33 +08:00
Jason Lee
935cd93f5a
chore: Fix rust logo URL in test.md.
2025-09-30 16:29:56 +08:00