Commit graph

617 commits

Author SHA1 Message Date
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 19 35
17](https://github.com/user-attachments/assets/3d06954d-8589-4e12-8c0e-897b0b38cbc5)
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
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
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
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
728be16a39 Fix windows dependency only on Windows. 2024-09-09 22:40:54 +08:00
Jason Lee
9bc4887d55 Update dependencies. 2024-09-09 22:33:41 +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
Sunli
ac83fad692
windows: Set the default stack size to 8M on Windows. (#228) 2024-09-09 13:51:10 +08:00
Jason Lee
16396d3583 Revert "Set the stack size of the main thread to 8M (#227)" is not work on macOS.
This reverts commit 2f80ba408a.
2024-09-09 13:34:31 +08:00
Jason Lee
bf134b2ff9
Add to support dump/load Dock layout. (#226) 2024-09-09 13:30:22 +08:00
Sunli
2f80ba408a
Set the stack size of the main thread to 8M (#227)
For fix stack overflow issue on Windows.
2024-09-09 10:24:41 +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
Jason Lee
e318a9d8dc
doc: Fix TabPanel popup menu can't dispatch action to TabContent. (#208)
Co-authored-by: Floyd Wang <gassnake999@gmail.com>
2024-09-03 19:51:35 +08:00
Jason Lee
5e86c9cfa0
dock: Revert first argument for TabPanel::new (#207) 2024-09-03 14:04:00 +08:00
Jason Lee
73e82c785a
dock: Improve set_parent in StackPanel insert_panel to use defer instead of spawn (#205) 2024-09-03 11:18:57 +08:00
Jason Lee
8ece86cd0c
dock: Add id to DockArea and improve DockArea init. (#204)
- Export add_panel_at method for TabPanel to split_panel.
- Fix resizeable_panel init size support.
- Fix panel resize to let panel that have initial size will not auto resize on window resize.
- Fix resize_handle sometimes will invisibly bug.
- Update TabPanel new to support give parent StackPanel.
2024-09-02 21:27:19 +08:00
Jason Lee
f611b599aa
dropdown: Fix Dropdown placeholder to support change locale. (#203) 2024-09-02 14:57:53 +08:00
Jason Lee
af09525c1e
dock: Add popup_menu delegate to custom panel menu. (#202) 2024-09-02 14:55:37 +08:00
Jason Lee
f5cae46e42
Improve ColorPicker to support input hex color. (#201)
https://github.com/user-attachments/assets/be5fc290-0464-4356-9f97-c35720e3e11d
2024-09-02 13:56:19 +08:00
Jason Lee
a049f606c0
Fix Checkbox, Radio label color. (#200) 2024-09-02 00:24:57 +08:00
Jason Lee
1f0e52da50
Add ColorPicker (#199)
<img width="262" alt="image"
src="https://github.com/user-attachments/assets/ad96859f-e6cb-47a6-bedb-fef02122b711">
2024-09-02 00:21:01 +08:00
Jason Lee
926de77967
Fix tooltip padding. (#198) 2024-09-01 21:58:50 +08:00
Jason Lee
6564c502c9
Add close menu to Panel. (#196) 2024-09-01 21:33:50 +08:00
Jason Lee
9c4411ff2b
date_picker: Reduce DatePicker popup position. (#195) 2024-09-01 00:36:51 +08:00
Jason Lee
169572fa74
tab: Improve TabBar border to let active item can override it. (#194) 2024-09-01 00:31:14 +08:00
Jason Lee
3d8e7a9e54
Update GPUI and fix Input API changes. (#193) 2024-08-31 23:17:14 +08:00
Floyd Wang
ef49753d32
Improve dropdown disabled state (#192) 2024-08-30 15:26:56 +08:00
Jason Lee
0da882349f
Add exit animation to Notification.
- Add `cubic_bezier` method and change modal to use this.

Ref #148 

https://github.com/user-attachments/assets/c09adc18-554c-4300-8109-98f3ab183910
2024-08-30 11:24:55 +08:00
Floyd Wang
14af8998bf
Add disabled state for the dropdown (#190) 2024-08-30 09:56:12 +08:00
ihavecoke
fd2f5e46f2
Securely handle table load more subtract logic to prevent attempt to subtract with overflow panic (#189) 2024-08-29 23:29:26 +08:00
Floyd Wang
b6ce44c349
Support press esc to close popover (#188) 2024-08-29 18:07:26 +08:00
Floyd Wang
311abe07fe
Reduce Popover pop-up margin (#187) 2024-08-29 16:19:29 +08:00
Floyd Wang
7286866afd
Reduce PopoverContent padding (#186) 2024-08-29 11:35:38 +08:00
Jason Lee
f7f3fcedf3
slider: Improved bar and thumb position. (#185) 2024-08-29 10:36:47 +08:00
Jason Lee
9768755eab
Fix panel resize when window resized. (#181)
Co-authored-by: Floyd Wang <gassnake999@gmail.com>
2024-08-28 19:40:35 +08:00
Jason Lee
237b0f6956
table: Add load_more delegate method and called when scrolled near the bottom. (#183)
https://github.com/user-attachments/assets/03001a21-6a3d-4c06-a00c-9dea8208e357
2024-08-28 15:12:42 +08:00
ihavecoke
a5217df13e
Popover content supports setting the maximum width (#180)
Before:

![image](https://github.com/user-attachments/assets/cde8dc35-f59d-474c-8386-b6f666e83249)

After:

![image](https://github.com/user-attachments/assets/d5db1bed-5c2d-4efd-81e4-a0d13e48b035)
2024-08-27 22:08:50 +08:00
Jason Lee
7b5efd19bb
Better Panel resize. (#178)
- Resize panels when windows is resize to smaller #175.

https://github.com/user-attachments/assets/b2c50949-7310-4d3d-8276-5bf15cf3ba9f
2024-08-27 18:38:37 +08:00
Jason Lee
ad5e480e63
Fix input history (#179) 2024-08-27 13:52:19 +08:00
Jason Lee
1dbf809e99
Improved Notification to manage autohide on list. (#177) 2024-08-24 00:26:16 +08:00
Jason Lee
409f597100
Fix resizeable panel sometime will not fill parent. (#176)
<img width="1202" alt="image"
src="https://github.com/user-attachments/assets/dbffde88-fc1d-409b-8795-15c405cc4ce9">
2024-08-23 22:15:52 +08:00
Jason Lee
5533a8b72c
Fix drawer position (#174) 2024-08-23 22:01:52 +08:00
Jason Lee
72b8290945
Upgrade GPUI. (#173) 2024-08-23 18:43:26 +08:00
Jason Lee
c5c8e46ac7
New Dock (#172)
https://github.com/user-attachments/assets/c8c55faa-8f17-4fa2-9f62-5fdd598087ef

- [x] Move to insert panel to tabs middle.
- [x] Zoom panel
- [x] Tab popup menu (Close Panel, Split, Zoom in/Zoom out)
- [x] TabBar scrollable
- [ ] TabBar nav history
2024-08-23 18:01:29 +08:00
Floyd Wang
7e9d79ca1b
Improve the loading button (#170)
* Set the background opacity when loading
* Do not trigger the on click event when loading
2024-08-21 10:57:41 +08:00
王恒
36354cc5e4
Set cursor width to an integer to prevent width fluctuation on low PPI devices. (#169)
Before


https://github.com/user-attachments/assets/38ceac8e-c98d-43c7-844b-0a2fb7d416a5

After


https://github.com/user-attachments/assets/e3f9c70e-773e-4606-ad6a-021b0e7fd7c9
2024-08-19 16:37:40 +08:00
Jason Lee
7a00e8a68e
Add search to List example. (#168)
- Fix drawer, modal open to focus on first input.
2024-08-19 16:13:14 +08:00
Jason Lee
b3bee1db3a
Improved id for Switch. (#167) 2024-08-19 15:53:38 +08:00
Jason Lee
f05d2ebbd2
popup_menu: Add submenu support. (#165)
- Add submenu support.
- Removed Popover `window` mode, this is not a good design.


https://github.com/user-attachments/assets/0e3735f4-2bfb-459f-a24d-e3440e738d4f
2024-08-19 14:58:28 +08:00
Jason Lee
fd837565c4
Add KeyBinding to MenuItem. (#164)
<img width="370" alt="image"
src="https://github.com/user-attachments/assets/a0e98260-75ac-4a79-bf24-80d2c82f9507">
2024-08-16 18:57:43 +08:00
Jason Lee
46ff43ff36
Extract History to a common design to support more cases. (#162)
Ref https://github.com/huacnlee/gpui-component/issues/161

For example: Used to do Back/Forward
2024-08-16 17:04:11 +08:00
Jason Lee
4490618c4a
Update table to support to support toggle col selection. (#159)
- Add `border` method to enable/disable border, default: `true`.
- Update `stripe` default to false.
- Update theme to remove table head color, just use window bg like.

<img width="1263" alt="image"
src="https://github.com/user-attachments/assets/2e0994a9-7172-4812-a0e2-3b3ba4281112">

Closes #155
2024-08-16 14:34:53 +08:00
Jason Lee
a79d1a3dc2
Fix scrollbar to default to invisible on first render. #146 (#158) 2024-08-16 14:07:59 +08:00
Jason Lee
e86f90d309
Close Dropdown menu on blur. (#157)
Closes #156
2024-08-16 14:03:45 +08:00
Jason Lee
b3f62bf096
Export with_type and impl FluentBuilder for Notification. (#154) 2024-08-15 19:52:37 +08:00
Jason Lee
57dab4d15a
Rename with_id, with_type_id to id, type_id. (#153) 2024-08-15 18:05:07 +08:00
Floyd Wang
a02a6ed6b8
Set default true for cleanable & trigger event when dropdown clean (#152) 2024-08-15 18:01:43 +08:00
Jason Lee
36475bac76
Add with_type_id to support set a struct as a Notification unique id. (#151) 2024-08-15 18:01:32 +08:00
Jason Lee
981d1391e6
Update Root API (#150) 2024-08-15 17:27:34 +08:00
Jason Lee
c9763224c2
Add Notification (#149)
https://github.com/user-attachments/assets/8a10bff7-f669-471e-8516-2a64ae95ae0a
2024-08-15 16:50:33 +08:00
Jason Lee
6d86e64846
Update modal demo to focus input on open. (#147) 2024-08-15 09:45:58 +08:00
Jason Lee
a36e3e09d5
Focus back last focus handle when modal, drawer closed. (#145) 2024-08-14 18:14:59 +08:00
Floyd Wang
c9a1bba3c2
Fix the disabled style of ghost button (#144) 2024-08-14 17:44:00 +08:00
Jason Lee
3550b1ee13
Add slide down animation t Modal. (#141)
- Export cx.active_modal and cx.active_drawer
- Add support custom modal style, and add show_close option.
2024-08-14 17:23:39 +08:00
Floyd Wang
1da82c5453
Do not show the scrollbar when table is empty (#143) 2024-08-14 11:13:42 +08:00
Floyd Wang
ccad5cd98e
TableDelegate support render_empty (#142) 2024-08-14 11:01:57 +08:00
Jason Lee
70bc526fbb
Fix Dropdown and DatePicker anchor to snap to window. (#139)
<img width="786" alt="image"
src="https://github.com/user-attachments/assets/c40fab1d-2cbe-4750-b05e-ed42cb43dd3c">
2024-08-13 18:10:30 +08:00
Jason Lee
b934ff76e6
Add Modal (#138)
https://github.com/user-attachments/assets/f4c2f9dd-2508-4251-a861-1af3af7542a3
2024-08-13 17:41:12 +08:00
Jason Lee
63f333d8ad
Add Drawer (#137)
- Update scrollable to accept EntityId.

https://github.com/user-attachments/assets/a6c02890-3a6e-4b82-b5c5-3f0a48f35368
2024-08-13 16:01:52 +08:00
Jason Lee
7059165fa6
datepicker: Fix calender popup background. (#136)
Closes #135
2024-08-12 18:52:58 +08:00
Jason Lee
7d309acd2f
Improve Table head to not show selected bg and remove drag border color. (#134)
https://github.com/user-attachments/assets/0836014d-9240-4e77-9daf-dd1ef8d81cd5
2024-08-11 21:25:41 +08:00
Jason Lee
b301c5b8fe
Optimize and simplify the BlinkCursor. (#133) 2024-08-11 21:12:29 +08:00
Jason Lee
bb6d8d8f60
Cleanup first version impls (#132) 2024-08-11 14:46:55 +08:00
Jason Lee
8f71b807aa
Add Animate (#130) 2024-08-09 18:22:06 +08:00
Floyd Wang
283b319edd
Input add set_placeholder method (#131) 2024-08-09 17:24:29 +08:00
Floyd Wang
e073b60bc1 Fix the issue of repeatedly setting the input background color (#129) 2024-08-09 16:09:22 +08:00
Jason Lee
ebf8a7f6f3
Add Skeleton (#128)
https://github.com/user-attachments/assets/deb57e8d-f894-41b6-b44b-cc2b4a307429
2024-08-09 15:55:48 +08:00
Floyd Wang
eb53016d71
Use ViewContext<Self> instead of WindowContext for input affix (#126) 2024-08-09 11:37:13 +08:00
Jason Lee
2b4ed4f8f6
Improve Tooltip style details. (#125) 2024-08-09 10:36:54 +08:00
Jason Lee
97dd09fbda
Fix to display correct days in calendar view. (#124)
<img width="624" alt="image"
src="https://github.com/user-attachments/assets/3e6528a0-d649-42a9-9c82-f1e06539ec46">
<img width="617" alt="image"
src="https://github.com/user-attachments/assets/370dfa05-e8b1-4aa6-8eda-070d6f4a2661">
2024-08-09 10:16:31 +08:00
Jason Lee
5d55c5c31e
Add DateRangePicker (#123)
https://github.com/user-attachments/assets/cc934401-78c5-42d6-afc8-a365fea2129b
2024-08-08 23:29:54 +08:00
Jason Lee
2c531fa3ef
Add text style to Button with no padding. (#122) 2024-08-08 20:13:52 +08:00
Jason Lee
966ce4c2dd
Add link, link_with_icon to PopupMenu, and remove track_focus. (#121)
- Add `popup_menu` quick API to Button to let easy to use.
2024-08-08 19:50:10 +08:00
Jason Lee
27d094c590
datepicker: Add Year, Month select mode. (#119)
https://github.com/user-attachments/assets/b6232d8e-0832-449d-a982-49e015232cfa
2024-08-07 23:09:42 +08:00
Jason Lee
ebdcf244e2
Add Calendar and DatePicker. (#117)
https://github.com/user-attachments/assets/dda87fa7-f080-418a-8dd7-ab8581eb3beb
2024-08-07 20:25:11 +08:00
Floyd Wang
e07f551317
Fix the issue where large sections of label do not wrap (#118) 2024-08-07 19:38:48 +08:00
Jason Lee
340c5fef3d
Improve OtpInput to add more size, use Icon to render mask. (#116)
- Add `default_value`, `set_value`, `masked` method.
- Add `set_value`, `value` method to set/get from OptInput.
 
<img width="390" alt="image"
src="https://github.com/user-attachments/assets/ef5368e9-132d-4de6-8506-aeecc47a9189">
2024-08-07 11:39:02 +08:00
Jason Lee
cbffb9a543
Fix Input clean button size. (#115) 2024-08-06 23:51:09 +08:00
Jason Lee
827f57fb6a
Add Sizable trait to impl small, xsmall, large and apply to Button, Input, Dropdown, Switch. (#113) 2024-08-06 17:19:54 +08:00
Jason Lee
2e1a4f84fd
Add to support click Scrollbar to scroll and fix thumb position when dragging. (#112)
- Add scrollbar border on hover and dragging.

https://github.com/user-attachments/assets/c7c3b9c1-d458-438d-bf78-3b5bc2ddcd5c
2024-08-06 15:09:42 +08:00
Floyd Wang
bc4e5732a0 Fix label text align not work (#111)
<img width="1668" alt="image"
src="https://github.com/user-attachments/assets/e1bbad88-40c3-4701-bfd0-38381e2ed67b">
2024-08-06 11:51:39 +08:00
Jason Lee
f3fdfae002
Fix list next to select first item, cancel to deselect item. (#110)
- Add confirmed to ListItem to show check style.
2024-08-06 11:31:35 +08:00
Jason Lee
e7a0d13b69
Fix windows build (#109) 2024-08-05 21:43:55 +08:00
Jason Lee
a5989f6a7c
Improve PopupMenu style (#108)
<img width="216" alt="image"
src="https://github.com/user-attachments/assets/9dcfd30f-62cc-41ff-a97d-f69b79bd997c">
<img width="346" alt="image"
src="https://github.com/user-attachments/assets/c7e564e9-c0f9-4282-9df1-9c2cd92efea9">
2024-08-05 21:23:57 +08:00
Jason Lee
4b61c3c25a
Add ContextMenu (#107)
https://github.com/user-attachments/assets/1534bb31-1d32-40b8-8871-f41fb182c8e9
2024-08-05 20:54:07 +08:00
Jason Lee
553b6409c0
Improve Dropdown to Add search support and custom icon (#106)
- Add SearchableVec to let Dropdown support search filter.
- Fix dropdown title overflow.
- Add to support custom dropdown right icon.

https://github.com/user-attachments/assets/b9e28fce-3e0f-44f7-a0f4-3e01f6db31d1
2024-08-05 11:47:55 +08:00
Floyd Wang
12b5d1b501 Add clipboard (#105) 2024-08-05 11:35:02 +08:00
Floyd Wang
48c452e6f6
Better disabled style for ghost button (#102) 2024-08-02 18:20:08 +08:00
Floyd Wang
e784f98a38
TableDelegate methods return ViewContext<Table<Self>> (#101) 2024-08-02 16:38:48 +08:00
Floyd Wang
48efdecdef
The button compact method defaults to true (#99) 2024-08-02 11:31:40 +08:00
Jason Lee
22a1157378
Add prefix, suffix to TabBar. (#98) 2024-08-01 21:36:33 +08:00
Jason Lee
68e6464bea Fix pane bottom offset in scroll mode. 2024-08-01 20:28:02 +08:00
Jason Lee
e9d409a4b1
Add Link style Button (#97)
<img width="1305" alt="image"
src="https://github.com/user-attachments/assets/ee42d86f-e237-4544-aa2d-1414dabfb55e">

- Update `primary`, `danger`, `outline`, `ghost`, `link` methods to as a
builder method to just change style.
- Add `compact` used to reduce padding.

<img width="1279" alt="image"
src="https://github.com/user-attachments/assets/ccbd71c0-9157-4ef8-b164-b99ade24cf92">
2024-08-01 19:54:35 +08:00
Jason Lee
4a5b387b40 Fix mistake unwrap in PopupMenu. 2024-08-01 15:43:21 +08:00
Jason Lee
3dd149e711
Update PopupMenu to support checked style. (#96)
<img width="256" alt="image"
src="https://github.com/user-attachments/assets/87009870-e426-48e5-9860-ba91b4702ea4">
2024-08-01 15:41:00 +08:00
Michael Angerman
eb75df5d99
Update demo application to activate on startup (#92)
When I start up *gpui-component* its nice to be able to see that
application show up,
similar to the way zed editor works upon startup...
2024-08-01 11:03:40 +08:00
Jason Lee
0e3736e312
Update Dropdown title to use SharedString (#95) 2024-08-01 11:00:18 +08:00
Floyd Wang
c91f71ae21
Table support render_tr and stripe methods (#94) 2024-08-01 10:17:21 +08:00
Floyd Wang
35c3b13bdd Fix typo in table 2024-07-31 15:34:36 +08:00
Jason Lee
d1c19c5912
Add Link (#91) 2024-07-31 14:24:57 +08:00
Jason Lee
d659713555
Fix Label, Checkbox, Radio to support label text wrap. (#90)
<img width="1102" alt="image"
src="https://github.com/user-attachments/assets/1443378d-54e9-43a4-8bb8-0d0f4581169d">
2024-07-31 11:49:32 +08:00
Jason Lee
c94e9feae2 Fix to work with new GPUI. 2024-07-31 10:12:26 +08:00
Jason Lee
9766a0766b
Fix dropdown to avoid item text wrap. (#88) 2024-07-30 19:58:48 +08:00
Jason Lee
6465969c5a
Improve svg_img to use cached assets. (#87) 2024-07-30 19:54:27 +08:00
Floyd Wang
73121123f3
Add custom button demo (#86) 2024-07-30 11:24:29 +08:00
Floyd Wang
fc6423f22c
Add ButtonCustomStyle for customized color (#85) 2024-07-30 10:38:42 +08:00
Jason Lee
f496c241d7
button: Fix Button click prevent_default. (#84)
- Use icon in title_bar for switch theme, and add GitHub icon.
2024-07-30 00:28:18 +08:00
Jason Lee
8aaeb9383d
Fix dropdown click to lose focus. (#80) 2024-07-29 19:00:17 +08:00
尹吉峰
6e58edd349
input: Expose TextInput::disabled (#81) 2024-07-29 18:51:46 +08:00
Floyd Wang
97d139f9ec
Expose focus method for otp input (#83) 2024-07-29 16:20:58 +08:00
Floyd Wang
66698bfe27
Rename dropdown render_empty to empty (#82)
Also, `OTPInput` to `OtpInput`
2024-07-29 15:37:38 +08:00
Jason Lee
a3df086e79
theme: Fix list, table theme colors. (#79)
- Fix list, table theme colors.
- Fix table hover bg.
- Add avatar to table list.
- Update dropdown Size:Small style.
2024-07-29 13:52:45 +08:00
Jason Lee
01aa9401c5
resizable: Fix resizable handle to keep showing drag style on dragging. (#78)
https://github.com/user-attachments/assets/a8d2abcb-9122-4060-bfd6-2673903c18a1
2024-07-29 10:01:22 +08:00
Jason Lee
15e9804f08
table: Add sort button to table column. (#77)
https://github.com/user-attachments/assets/d6a3dc9b-758f-4108-8d1d-d8a3d2dc0dc2
2024-07-28 23:24:55 +08:00
Jason Lee
7bfdfcb2ec
table: Add drag to move col. (#76)
https://github.com/user-attachments/assets/9964f3da-0376-4b53-b64e-c9652c324aa3
2024-07-28 22:20:23 +08:00
Jason Lee
79958fc95c
Add to support Table column resizing. (#75)
https://github.com/user-attachments/assets/d56f2cd7-df08-437b-9eea-849d68094e1f
2024-07-28 00:51:37 +08:00
Floyd Wang
11034ec2ac Improve dropdown render_empty builder result from AnyElement to impl IntoElement for better usage 2024-07-26 17:26:58 +08:00
Floyd Wang
55822144c4
Rename InputOtp to OTPInput (#74) 2024-07-26 17:12:23 +08:00
Floyd Wang
d278d85058
Imporve dropdown (#73)
* Remove min-height
* Provide `render_empty` for custom empty view
* Fix crash when delegate is empty
2024-07-26 14:31:47 +08:00
Floyd Wang
81ecb1e11b
InputEvent support clone (#72) 2024-07-25 18:43:29 +08:00
Jason Lee
2396c918f2
Hide scrollbar when scroll are is small than container. (#71) 2024-07-25 15:53:57 +08:00
Floyd Wang
f02c2a82b1
Do not preset padding when input with affix (#70) 2024-07-25 11:02:04 +08:00
尹吉峰
7489a4ffdd
Update WebView to pass wry::WebView instance (#69)
It's much prefer to use `WebViewBuilder` instead of
[WebView::new](https://docs.rs/wry/latest/wry/struct.WebView.html#method.new)
2024-07-24 19:32:05 +08:00
Jason Lee
4c81977639 Fix Label text_align again. 2024-07-24 19:01:43 +08:00
Jason Lee
ed132ad55e Add more example to Label. 2024-07-24 18:56:32 +08:00
Jason Lee
c538a231c1 Fix Label text_align. 2024-07-24 18:39:13 +08:00
Jason Lee
6b019e3954 Impl InteractiveElement, StatefulInteractiveElement for Scrollable. 2024-07-24 17:59:44 +08:00
Jason Lee
030a706a4c
Refactor ScrollView into scrollable fluent method. (#68) 2024-07-24 17:50:50 +08:00
Jason Lee
7305967c09 Impl Scrollable for Focusable<E>, Stateful<E>. 2024-07-24 17:01:15 +08:00
Jason Lee
d63e256f19
Update Label masked char (#67) 2024-07-24 16:35:28 +08:00
Jason Lee
22a15c7dcc
Update scroll view (#66) 2024-07-24 15:41:20 +08:00
Jason Lee
4edf1e3427
Update ScrollView to let content is FnOnce. (#65) 2024-07-24 11:38:30 +08:00
Jason Lee
e0103d1d58
Add CI (#62) 2024-07-24 10:39:19 +08:00
Jason Lee
d60a1122d4
Scroll to top when list have searched. (#64) 2024-07-24 10:09:12 +08:00
Floyd Wang
764e7486e7 Set the default cleanable to false for new dropdown (#63) 2024-07-24 10:07:11 +08:00
Jason Lee
b4862082f1
Improve list item (#61) 2024-07-23 22:08:21 +08:00
Floyd Wang
1b715c431f
Fix new dropdown selected_index not work (#60) 2024-07-23 19:18:39 +08:00
Jason Lee
db14f0a2e5
Add pattern and validate to Input for limit input format. (#59) 2024-07-23 15:36:08 +08:00
Jason Lee
3ec35929ae
Add font-weight methods to styled: font_light, font_semibold, font_bold ... (#58)
https://tailwindcss.com/docs/font-weight
2024-07-23 14:57:16 +08:00
Jason Lee
30f34dc780
Fix button icon color support (#57) 2024-07-23 13:45:34 +08:00
Jason Lee
652efd187c Update list to save the task on the struct. 2024-07-23 10:51:11 +08:00
Jason Lee
80bdf20376 Export set_query and query method to List. 2024-07-23 10:15:38 +08:00
Jason Lee
8ff4658c96 Update Icon again, let new to support impl Into<Icon>. 2024-07-23 10:02:34 +08:00
Jason Lee
8609968ac2 Improve Icon::new to support impl Into<IconName> 2024-07-23 09:56:57 +08:00
Jason Lee
faa16fb660
Add ScrollView (#56) 2024-07-23 09:38:23 +08:00
Jason Lee
5034152f21
Improved Input prefix, suffix with a builder to support Element. (#54)
- Add loading to List query input and changed perform_search now return
a Task.
2024-07-22 15:30:07 +08:00
Jason Lee
4687a18ee4
Add to support Input history for undo & redo (#53)
https://github.com/user-attachments/assets/b898dc08-8e99-4247-8dc3-d5752d1bc2f3

Ref https://github.com/huacnlee/gpui-component/issues/27
2024-07-22 11:36:54 +08:00
Jason Lee
ca08be7038
Fix Popup modal mouse move crossed to back layer. (#51) 2024-07-20 02:39:27 +08:00
Jason Lee
e54d1f600b
Add to masked Label and support children to Button (#50)
https://github.com/user-attachments/assets/9583ce15-b801-45f9-aafb-54f0ecdf7dc9

- Add masked mode to Label.
- Add to support any children to Button.
- Fix Popover to support selected state style.
2024-07-19 18:54:16 +08:00
Jason Lee
a69d30be6a Add cx.theme auto import to support WindowContent. 2024-07-19 11:32:25 +08:00
Jason Lee
613cfebb65
Improve ActiveTheme trait to impl ViewContent and ModelContext to support auto import. (#49) 2024-07-19 11:20:45 +08:00
Jason Lee
e95971624e Fix windows build. 2024-07-18 23:29:22 +08:00
Floyd Wang
e4b9e008ba
Use cx.quit() instead of std::process::exit(0) (#47) 2024-07-18 19:02:39 +08:00
Floyd Wang
653222db73
dropdown: Use event instead of callback (#46)
* Rule: use event for `Render`, use callback for `RenderOnce`
2024-07-18 18:40:32 +08:00
Jason Lee
bac5392e0a
Refactor Slider, Input, InputOtp to use EventEmiter to emit change (#45) 2024-07-18 18:38:58 +08:00
Jason Lee
f6146220e4
Add WebView (#2)
- https://github.com/huacnlee/zed/pull/6
- https://github.com/zed-industries/zed/pull/13730
2024-07-18 18:00:23 +08:00
Floyd Wang
91e123e942 input: TextEvent Add Focus & Blur events 2024-07-18 17:48:57 +08:00
Floyd Wang
07a1f3099e dropdown: Add on change callback 2024-07-18 16:50:30 +08:00
尹吉峰
4ccbe9bd71
Update Dropdown (#42) 2024-07-18 16:12:12 +08:00
Jason Lee
683b22c4a4
Fix Resizable drag move position. #28 (#41) 2024-07-18 00:02:59 +08:00
Jason Lee
0fdf7be40d Fix table scrollbar display layer. 2024-07-17 23:19:03 +08:00
Jason Lee
b8a7d6a2dd Change InputOpt default masked: false and publish masked method. 2024-07-17 18:57:19 +08:00
Jason Lee
c7336fd5ea
Add InputOtp (#40)
https://github.com/user-attachments/assets/c92da4e7-21de-436f-968d-7cb47fa31aed
2024-07-17 18:49:41 +08:00
Jason Lee
d71b697f41
Add Slider (#39)
https://github.com/user-attachments/assets/a1799cd9-45af-413c-b32b-c60fb1b8d586
2024-07-17 16:01:27 +08:00
Jason Lee
3aaa348fbb Add label support to horizontal Divider. 2024-07-17 14:11:17 +08:00
Jason Lee
ac3d6760ed Fix vertical Divider 2024-07-17 13:59:20 +08:00
Jason Lee
3467522714
Add double click to select word support for Input. (#38)
Continue #27
2024-07-17 11:41:04 +08:00
Jason Lee
36411750ee Fix to limit change when Input is disabled.
Add clean button to List query input.
Add ButtonRouneded with px support.
2024-07-17 10:47:25 +08:00
Jason Lee
702863eb83
Add overflow scroll support to Input. (#37)
Continue #27

- Fix cut and paste invalid replace range.
- Add `Shift-Home`, `Shift-End` for select to home or end.

## Show case


https://github.com/user-attachments/assets/d99c56e3-5241-46e2-b3ac-f72ef962b0b5
2024-07-17 10:31:17 +08:00
Jason Lee
07e1296916
Add cleanable to Input (#36) 2024-07-16 19:44:16 +08:00
Jason Lee
ce7c1a3a34
Add Small, Large size support to Input and Dropdown and let them use same height. (#35)
- Add `Dropdown::string_list` to use `Vec<SharedString>` to create
dropdown for easy use.
- Add `input_px`, `input_py`, `input_h` trait methods to `Styled`
element.
2024-07-16 15:14:12 +08:00
Jason Lee
2b184ca8d5
New Scrollbar (#33)
https://github.com/user-attachments/assets/30d890bc-49cc-4abe-8652-387ddbb73198
2024-07-16 12:00:51 +08:00
Floyd Wang
b1bb22fd1d Fix clippy warning 2024-07-15 11:42:14 +08:00
Jason Lee
59603ab83b Add min_w, max_w to PopupMenu, and default min_w: 120, max_w: 500 2024-07-15 09:15:12 +08:00
Jason Lee
4ca98029dd
Fix placeholder style for Input (#32)
https://github.com/huacnlee/gpui-component/issues/27
2024-07-13 09:53:03 +08:00
Jason Lee
35cec4cf5c
Update to use better implementation of selection support for Input. (#31)
Co-authored-by: Conrad Irwin <conrad@zed.dev>
2024-07-13 09:40:42 +08:00
Jason Lee
41a83e6f6f
Improve Input (#29)
Continue #27 

- Fix selection color in dark mode.
- Allow to continue selection, even mouse is out of the input.
- Pause cursor blinking when keep typing.

https://github.com/user-attachments/assets/ce9e722c-5c47-4daa-b2ba-cbe1680c4932
2024-07-13 00:34:55 +08:00
Jason Lee
0d6d1c95d0 Fix ProgressBar example to avoid over the range. 2024-07-12 23:27:37 +08:00
Jason Lee
21f0e1c78a
Add mouse selection support to Input (#26)
Done reset mouse support of
https://github.com/zed-industries/zed/pull/13534


https://github.com/user-attachments/assets/71b1d4e4-eef7-4746-8400-b2e3812e5ad4
2024-07-12 22:41:18 +08:00
Floyd Wang
138fc9c7b5 Progress use positioning layout 2024-07-12 18:25:09 +08:00
Jason Lee
7c99584862
Add Indicator (#25)
https://github.com/user-attachments/assets/cd6410ca-e1c7-459e-8455-d76506b6d305
2024-07-12 17:33:05 +08:00
Floyd Wang
58dbf88af7
Add Radio (#24) 2024-07-12 16:37:31 +08:00
Jason Lee
2401d5d5a4
Add ResizablePanel (#22)
https://github.com/user-attachments/assets/b4067c1d-0ef0-4de4-bd7a-55f446d35ff0
2024-07-12 15:24:54 +08:00
Jason Lee
9e935bed56 Change switch use mouse_down to handle event fix Windows switch theme support. 2024-07-11 21:52:07 +08:00
Floyd Wang
e1aed0a03d
Add Progress (#21) 2024-07-11 19:10:46 +08:00
Jason Lee
56eb7147d9
Add a batch of color methods. (#20)
https://ui.shadcn.com/colors#colors
2024-07-11 18:16:57 +08:00
Jason Lee
eb43c78cea
Add to support open Popover as a child window. (#18)
## Goal

Change to let Popup elements open into a window, to make sure the Popup
windows, panels, menus render top than the WebView.

Then we can embed wry or other webview into GPUI.



https://github.com/huacnlee/gpui-component/assets/5518/ce005456-088f-4298-bf5d-2642cf96faff


----

This is also like other software, they are also used in child window to
render the menus, popups.

- https://github.com/huacnlee/gpui-component/pull/2
- https://github.com/zed-industries/zed/pull/13730

## Todos

- [x] Multiple display window position.
- [x] Windows transparent background. (No transparent, just render a
correct window border)
- [x] Disable window resize on Windows. 
- [ ] Handle Menu action.
- [x] Provided `popover` or `window` two mode to uses.
2024-07-11 16:20:26 +08:00
Floyd Wang
4d9077fe85 Rename ui::stock to ui::stack 2024-07-09 16:25:07 +08:00
Floyd Wang
75e4451764
Add text align property for Label (#19) 2024-07-09 15:56:41 +08:00
Jason Lee
310e5e3cde Avoid PickerStory clone vec. 2024-07-08 23:22:08 +08:00
Floyd Wang
cab6dc9f6e Update the drag split edge fraction 2024-07-08 16:46:54 +08:00
Floyd Wang
84de8a88a4 Fix resize dock not work 2024-07-08 11:19:20 +08:00
Jason Lee
a02c981b74 table: Fix incorrect column selection bg render. 2024-07-08 09:47:13 +08:00
Jason Lee
9b51a5b998
Remove picker, add list instead. (#17) 2024-07-07 02:07:17 +08:00
Jason Lee
3c52d5f428 Rename ScrollableHandleElement to ScrollableMask. 2024-07-06 22:31:51 +08:00
Jason Lee
ac789b2379
Add Table (#16)
https://github.com/huacnlee/gpui-component/assets/5518/8603cbcc-c416-4d10-84a0-8cfe2e021e1a
2024-07-06 21:01:16 +08:00
Jason Lee
6eb63dfd28 Removed Button shadow in Light mode for ghost style button. 2024-07-05 11:26:11 +08:00
Jason Lee
c925a6aa61 Add ButtonStyle::Outline, ButtonStyle::Glost 2024-07-05 00:18:36 +08:00
Jason Lee
acbc029eed
Add PopupMenu (#15)
![CleanShot 2024-07-04 at 18 47
49@2x](https://github.com/huacnlee/gpui-component/assets/5518/8bcaea2b-2b92-4bd2-8581-fe76c9887d3d)
2024-07-05 00:04:34 +08:00
Jason Lee
3ccadf6cc3
Improve focus (#14)
- Add `FocusableCycle` trait to help impl cycle focus.
- Add `outline` style to StyledExt.
2024-07-04 14:05:14 +08:00
Jason Lee
24348ec874 Fix TitleBar 2024-07-04 10:14:44 +08:00
Jason Lee
f78d50b5e9 Update dock layout 2024-07-04 01:05:32 +08:00
Jason Lee
19930e46db
Add SvgImg to render svg, and with a Chart example (#13)
https://github.com/huacnlee/gpui-component/assets/5518/576da9f9-4bff-4faf-a17e-19860cf6f948
2024-07-03 19:09:59 +08:00
Floyd Wang
b8ffa12a90 Fix typo 2024-07-03 16:56:41 +08:00