xda
5874c6974f
tiles: Add Tiles ( #435 )
...
## Break Changes
- Renamed `DockItemState` to `PanelState`.
- Renamed `DockItemInfo` to `PanelInfo`.
- Update `cx` type from `WindowContext` to `AppContext` for Panel trait
`panel_name` method.
## TODO
- [ ] Support merge panels into TabPanel.
- [ ] Support split panels into Tile.
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-12-16 20:33:14 +08:00
Jason Lee
a5a72fcb5a
panel: Avoid render panel when TabPanel is collapsed. ( #492 )
...
Close #488
- Fix `collapsed` sync to `TabPanel` when load state.
2024-12-13 11:23:00 +08:00
Jason Lee
d701baed28
dock: Do not active tab when drop to TabPanel right empty area. ( #491 )
2024-12-12 19:18:42 +08:00
Jason Lee
28c072d9c6
table: Fix incorrect column offset when have fixed columns. ( #490 )
2024-12-12 17:40:25 +08:00
Jason Lee
8558da4a7b
table: Improve Table to only render visible range columns for performance up to stable on 120 FPS ( #489 )
...
This change to make Table to only render visible range columns.
With the example table story case:
- 32 columns
## Before
- Normally fast scroll: 80~90 FPS
- Drag fast scroll: 60 FPS
## After
- Normally fast scroll: 120 FPS
- Drag fast scroll: 90~100 FPS

2024-12-12 17:09:26 +08:00
Jason Lee
64a3b4399b
chore: Update GPUI with gradient support. ( #487 )
2024-12-12 10:19:38 +08:00
Jason Lee
094611a2ae
input: Avoid handle up, down in Input single line mode. ( #485 )
2024-12-10 19:01:35 +08:00
Jason Lee
cf090923a7
theme: Fix lighten, darken method. ( #483 )
...
Close #332
2024-12-10 17:35:44 +08:00
Jason Lee
9f0f05af2d
scrollbar: Adjust scrollbar style and add scrollbar_thumb_hover to theme. ( #482 )
...
<img width="297" alt="image"
src="https://github.com/user-attachments/assets/1779bf6c-2d01-4a12-9052-2ba571bff68b ">
<img width="301" alt="image"
src="https://github.com/user-attachments/assets/9971b248-9a48-47ff-847c-00eafff17fe1 ">
2024-12-10 17:08:09 +08:00
Jason Lee
2836540260
scrollbar: Improve scrollbar behaviour. ( #481 )
...
- Only show scroll when recent scrolled.
- Keep showing scrollbar when is visible and hovered on.
- Delay 3s to fade out.
- If not visible, do not handle mouse down event.
- Add `cx.theme().scrollbar_show` option to control scrollbar show
`[Hover, Scrolling]`, default: `Scrolling`.
Close #472

2024-12-10 16:18:38 +08:00
Jason Lee
26024ba2b5
scrollbar: Use default cursor style when hovered on scrollbar. ( #480 )
...
- Move prepare code to `prepaint` stage.
Close #474
2024-12-10 14:43:02 +08:00
Jason Lee
9288dc91c2
input: Add to support multi-line Input. ( #463 )
2024-12-09 20:17:05 +08:00
ihavecoke
39ec84b989
table: Add a theme color to fixed the drag column in dark mode text style ( #476 )
2024-12-09 20:00:48 +08:00
Jason Lee
62ce148c19
scrollbar: Fix position may out of container bounds when clicked scrollbar bg. ( #475 )
2024-12-09 17:21:48 +08:00
ihavecoke
bf0e3a22de
table: Emit MoveCol when moved column. ( #473 )
2024-12-09 15:21:37 +08:00
Jason Lee
d8636a31bd
chore: Fix clippy warnings. ( #465 )
2024-12-05 12:03:29 +08:00
reya
07a8e70d1a
dock: Add DockItem::panel ( #464 )
...
**Description**:
Improve the flexibility of `DockArea`, sometime user won't need a
`TabPanel`, just display some message or UI elements. Curren implement
only allow use Tab or Split. So this PR will add `Plain` to `DockItem`,
user can put anything which implement `PanelView` trait.
**Usage**:
```rust
let left_panels = DockItem::panel(Arc::new(<- PanelView ->));
_ = dock_area.update(cx, |view, cx| {
view.set_version(DOCK_AREA.version, cx);
view.set_left_dock(left_panels, Some(px(260.)), true, cx);
view.set_center(dock_item, cx);
view.set_dock_collapsible(
Edges {
left: false,
..Default::default()
},
cx,
);
});
```
**Screenshot**
<img width="1300" alt="image"
src="https://github.com/user-attachments/assets/a01e427c-50f1-4509-82d1-76cc016aa7b3 ">
2024-12-05 11:12:08 +08:00
Jason Lee
bc7dfb877b
badge: Add Badge. ( #462 )
...
<img width="824" alt="image"
src="https://github.com/user-attachments/assets/1aacdb99-a890-46fb-a0db-a94eb125598b ">
<img width="824" alt="image"
src="https://github.com/user-attachments/assets/b9af9807-4994-4050-84d9-cf5d4d8d172a ">
2024-12-03 23:07:39 +08:00
Jason Lee
cc23291d19
breadcrumb: Add Breadcrumb. ( #461 )
...
<img width="1187" alt="image"
src="https://github.com/user-attachments/assets/a64b88da-bc57-4d28-a440-b4b7b456612b ">
2024-12-03 22:24:44 +08:00
Jason Lee
23f9352295
button: Rename ButtonStyle to ButtonVariant. ( #460 )
...
This is a breaking changes, we need refactor exist code by this:
- `ButtonStyled` -> `ButtonVariants`
- `.style` -> `.with_variant`
- `ButtonStyle` -> `ButtonVariant`
- `ButtonCustomStyle` -> `ButtonCustomVariant`
2024-12-03 19:22:28 +08:00
Floyd Wang
7560542659
divider: Support custom colors ( #459 )
...
<img width="850" alt="image"
src="https://github.com/user-attachments/assets/0161b14d-88ae-4bdf-a515-34df9aefb845 ">
2024-12-03 19:06:10 +08:00
Jason Lee
bdcf552ecf
theme: Remove Theme::get_global, there have Theme::global method. ( #458 )
2024-12-03 18:55:50 +08:00
Ylin
ee38970d68
table: Make selected_{row,col} public ( #456 )
2024-12-03 16:21:36 +08:00
Ylin
dd1b767b8a
table: Make set_selected_row, set_selected_col public ( #455 )
...
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-12-03 12:00:15 +08:00
Jason Lee
97c01c75e8
theme: Fix menu item hover style. ( #454 )
...
<img width="470" alt="image"
src="https://github.com/user-attachments/assets/0255d03d-1e67-49c7-ad3f-5507777d82a3 ">
<img width="449" alt="image"
src="https://github.com/user-attachments/assets/ab7dd027-8e81-408b-8d02-69cc27fcb801 ">
<img width="255" alt="image"
src="https://github.com/user-attachments/assets/e789cceb-8aa6-432e-abb0-ba7a14b793bd ">
2024-12-03 10:07:53 +08:00
Jason Lee
23d273eaf9
sidebar: Add Sidebar ( #452 )
...
Close #430
<img width="1150" alt="image"
src="https://github.com/user-attachments/assets/2564bcfa-7aff-41d3-a7be-496ef2365e30 ">
<img width="1150" alt="image"
src="https://github.com/user-attachments/assets/18c6718a-7641-4e8f-ad0f-bc18bd91fc42 ">
2024-12-02 23:21:39 +08:00
Ylin
09455df61c
table: Fix disabled sort field change to default ( #451 )
...
Co-authored-by: linxin <xin.lin@longbridge-inc.com>
2024-12-02 11:28:16 +08:00
Jason Lee
8c464d6709
dock: Fix some panel cannot able to split ( #450 )
...
- Rename `set_root` to `set_center`.
2024-12-02 10:42:31 +08:00
Jason Lee
9d476f9517
scrollbar: Use paint_layer for scrollbar paint. ( #448 )
...
And increase scrollbar thumb color in normal mode.
But, it looks like no difference for performance.
2024-11-28 11:42:19 +08:00
Jason Lee
5468d034da
theme: Add color method for default color palette to get color by a scale number. ( #447 )
...
```rs
ui::red(50);
ui::blue(600);
```
2024-11-28 11:36:33 +08:00
Jason Lee
a941c7b32e
panel: Fix toggle button border overlap with first tab. ( #446 )
...
<img width="202" alt="image"
src="https://github.com/user-attachments/assets/ab7b9865-52be-4bdb-bade-9b0c47e83bb7 ">
2024-11-27 23:00:25 +08:00
Jason Lee
36dcc53824
dock: Add set_dock_collapsible to support setting the Docks to be collapsible or not. ( #445 )
...
Close #442
In this case, the left Dock is not collapsible:
<img width="1165" alt="image"
src="https://github.com/user-attachments/assets/21422cdd-d686-4931-9285-925b8e8d3343 ">
2024-11-27 21:34:44 +08:00
Jason Lee
7fe91e4e12
dock: Add panel_style to support always show TabBar. ( #444 )
...
Close #441
```rs
DockArea::new(MAIN_DOCK_AREA.id, Some(MAIN_DOCK_AREA.version), cx).panel_style(PanelStyle::TabBar)
```
<img width="1433" alt="image"
src="https://github.com/user-attachments/assets/2013188e-990b-4709-ac7e-43c2de8bc895 ">
2024-11-27 21:34:27 +08:00
xda
53fe5823ef
dock: Fix panel should have a maximal width restriction when resizing ( #443 )
...
https://github.com/user-attachments/assets/617336d2-5392-4eba-a1b4-f1234c8d2eec
2024-11-27 20:36:05 +08:00
Jason Lee
142d092867
dock: Add add_panel method to add panel to DockArea. ( #440 )
...
Ref #438
https://github.com/user-attachments/assets/93b40aed-39f3-4d16-a442-13aa7a931895
2024-11-27 11:27:04 +08:00
Jason Lee
0119c80120
input: Update GPUI and fix Input changes. ( #437 )
...
Ref https://github.com/zed-industries/zed/pull/20968
2024-11-26 21:41:34 +08:00
Floyd Wang
ea6ec8aa5d
ui: Add number_input ( #433 )
...
https://github.com/user-attachments/assets/ae6f4e48-b0fa-4f8c-bff5-809c70848b06
2024-11-25 19:32:56 +08:00
Jason Lee
ea011d11d6
dock: Hide toggle button when side dock is not exist. ( #431 )
2024-11-22 15:38:47 +08:00
xda
d937a90db6
dock: Render toggle dock buttons inside the Panels. ( #414 )
...
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-11-22 14:41:04 +08:00
Jason Lee
c2678268b2
chore: Update background assign to use into.
2024-11-21 15:02:46 +08:00
Floyd Wang
8b23193f8f
dock: Make the panel dock open state controllable ( #429 )
2024-11-20 11:24:42 +08:00
Jason Lee
e6012fcc8f
table: Improve table render performance. ( #421 )
...
Before: ~85 - 100FPS
After: ~110 - 115FPS
2024-11-18 14:43:22 +08:00
Jason Lee
fa6abe5a9e
chore: Upgrade GPUI and fix API changes. ( #426 )
...
Refs:
- https://github.com/zed-industries/zed/pull/20349
- https://github.com/zed-industries/zed/pull/20371
- https://github.com/zed-industries/zed/pull/20686
2024-11-18 11:35:49 +08:00
Jason Lee
cdee8c7ffd
dock: Keep the panel state when meet invalid panel. ( #423 )
...
Close #422
2024-11-15 10:31:20 +08:00
Jason Lee
3db84c1247
Revert "dock: Change bottom dock to floating on bottom of the center view." ( #420 )
...
Reverts longbridgeapp/gpui-component#419
2024-11-14 19:01:57 +08:00
Jason Lee
a2d6752557
dock: Change bottom dock to floating on bottom of the center view. ( #419 )
2024-11-14 18:57:37 +08:00
Jason Lee
079cc35c48
dock: Limit drag move or close when tab panel or parent only have 1 panel. ( #418 )
2024-11-14 18:33:49 +08:00
Jason Lee
b29f4fb0e6
dock: Add set_locked to lock dock area to limit split, move panels. ( #417 )
...
But still allow to resize panels.
2024-11-14 15:47:26 +08:00
Jason Lee
7edbdd01f4
dock: Remove the inside toggle dock button in Dock to reduce complex and add dock::ToggleButtons. ( #415 )
...
Draft https://github.com/longbridgeapp/gpui-component/pull/414 to keep
old code.
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/749a5712-7ec4-43a8-a89d-595a7644a7ec ">
2024-11-14 12:05:58 +08:00
xda
47688a8af2
dock: Generalize Dock's panel to accommodate DockItem ( #412 )
...

2024-11-14 12:00:23 +08:00
ihavecoke
d53b30ff9f
drawer: Set paddings to base to support override drawer body paddings. ( #413 )
...
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-11-13 14:38:47 +08:00
ihavecoke
40345f1e42
webview: Add bounds method to WebView to get container bounds. ( #411 )
...
<img width="1463" alt="image"
src="https://github.com/user-attachments/assets/f70c2d6b-cb26-4cf5-bd2e-9760ff54c524 ">
2024-11-12 19:31:48 +08:00
Floyd Wang
e77578a53f
svg_img: Fix the conversion error of the SVG fill color with alpha ( #410 )
...
### Before
<img width="156" alt="image"
src="https://github.com/user-attachments/assets/c7177ac7-58aa-4865-81c9-4f7ddff9f145 ">
### After
<img width="176" alt="image"
src="https://github.com/user-attachments/assets/a010e78d-752e-4298-bf40-7a42b916e547 ">
2024-11-12 19:26:24 +08:00
Jason Lee
e478d5606f
chore: Add base ui attributes to Root and add change font size to story to test font adjust. ( #409 )
2024-11-12 11:17:16 +08:00
ihavecoke
f96c21782d
skeleton: Fix the bug where the theme color of the skeleton does not display in light mode ( #407 )
2024-11-11 11:48:03 +08:00
Jason Lee
5149b8a714
panel: Add toolbar_buttons to extend button to panel. ( #406 )
...
<img width="635" alt="image"
src="https://github.com/user-attachments/assets/42dc1cb4-a1dd-43c6-8fc3-9d404e86cb85 ">
2024-11-10 23:17:34 +08:00
Floyd Wang
ab772c04f1
svg_img: Remove the svg_img method ( #404 )
...
Use `SvgImg::new()`.
2024-11-08 16:42:33 +08:00
Floyd Wang
df54c7b2fb
svg_img: Embed the font file ( #401 )
...
<img width="644" alt="image"
src="https://github.com/user-attachments/assets/7acaff6c-0913-402a-8759-2660d2977ce5 ">
2024-11-08 15:45:00 +08:00
ihavecoke
5aad0bf340
modal: Add keyboard option to Modal to enable/disable default keyboard event. ( #400 )
2024-11-08 13:50:05 +08:00
Ylin
d4ee273bf5
table: Add render_last_empty_col to table delegate ( #399 )
...
Co-authored-by: linxin <xin.lin@longbridge-inc.com>
2024-11-07 17:53:21 +08:00
Floyd Wang
6d0b332071
svg_img: Render SVGs with text tags ( #390 )
...
<img width="620" alt="image"
src="https://github.com/user-attachments/assets/61f2a1f8-6926-484d-bcb8-076a9d85e89c ">
2024-11-07 11:39:06 +08:00
Jason Lee
270493f3ce
list: Fix to set_selected_index when List up, down to select item. ( #398 )
2024-11-06 18:44:10 +08:00
Floyd Wang
8c3997d795
divider: Make the size flexible ( #397 )
2024-11-06 17:45:38 +08:00
Jason Lee
3508453b11
theme: Rename Colors to ThemeColor and public it. ( #395 )
2024-11-05 23:02:54 +08:00
Jason Lee
26211000f7
button: Fix Button disabled style. ( #394 )
...
- Fix `lighten`, `darken` method for Hsla.
<img width="619" alt="image"
src="https://github.com/user-attachments/assets/75c64f46-1551-4abf-8521-f0b9c90682d2 ">
<img width="620" alt="image"
src="https://github.com/user-attachments/assets/9f3655ba-1506-4e58-aa20-b17546fbc215 ">
2024-11-05 14:36:05 +08:00
Floyd Wang
852c38f42c
table: Remove the unnecessary left margin from the icon
2024-11-05 11:08:21 +08:00
Jason Lee
c2824eb01e
calendar: Add small, medium, large size support to Calendar. ( #393 )
...
Fix #272
2024-11-04 19:25:30 +08:00
Floyd Wang
1c5d63edb1
table: Remove unnecessary actions that stop bubbling to ensure focused ( #392 )
2024-11-04 17:22:01 +08:00
Jason Lee
ca44ca6311
chore: Update to use WeakView for avoid dependency issue. ( #391 )
2024-11-04 16:36:21 +08:00
xda
19f6b82b61
scrollbar: show the narrower scrollbar in idle state ( #389 )
...

---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-11-04 11:34:57 +08:00
Jason Lee
4b5d917e83
title_bar: Update on_close_window to support binding with cx.listener. ( #388 )
2024-11-01 18:39:25 +08:00
Jason Lee
80230c643f
title_bar: Add on_close_window method callback for TitleBar to custom close window method for Linux. ( #387 )
2024-11-01 17:06:31 +08:00
Floyd Wang
b997eabcba
title_bar: Make the left padding adjustable ( #386 )
2024-11-01 14:20:49 +08:00
Jason Lee
c986a294e4
chore: Add view method to get the child view from Root. ( #385 )
2024-10-31 15:27:45 +08:00
Floyd Wang
2dab196f68
button: Add flex_shrink_0 to the base ( #383 )
...
If you want the button to be flexible, add `flex_shrink`.
2024-10-31 10:35:37 +08:00
Jason Lee
d99c5246ee
Add Default support to DockAreaState.
2024-10-30 17:29:52 +08:00
Jason Lee
fe6566ce2f
table: Export scroll handles. ( #371 )
2024-10-30 14:25:38 +08:00
Jason Lee
292d1a6a9a
theme: Rename title_bar_background to title_bar. ( #382 )
...
Use same name rule as other theme variables.
2024-10-30 14:25:21 +08:00
Jason Lee
0b0fc61c2f
chore: Avoid cx.prevent_default when ListItem or other click ( #381 )
2024-10-29 16:54:08 +08:00
Floyd Wang
db041fea88
table: Add default option to perform_sort ( #379 )
2024-10-24 18:15:12 +08:00
Jason Lee
b7a1292d07
popup_menu: Add popup_menu_with_anchor method to control the Anchor for PopupMenu. ( #378 )
2024-10-24 11:05:13 +08:00
xda
b8c8ddd8f5
resizable: Fix the edge case of initializing Panels with zero initial_size ( #377 )
2024-10-24 00:07:45 +08:00
Jason Lee
53311b06f8
title_bar: Impl Styled to TitleBar. ( #375 )
2024-10-22 14:42:40 +08:00
Floyd Wang
c87b4c7f01
notification: Autohide should not panic when the window is not found ( #374 )
2024-10-22 10:43:00 +08:00
xda
14ca368be7
input: Ensure resizing the window doesn't force the cursor back into view ( #370 )
...
Fix #331
It is ensured that the scroll offset remains consistent during parent
container resizing, preventing the cursor from being forced back into
view unless the user interacts with the input, providing a more
consistent user experience in scenarios where automatic scrolling during
resizing is undesirable.
This behavior aligns with common text editors and input fields where
resizing the window doesn't force the cursor back into view.

2024-10-21 20:01:49 +08:00
Jason Lee
38fc226c22
title_bar: Export TitleBarElement. ( #369 )
2024-10-21 19:23:20 +08:00
Jason Lee
2aaf424df9
title_bar: Fix move window support for Linux. ( #368 )
2024-10-21 15:23:36 +08:00
xda
8dbf1dd5d5
Add the Preset Ranges and add border for today ( #365 )
...
Preset Ranges have been added. The “Today” border has also been added.

---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-10-18 20:38:16 +08:00
Jason Lee
a798bd81c6
chore: Fix typos. ( #364 )
2024-10-18 14:30:24 +08:00
Jason Lee
274b9edc32
table: Fix selected row top, bottom border detail.
2024-10-18 14:13:15 +08:00
Jason Lee
a4260c109f
table, list: Avoid use deferred to show selected row style. ( #363 )
...
<img width="956" alt="image"
src="https://github.com/user-attachments/assets/0f72b556-76bc-4808-bca8-c261411656d1 ">
2024-10-18 13:27:59 +08:00
Jason Lee
4bef681c9a
table, list: Add right clicked row style and improve selection style. ( #362 )
...
- table: Add `content_menu` to TableDelegate.
<img width="644" alt="image"
src="https://github.com/user-attachments/assets/4c21299f-00e8-4a61-964d-338ef7daa802 ">
2024-10-18 11:52:14 +08:00
Jason Lee
c02cb802cb
list: Add cx argument to ListDelegate. ( #361 )
...
Following #360 TableDelegate changes.
2024-10-18 10:17:59 +08:00
julien-leclercq
536bb60900
table: Add cx argument to TableDelegate methods. ( #360 )
...
As discussed in #359 adds a `AppContext` argument to the
`table::TableDelegate::rows_count` method
---------
Co-authored-by: Julien Leclercq <julien-leclercq@users.noreply.github.com>
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-10-18 10:03:32 +08:00
Jason Lee
f35db249a6
theme: Update GPUI and imporve dark color. ( #358 )
...
## Before
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/f4e74cf0-e386-4e91-86d1-05ee75b26471 ">
## After
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/da393ea9-79ee-4535-a46d-68684d7ad738 ">
2024-10-17 19:14:42 +08:00
Jason Lee
6b54396c9c
title_bar: Fix TitleBar prefix padding when is zoomed and support double click to toggle zoom. ( #357 )
2024-10-17 18:22:32 +08:00
xda
913775c632
resizable: Fix the bug for parent groups when initializing Panels with sizes Some and None ( #356 )
...
Optimization of https://github.com/longbridgeapp/gpui-component/pull/329
The issue with the initial width of the Panel has been optimised to
ensure that the left side of a Panel combination like [Some(px(510.)),
None] is initially rendered with a width of 510px.
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-10-17 17:39:00 +08:00
Jason Lee
8eff75d357
accordion: Add Accordion. ( #355 )
...
<img width="920" alt="image"
src="https://github.com/user-attachments/assets/3269aa05-7531-43a1-84a9-469959a68d06 ">
2024-10-17 17:31:59 +08:00
Jason Lee
1fdcff3b51
theme: Add apply_color to theme to support merge a new color into theme color. ( #353 )
...
- Fix #334 to keep selected theme color.
## Example
<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/3a05f58c-2720-436c-8df9-c582871d87d5 ">
<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/5b8db494-1402-4785-8d98-a87173b15284 ">
<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/0305c05b-c2fb-4fea-9a50-5aa00de504fe ">
<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/91fbb7b6-7494-440d-95bf-2de37d6bbb44 ">
2024-10-16 18:38:21 +08:00
Jason Lee
41c64e2912
chore: Update controls detail. ( #352 )
...
- Better icon style in Input, Dropdown, DatePicker.
2024-10-16 17:51:39 +08:00
Floyd Wang
000c0bec57
dropdown: Add set_disabled for &mut self ( #351 )
2024-10-16 17:33:46 +08:00
Jason Lee
fdca75d5a7
title_bar: Add a new TitleBar, remove the old version. ( #348 )
...
- Removed old workspace crate, moved out to
[gpui-workspace](https://github.com/huacnlee/gpui-workspace )
<img width="491" alt="image"
src="https://github.com/user-attachments/assets/5048491c-9b98-4af5-9f0f-9a0f20c2308f ">
Icons for Windows and Linux use by SVG icon, it based on:
-
https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font
- Download Font: [Segoe Fluent
Icons](https://learn.microsoft.com/en-us/windows/apps/design/downloads/#fonts )
2024-10-16 16:22:17 +08:00
xda
51df8f2f04
drawer: support ESC to close it by on_action and call on_close ( #341 )
...
Fix #263

2024-10-15 21:47:45 +08:00
Floyd Wang
9b8240c6bc
table: Improve render_tr to bind the context_menu ( #347 )
...
<img width="559" alt="image"
src="https://github.com/user-attachments/assets/2aecfa35-5ee1-45cb-a3f3-2409bd09efd7 ">
2024-10-15 21:35:17 +08:00
Jason Lee
6a5fff889e
dock: Disallow move panel when it is zoomed in. ( #346 )
...
Closes #342
2024-10-15 14:52:40 +08:00
Jason Lee
3041d0020f
webview: Update wry. ( #343 )
...
To match Wry recently API changes.
Ref: https://github.com/tauri-apps/wry/pull/1385
2024-10-14 22:19:35 +08:00
Jason Lee
b18207728b
dropdown: Use difference chevron icon color for enabled/disabled dropdown. ( #336 )
...
<img width="547" alt="image"
src="https://github.com/user-attachments/assets/07239a63-b1ae-4462-b8ba-d30d7e7e66f5 ">
2024-10-14 10:19:58 +08:00
Jason Lee
5fd2ebf522
panel: Always not show active tab style, when the dock is collapsed. ( #335 )
...
## Before
<img width="249" alt="image"
src="https://github.com/user-attachments/assets/2dfee593-1a07-4b75-913b-d2e17decb67a ">
## After
<img width="271" alt="image"
src="https://github.com/user-attachments/assets/20752d04-1f25-498c-8e6e-4ff0f21401bf ">
2024-10-14 10:06:20 +08:00
xda
5c8d0d7eb4
scrollbar: Do not show scrollbar event mouse is in Element rect, only show when hovered on scrollbar area or scrolled ( #333 )
...
Let the scrollbar only display when hovering and scrolling. The effect
comparison is on the left GPUI and on the right mac. I guess they used
the 10th power ease-in function, and the effect is similar.
Fixes https://github.com/huacnlee/gpui-component/issues/260

2024-10-13 10:53:53 +08:00
Jason Lee
5f1b68a431
menu: Add menu_with_element to add a custom render item. ( #330 )
...
<img width="230" alt="image"
src="https://github.com/user-attachments/assets/e12dbde4-c02e-4445-b8ff-5bf0b54c7aac ">
2024-10-10 20:22:25 +08:00
xda
2706656e27
resizable: Keep the ratio when adjust widths (rather than falling back to 33.33% when resizing back) ( #329 )
...
The essence of the problem is that flex_basis initial_size and
flex_basis size are in conflict: the size overwrites the initial_size
percentage and loses the original percentage in extremely narrow parent
groups, so we have to add the field to the state persisting the desired
percentage.
Fix #262

2024-10-10 18:50:46 +08:00
Jason Lee
efa044f417
menu: Fix Menu scrollbar will always showing bug. ( #328 )
...
- Improved Scrollbar size.
2024-10-10 18:10:28 +08:00
Jason Lee
5915618928
dock: Fix zoom support for side dock panel. ( #327 )
...
- Fix emit `PanelEvent::LayoutChanged` when panel resized.
2024-10-10 15:16:16 +08:00
Jason Lee
2198134832
Add col_padding to Table delegate to control the column padding. ( #326 )
...
<img width="775" alt="image"
src="https://github.com/user-attachments/assets/a7189c06-9945-4508-86fb-e71fd819cc41 ">
2024-10-10 13:58:49 +08:00
Jason Lee
fd09229541
story: Fix invalid focus code cause PopupStory Input cannot input anything. ( #325 )
...
Closes #324
When we create a Wry WebView, it will take the focus into the WebView.
So we must care to use it, make sure no WebView create if there no need
to display.
> The `ui::WebView` has implemented when we click out of the WebView to
move focus back to the main window.
>
> But by my test, first render it not work will because the Render is
not trigger so the click out event not listened.
Currently change just removed WebViewStory from the demo.
2024-10-09 15:08:18 +08:00
Jason Lee
0220cf8cc6
dock: Add version to DockArea to allow us check the persisted state is need to update. ( #323 )
2024-10-08 20:46:12 +08:00
Jason Lee
45d4b445ec
panel: Toggle to zoom out when close a panel. ( #322 )
2024-10-08 18:09:41 +08:00
Jason Lee
4fd233ae6b
webview: Invoke blur on call hide method for WebView and update example. ( #321 )
2024-10-08 18:09:25 +08:00
Jason Lee
33200aa685
webview: Blur WebView when clicked out to fix IME cannot input bug. ( #320 )
...
- Closes #316
- Ref https://github.com/tauri-apps/wry/pull/1385
## Before
https://github.com/user-attachments/assets/cc614334-47fe-4722-8745-aea783fbab4a
## After
On macOS, now the IME bug is gone.
https://github.com/user-attachments/assets/363bb016-229f-4766-84f7-6a4838e490bf
https://github.com/user-attachments/assets/320c5c1c-cfac-4165-af8a-bc9708952460
2024-10-08 17:01:52 +08:00
Jason Lee
007288487e
table: Fix horzizontal scrollbar size when there have fixed cols. ( #317 )
2024-10-07 21:47:26 +08:00
Jason Lee
e1e66e8f07
dock: Fix toggle button check will stack overflow bug. ( #312 )
...
Continue #297 #309
```
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
[1] 45068 abort cargo run
```
2024-10-04 15:00:00 +08:00
Jason Lee
3df75566b3
table: Fix to render table vertical scrollbar under the head. ( #311 )
...
Closes #308 , #305
<img width="819" alt="image"
src="https://github.com/user-attachments/assets/e22d7ae7-2dfd-4357-be0e-3b94434b1020 ">
2024-10-04 14:35:36 +08:00
Jason Lee
cbed7b1ea1
menu: Add scrollable support to menu. ( #310 )
...
<img width="274" alt="image"
src="https://github.com/user-attachments/assets/eaff16a6-1294-4381-96c0-c178c195999b ">
2024-10-04 14:24:05 +08:00
Jason Lee
cf88a48bec
dock: Fix toggle dock button display when have nested panels. ( #309 )
2024-10-04 14:22:24 +08:00
Jason Lee
185eca6c67
scrollbar: Update GPUI and fix scrollbar with new API. ( #307 )
...
The https://github.com/zed-industries/zed/pull/18513 has been changed
the `UniformListScrollHandle` API, it provided the scroll contents size,
so we not need calculate it again.
2024-10-04 10:23:11 +08:00
Jason Lee
9a64bc43d9
tooltip: Fix Tooltip text line-height. ( #304 )
...
<img width="247" alt="image"
src="https://github.com/user-attachments/assets/483d6fed-2494-432a-81c3-59a2c220df9d ">
2024-10-03 18:01:56 +08:00
Jason Lee
ca5a0e02d5
dock: Add to support save left, right, bottom dock state. ( #303 )
...
The dock state have been updated to use `DockAreaState`.
2024-10-03 17:25:31 +08:00
Jason Lee
19bb5eee3a
Fix clippy warnings and fix CI to fail when have warnings. ( #301 )
2024-10-03 10:46:02 +08:00
Jason Lee
ce10a0340c
table: Set fixed height to table head to fix some case table head disappear bug. ( #300 )
...
Closes #299
- Improved sort icon to better color.
- Improved table story.
- Disable `horizontal_scroll_handle.scroll_to_item` on select_col, there
have a bug need to fix.
2024-10-03 10:14:44 +08:00
Jason Lee
494e6d15f3
dock: Fix incorrect toggle button shown, when there is not have left or right dock. ( #297 )
2024-10-02 23:00:26 +08:00
Jason Lee
fecb2170a8
table: Fix table sort icon display. ( #296 )
...
- Update first sort behaviour to `descending`.
2024-10-02 22:31:38 +08:00
Jason Lee
13e42dfac3
table: Add to support fixed column on left to Table. ( #295 )
...
- Update table details, fix table head height.
- Add `table_row_border` theme color and use this for row border.
## Demo
https://github.com/user-attachments/assets/91df4b9d-f079-4ddb-b14d-fbcf303dcc44
Fix #292
2024-10-02 22:02:21 +08:00
Jason Lee
33e5fdcb78
scrollbar: Smaller the scrollbar size. ( #294 )
...
<img width="918" alt="image"
src="https://github.com/user-attachments/assets/787766ab-63eb-4568-972b-5abd668511f7 ">
2024-10-02 18:15:53 +08:00
Jason Lee
6f1be83b6e
dock: Add left, bottom, right fixed dock and support toggle. ( #291 )
...
- Improve TabPanel to support control closable.
## Demo
https://github.com/user-attachments/assets/dcf8cde3-61ee-42f6-be93-76f10fc8cf34
2024-10-02 17:42:52 +08:00
ihavecoke
20b9f9c0f2
input: Move caret to line start or end with selected content ( #288 )
...
Ref: https://support.apple.com/en-hk/102650
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-10-02 17:35:27 +08:00
ihavecoke
b9e7217662
table: Add refresh method to Table, for reload table use when the columns or rows has been updated. ( #293 )
2024-10-02 17:29:50 +08:00
Jason Lee
7de1c6981e
windows: Fix keybinding display on Windows. ( #289 )
...
<img width="191" alt="image"
src="https://github.com/user-attachments/assets/7cc4d80f-5759-4432-9a13-6fd027af4b27 ">
2024-09-29 23:07:45 +08:00
xda
e43cc48465
Deduplicate Switch animations ( #287 )
2024-09-29 20:21:56 +08:00
Jason Lee
baa45173d1
button: Fix Button text to align vertical center. ( #286 )
...
<img width="1188" alt="image"
src="https://github.com/user-attachments/assets/084727c3-5822-4325-9bbf-374b357b670f ">
The point is add `.font_family(".SystemUIFont")` to root view.
2024-09-27 20:44:23 +08:00
Jason Lee
2b134e47a1
button: Reduce gap between icon and label for small, xsmall button. ( #285 )
2024-09-27 20:28:57 +08:00
Jason Lee
69e94cce1c
table: Add size to Table to support Large, Medium(default), Small, XSmall. ( #283 )
...
Closes #219
2024-09-27 14:45:52 +08:00
Floyd Wang
c5b4505560
feat(button): Remove track_focus ( #282 )
2024-09-27 14:39:48 +08:00
Floyd Wang
2c1119a7bd
feat(button): Support customize loading icon ( #281 )
2024-09-27 13:56:04 +08:00
Jason Lee
76be7a8ed8
table: Add horizontal scrollbar to Table. ( #278 )
2024-09-27 13:48:46 +08:00
Floyd Wang
708e373ab6
feat(indicator): Update icon type ( #280 )
2024-09-27 11:58:14 +08:00
Jason Lee
e1bf3556a9
menu: Blocking mouse move event to back view, when PopupMenu has open. ( #277 )
...
Closes #275
https://github.com/user-attachments/assets/7061fd93-10dd-4645-8080-ec7dbb65a80e
2024-09-26 21:38:52 +08:00
Jason Lee
709c706adf
menu: Improve Menu to avoid invalid or duplicate separators. ( #276 )
2024-09-26 21:28:42 +08:00
Floyd Wang
d2f26795eb
feat(list_item): Add stop_propagation/prevent_default when trigger click event ( #273 )
2024-09-26 11:55:02 +08:00
Jason Lee
098315ee92
button: Reduce px for compact small button. ( #271 )
...
<img width="882" alt="image"
src="https://github.com/user-attachments/assets/c41955ea-5126-4d1a-b2dd-dea2e4b89c9e ">
2024-09-25 21:48:44 +08:00
Jason Lee
2d6f478512
dock: Add zoomable support to Panel. ( #269 )
2024-09-24 22:37:29 +08:00
xda
1e44b5659f
table: Render table stripe on background even there is no enough rows ( #256 )
...
<img width="1202" alt="image"
src="https://github.com/user-attachments/assets/57a744c3-673a-4118-ba97-03837b0b9390 ">
- And add `flex_shrink_0` to table head.
Fix https://github.com/huacnlee/gpui-component/issues/160
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-09-24 22:07:27 +08:00
Jason Lee
2a331fcb79
theme: Add shadow option to support toggle shadow for base controls, default: true. ( #268 )
...
- Add shadow to Button if it enabled.
2024-09-24 10:52:01 +08:00
Jason Lee
3fc0b70639
dock: Keep invalid panel state info avoid missing the state. ( #267 )
...
Fix #257
2024-09-23 22:43:02 +08:00
Jason Lee
dc3dc4a9ec
table: Avoid Table handle mouse wheel event, when it is blocked by some other element like Modal. ( #261 )
2024-09-23 14:32:16 +08:00
xda
89414e1c3c
table: Toggle stripe and number of rows in Table Story ( #259 )
...

2024-09-23 11:58:16 +08:00
ihavecoke
2da13499e5
list: Add render_initial support to List. ( #258 )
...
Add a method to the List component to render the initial state. When
input is empty, you may need to render a special interface to the user.
This method can be called at this point
### Showcase
https://github.com/user-attachments/assets/39c61bfe-4451-43f9-b0d9-8f941ebd94dd
2024-09-21 01:53:32 +08:00
Floyd Wang
f20f573dbc
notification: Fix when multiple notifications pop up at the same time, autohide not work ( #255 )
2024-09-19 17:33:49 +08:00
Jason Lee
20926b7077
popover: Fix PopoverContent content build to use ViewContext<Self>. ( #254 )
...
And add popover self dismiss example.
## How to dismiss popover from inside.
```rs
cx.emit(DismissEvent);
```
2024-09-19 10:54:04 +08:00
Jason Lee
08a160e543
button: Apply disable color to ButtonStyleCustom.
2024-09-17 21:15:48 +08:00
Jason Lee
d641c219a1
button: Use primary or danger color for the disable background. ( #252 )
...
<img width="1624" alt="image"
src="https://github.com/user-attachments/assets/61162ba5-9188-4cad-a154-2584abd0fd31 ">
Fix #251
2024-09-17 21:01:06 +08:00
Jason Lee
8f0ba2e5c3
modal: Only focus modal when it not focused on. ( #250 )
...
- Fix dropdown to mouse down out to dismiss.
https://github.com/user-attachments/assets/f5ab4aca-bfdc-460e-ae5a-cd0a31a30906
2024-09-17 18:48:06 +08:00
Jason Lee
97e61a507b
otp_input: Fix OtpInput to stop_propagation on keydown. ( #249 )
2024-09-17 10:55:09 +08:00
Floyd Wang
90c5125abc
Reduce popover border radius ( #248 )
2024-09-17 10:26:47 +08:00
Jason Lee
f77993082d
input: Update Input selection behavior to like OS input. ( #247 )
...
Revert old implementation
- https://github.com/huacnlee/gpui-component/pull/26
- https://github.com/zed-industries/zed/pull/14340
## Before
https://github.com/user-attachments/assets/52ce2e3a-3e1d-4ba2-af42-76b1df987404
## After
https://github.com/user-attachments/assets/9aa8cfe1-5928-4d20-b534-806140c7ee59
## The Input in the Browser
https://github.com/user-attachments/assets/c913248e-b1dc-46d6-a517-e1231e606171
2024-09-17 09:58:07 +08:00
Jason Lee
0e16d742bb
list: Add set_size method to List and fix input size in small dropdown. ( #246 )
2024-09-16 19:57:49 +08:00
Jason Lee
75b4f34b92
Try fix Button, Checkbox, Radio text line-height ( #240 )
...
<img width="1202" alt="屏幕截图 2024-09-12 224306"
src="https://github.com/user-attachments/assets/b96fee5e-6d39-4ba0-829c-3eaf4aed8ff2 ">
2024-09-16 10:36:18 +08:00
Jason Lee
d33b4b2ea0
dock: Fix panel zoom when it split and added to other StackPanel. ( #245 )
2024-09-16 10:18:04 +08:00
Jason Lee
55585f9699
windows: Fix button and checkbox line-height again. ( #244 )
...
<img width="1202"
src="https://github.com/user-attachments/assets/6741041a-f449-4600-bec1-751841dcec88 ">
2024-09-13 22:55:59 +08:00
Floyd Wang
d8ace3c683
clipboard: Refactor with Element ( #242 )
2024-09-13 13:53:39 +08:00
Jason Lee
a8d4abea69
button: Improve ButtonGroup to add style, size methods. ( #241 )
...
- Add `ButtonStyled` trait to apply the style for Button and
ButtonGroup.
2024-09-13 12:00:47 +08:00
xda
b83ece3cd8
Add ToggleButton (as part of ButtonGroup) ( #239 )
...

---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-09-13 11:58:10 +08:00
Jason Lee
ce87c3a001
modal: Improve Modal and Panel focus handle. ( #238 )
...
- modal: Improve modal focus take, when modal close, make sure focus
back.
- modal: Fix hover close button will cross to back modal on multiple
modal layer.
- panel: Add focus handle to Panel and TabPanel.
- panel: Update title method to return `AnyElement`.
2024-09-12 19:51:33 +08:00
Floyd Wang
9388b88f59
theme: Simplify init ( #237 )
2024-09-12 16:14:41 +08:00
Jason Lee
cf551654fe
scrollbar: Fix Scrollbar inset and remove bar border. ( #236 )
...
<img width="920" alt="image"
src="https://github.com/user-attachments/assets/f834a920-8f89-4be8-9100-d2b5e4364449 ">
2024-09-11 11:59:37 +08:00
Jason Lee
77cb8cb448
button: Hotfix Button to valign text center. ( #235 )
...
<img width="1336" alt="image"
src="https://github.com/user-attachments/assets/64029ab3-6447-47b1-a40c-f1e6668172b7 ">
2024-09-11 11:39:17 +08:00
xda
4f8c4ccd5d
scrollbar: Keep the original thumb position when mouse down to dragging ( #234 )
...

fix #224
2024-09-11 09:37:07 +08:00
Jason Lee
fbbb985e84
ui: Improve UI details (Modal, Checkbox, Radio and MenuItem) ( #233 )
...
- modal: Reduce modal title line height.
- checkbox, radio: Fix label line height to align with checkbox.
- menu: Update Menu item style, height to 28px, and fix divider padding.
<img width="523" alt="image"
src="https://github.com/user-attachments/assets/c254dc07-9d37-4885-b687-58ec4d8e95a4 ">
<img width="453" alt="image"
src="https://github.com/user-attachments/assets/3ad44419-1953-4048-8173-4d8c0646777a ">
<img width="369" alt="image"
src="https://github.com/user-attachments/assets/84d23eb2-15f9-47d7-b6d4-15295ab3a544 ">
2024-09-10 19:42:54 +08:00
Jason Lee
a0d3d35be4
modal: Add to support open multiple Modals. ( #232 )
...
- Add `Esc` to close modal.
2024-09-10 16:58:22 +08:00
ihavecoke
303dd51047
Use small size for calendar month item to fixed content overflow ( #231 )
2024-09-10 00:16:31 +08:00
Jason Lee
74abc339b7
Fix bugs ( #230 )
...
- Fix color picker hover preview color to shrink_0.
- Fix Divider display.
2024-09-09 22:05:02 +08:00
Jason Lee
840a54850a
Update register_panel to use trait object Fn. ( #229 )
2024-09-09 19:19:27 +08:00
Jason Lee
d6d00f59a2
Add dump default impl for Panel trait.
2024-09-09 14:38:52 +08:00
Jason Lee
33f0291f6d
Improve layout save details for example app.
2024-09-09 14:03:51 +08:00
Jason Lee
bf134b2ff9
Add to support dump/load Dock layout. ( #226 )
2024-09-09 13:30:22 +08:00
Jason Lee
821487bed5
Improve popup snap to window with margin. ( #225 )
...
- Also update GPUI.
Ref: https://github.com/zed-industries/zed/pull/17159
<img width="866" alt="image"
src="https://github.com/user-attachments/assets/0737e4e4-7069-4554-a766-b9fc7b487fd6 ">
2024-09-07 11:50:38 +08:00
Jason Lee
b6374313b2
Fix DockItem::tabs, the items should use trait object to support difference type.
2024-09-06 18:04:26 +08:00
Jason Lee
9baada4fb4
dock: Reduce dock item member ( #223 )
2024-09-06 17:51:21 +08:00
xda
83aecf1293
Add ButtonGroup ( #221 )
...
<img width="849" alt="image"
src="https://github.com/user-attachments/assets/5f809b40-9d4c-4934-828d-98f77a3f4b29 ">
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-09-06 10:32:10 +08:00
Jason Lee
adf6f70185
dock: Define a better way to init Dock layout. ( #218 )
2024-09-05 19:33:32 +08:00
Floyd Wang
d6015f636c
panel: Support custom style for the panel title ( #220 )
2024-09-05 11:36:59 +08:00
Jason Lee
e1d6b3aaed
dock: Improve drop target style and size to 35%. ( #217 )
2024-09-04 22:01:09 +08:00
ihavecoke
d996144713
date_picker: Add range_mode method to DatePicker to set as range mode. ( #216 )
...
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-09-04 21:41:01 +08:00
Jason Lee
2c469da55a
Update GPUI and apply opacity feature. ( #215 )
2024-09-04 19:29:51 +08:00
Jason Lee
9e67525650
Fix mistake.
2024-09-04 19:00:50 +08:00
Jason Lee
f2d75f7abd
dock: Fix split_panel to use async. ( #214 )
2024-09-04 17:30:55 +08:00
Jason Lee
476f97d5e0
scrollbar: Opacity scrollbar when not hover on it. ( #213 )
...
https://github.com/user-attachments/assets/ea070e6f-3d4c-4a0d-b6da-be34e7dfc579
2024-09-04 16:48:49 +08:00
Jason Lee
f6b4e5a591
dock: Fix add_panel with placement to split size. ( #212 )
...
https://github.com/user-attachments/assets/7177bd8f-5b19-4959-8d60-cae583173e73
2024-09-04 00:35:51 +08:00
ihavecoke
acabaf32c8
Correcting shacn to shadcn to uniformly use shadcn ui names ( #210 )
...
* Fixed some color naming with shadcn style
* Input story support scroll y
2024-09-03 23:31:34 +08:00
Jason Lee
0158083599
dock: Fix panel zoom sometimes is not work. #197 ( #211 )
...
This is because the `PanelEvent::ZoomIn` is called 2 times when we click
the menu (I don't why, not found the source).
So just split Zoom in, Zoom out as two difference methods to avoid this.
2024-09-03 23:15:44 +08:00
Jason Lee
0834ac0394
dock: Fix panel that can not auto resize when it have initial size. ( #209 )
...
https://github.com/user-attachments/assets/8605b82e-6113-41d1-a9c4-0ba7d55968ba
2024-09-03 21:39:03 +08:00