Commit graph

377 commits

Author SHA1 Message Date
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
45b7450b5c
story: Fix modal story button style. (#306)
<img width="606" alt="image"
src="https://github.com/user-attachments/assets/685299d3-5a29-4444-9b0d-14947ecf8a26">

Fix #305
2024-10-04 09:40:56 +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
Jason Lee
7a8eaefd30
story: Add very complex table data update example to test performance. (#274)
The example that used: 6000 rows x 60 cols, and refresh data every
100ms.

The CPU usage: 40% (macOS M4)


https://github.com/user-attachments/assets/40d6c64f-c658-4c7a-9251-fb76e17ec543
2024-09-26 19:40:07 +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 12 55
56](https://github.com/user-attachments/assets/58bae51f-135e-487b-a841-798b8e951fdb)
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
9fc7b29f23
Upgrade GPUI (#253) 2024-09-18 14:27:47 +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