Commit graph

329 commits

Author SHA1 Message Date
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 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
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)
![2024-09-12 19 20
46](https://github.com/user-attachments/assets/4cf9b374-2d3b-4f36-9fc7-cd6dbd1f861c)

---------

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)
![2024-09-10 23 18
50](https://github.com/user-attachments/assets/58c480a3-9c92-4c7c-8e7a-b37c2ffc3526)

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