Commit graph

40 commits

Author SHA1 Message Date
Jason Lee
482a31fa19
input: Fix TextArea enter to newline not work and scroll to visible on move cursor. (#523)
Close #494

- Fix enter to newline.
- Fix to ensure scroll on move cursor or enter.
2024-12-31 19:19:14 +08:00
xda
6a310c618f
input: Up, Down to keep the same column if it possible (#500)
Fix #468
2024-12-20 18:21:22 +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
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

![CleanShot 2024-12-10 at 15 43
43](https://github.com/user-attachments/assets/17e5f46a-5602-4544-9a5c-82ec68a24dd4)
2024-12-10 16:18:38 +08:00
Jason Lee
9288dc91c2
input: Add to support multi-line Input. (#463) 2024-12-09 20:17:05 +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
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 27
00](https://github.com/user-attachments/assets/599ef72d-3ec8-4fe5-a26c-10263044db6f)
2024-10-21 20:01:49 +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
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
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
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
3d8e7a9e54
Update GPUI and fix Input API changes. (#193) 2024-08-31 23:17:14 +08:00
Jason Lee
ad5e480e63
Fix input history (#179) 2024-08-27 13:52:19 +08:00
Jason Lee
72b8290945
Upgrade GPUI. (#173) 2024-08-23 18:43:26 +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
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
Floyd Wang
a02a6ed6b8
Set default true for cleanable & trigger event when dropdown clean (#152) 2024-08-15 18:01:43 +08:00
Jason Lee
6d86e64846
Update modal demo to focus input on open. (#147) 2024-08-15 09:45:58 +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
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
Floyd Wang
eb53016d71
Use ViewContext<Self> instead of WindowContext for input affix (#126) 2024-08-09 11:37:13 +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
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
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
尹吉峰
6e58edd349
input: Expose TextInput::disabled (#81) 2024-07-29 18:51:46 +08:00
Floyd Wang
81ecb1e11b
InputEvent support clone (#72) 2024-07-25 18:43:29 +08:00
Floyd Wang
f02c2a82b1
Do not preset padding when input with affix (#70) 2024-07-25 11:02:04 +08:00
Jason Lee
b4862082f1
Improve list item (#61) 2024-07-23 22:08:21 +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
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
bac5392e0a
Refactor Slider, Input, InputOtp to use EventEmiter to emit change (#45) 2024-07-18 18:38:58 +08:00
Floyd Wang
91e123e942 input: TextEvent Add Focus & Blur events 2024-07-18 17:48:57 +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
Renamed from crates/ui/src/input.rs (Browse further)