Commit graph

894 commits

Author SHA1 Message Date
Jason Lee
67f0ffbc9c
chore: Upgrade GPUI and fix action API changes. (#1008)
Ref https://github.com/zed-industries/zed/pull/33263
2025-06-25 11:06:12 +08:00
Jason Lee
ed0887420f
chore: Impl Styled for more elements. (#1007)
This PR for continuing #1005 was missed commits.
2025-06-24 19:36:42 +08:00
Jason Lee
dfa3c9a29e
menu: Fix sub menu gap. (#1006)
<img width="334" alt="image"
src="https://github.com/user-attachments/assets/1f1a9515-f52d-4171-9e53-56d18f923be0"
/>
2025-06-24 19:33:22 +08:00
Jason Lee
9aa593ce0b
chore: Apply Styled to elements to support flexable style refinement. (#1005)
## Break Changes

- date_picker, dropdown: Removed `width` method, use `w`, `w_full`
instead.

    ```diff
    - .width(px(100.))
    + .w(px(100.))
    ```

- calendar: Removed `bordered` method, use `border` method from GPUI
instead.

    ```diff
    - .bordered(false)
    + .border_0()
    ```
2025-06-24 18:56:35 +08:00
Jason Lee
c05d63dfbe
accordion: Improve Accordion style, and remove item gap when no border. (#1004)
<img width="635" alt="image"
src="https://github.com/user-attachments/assets/a18aaa73-9cca-4adb-bee9-8cac2178bda0"
/>
<img width="650" alt="image"
src="https://github.com/user-attachments/assets/02b10d8c-47a3-4226-9585-d1d970679dde"
/>
2025-06-24 17:46:55 +08:00
Jason Lee
21c8844377
notification: Improve Notification animation. (#1003) 2025-06-24 17:25:55 +08:00
Michael Angerman
eb9a0ed881
chore: Fix button example so that it scrolls in the y direction (#999)
The button example was not scrolling in the y direction and therefore
you were *NOT* able to see the entire ButtonStory.

This minor fix now enables one to see the entire ButtonStory.

The only code that needed to be added was

```rust
            .id("button_example")
            .overflow_y_scroll()
```
2025-06-24 11:54:51 +08:00
ihavecoke
cf24614bd2
title_bar: Add macOS double-click functionality to title bar (#996) (#1002) 2025-06-24 07:45:28 +08:00
Jason Lee
3a6741f990
input: Fix wrap text not draw in multi-line mode. (#998)
Close #997 


https://github.com/user-attachments/assets/6ad9f431-b5a2-42f1-93e6-6425f0851898
2025-06-23 18:14:29 +08:00
Jason Lee
7360d2834d
theme: Update default radius to 6px, and modal to 8px. (#995) 2025-06-20 20:07:19 +08:00
Jason Lee
fdeb46b293 modal: Update modal inner padding from p_4 to p_6. 2025-06-20 18:16:35 +08:00
Jason Lee
35623f47d7
menu: Fix MenuItem Separator to use border color. (#993) 2025-06-20 15:08:21 +08:00
Jason Lee
b5922f9d92
dropdown_button: Keep rounded when is a ghost variant. (#992)
<img width="159" alt="image"
src="https://github.com/user-attachments/assets/fcb08439-34fc-42f6-bbf4-ca0efbca8e89"
/>
2025-06-19 22:45:16 +08:00
Michael Angerman
389c25c287
chore: Fix spelling of the word masked (#990) 2025-06-19 12:34:19 +08:00
Jason Lee
d7e04ecdd0
scrollbar: Improve Scrollbar to get correct scroll size. (#985)
Continue #984

- Fixes there may Scrollbar size not match the content size. Close #979
- Improved Table scrollbar to only render at scrollable area when there
have fixed columns.

<img width="850" alt="image"
src="https://github.com/user-attachments/assets/84f54515-e61a-484f-b2b4-ea5abb98ddb8"
/>


## Break Changes

- The `Scrollbar` has been removed `entity_id` and `scroll_size`
argument from new method, it will get that value from `scroll_handle`.
- There still have a `scroll_size` optional method, if you want to give
your own.
  - Also changed the `scroll_state`, `scroll_handle` to receive a ref.

```diff
- Scrollbar::vertical(entity_id, scroll_state, scroll_handle, scroll_size);
+ Scrollbar::vertical(&scroll_state, &scroll_handle);
+ Scrollbar::vertical(&scroll_state, &scroll_handle).scroll_size(scroll_size);
```
2025-06-18 19:09:34 +08:00
Jason Lee
4c87c72f60
menu: Fix scrollbar can't drag to bottom of scrollable PopupMenu. (#984)
| Before | After |
|--| -- |
| <img width="166" alt="image"
src="https://github.com/user-attachments/assets/883eb78b-9ea3-4f1b-b01e-81fbbbdd39ed"
/> | <img width="166" alt="image"
src="https://github.com/user-attachments/assets/9ba551aa-5d9e-49ed-adfa-3da6c654f0c4"
/>|

Ref #979 but not fix.
2025-06-18 17:31:56 +08:00
Jason Lee
1752d3e2b4
chore: Improve Scrollbar and Scrollable to support Axis and ScrollbarAxis. (#983) 2025-06-18 16:00:35 +08:00
Floyd Wang
c5fed17941
notification: Better style details (#982)
| Before | After |
| - | - |
| <img width="752" alt="Before"
src="https://github.com/user-attachments/assets/d4e08e87-100a-4b8d-90f3-909900d41e66"
/> | <img width="752" alt="After"
src="https://github.com/user-attachments/assets/e84c145e-8990-4c47-bbff-0d4e86acca64"
/> |
2025-06-18 14:21:25 +08:00
Jason Lee
da0063cb57
list: Fix search input padding. (#981)
This change to fix #965 affected search input size.

<img width="513" alt="image"
src="https://github.com/user-attachments/assets/f8fce042-2f53-4dc3-a725-64a1b0ed6630"
/>
<img width="550" alt="image"
src="https://github.com/user-attachments/assets/048e9ef8-da2d-4b9b-ad24-ccda55695c8b"
/>
<img width="517" alt="image"
src="https://github.com/user-attachments/assets/f06f7e9a-bf30-4e01-a0aa-0a1db6b2c6e1"
/>
2025-06-18 14:07:21 +08:00
Floyd Wang
1055131ffe
notification: Support remove notification with the given id (#980) 2025-06-18 14:02:07 +08:00
Floyd Wang
fe342919e6
notification: Show the close button when auto-hide is enabled (#977) 2025-06-18 11:34:11 +08:00
Sunli
934d08c332
wef: Fixed some issues (#975) 2025-06-18 10:46:55 +08:00
Floyd Wang
c39e7af50c
number_input_story: Fix subtraction overflow (#976) 2025-06-18 10:16:57 +08:00
Jason Lee
a478f000d4
input: Add MovePageUp, MovePageDown keymap to multi-line mode. (#969) 2025-06-17 20:57:53 +08:00
Jason Lee
8762e3482a
wef: Fix doc and warnings. (#972)
![20250617-191859](https://github.com/user-attachments/assets/f677ecb4-dbff-4e0d-86b9-203f6e1004a4)
2025-06-17 20:10:34 +08:00
Sunli
b70b229370
wef: Added a new WebView component named "Wef" based on CEF. (#877)
Wef is a Rust library for embedding WebView functionality using Chromium
Embedded Framework (CEF3) with offscreen rendering support.
2025-06-17 18:57:44 +08:00
Jason Lee
64e3653bc9 modal: Add scrollbar to modal again. (#971) 2025-06-17 18:49:49 +08:00
Jason Lee
0e3b61a704
Revert "modal: Add scrollbar to Modal for overflow contents. #960" (#970) 2025-06-17 17:48:42 +08:00
Jason Lee
edf9ed7e5f
input: Fix move up/down to keep same column. (#968)
Close #908

https://github.com/user-attachments/assets/f050dd1a-501c-4784-a45b-78ba77cdf19c
2025-06-17 15:23:37 +08:00
Jason Lee
3d7f1f8a73
input: Keep showing the blink cursor when typing or moving. (#967)
https://github.com/user-attachments/assets/3b7d2cfd-50b0-4744-bb74-1deafc5710e3
2025-06-17 14:20:27 +08:00
Jason Lee
869d48b446
input: Fix Input cursor x position when scrolled. (#966)
https://github.com/user-attachments/assets/db76d3a3-ecd6-45c6-8377-0afa4746f2db
2025-06-17 14:14:23 +08:00
Jason Lee
de491a790c
input: Fix Input prefix, suffix position, and mask * in vertical center. (#965)
- Fix Input, NumberInput padding x with prefix, suffix.
- Fix Input mask char to render in vertical center.

<img width="498" alt="image"
src="https://github.com/user-attachments/assets/f7b34e17-2503-4a24-9e16-3a30b48bacb5"
/>

- Fix to only use `Tab`, `Shift-Tab` to indent in multi-line mode.
- Improve blink cursor to render with 1.5px width and same as
line-height.
2025-06-17 13:59:02 +08:00
Floyd Wang
56e282315d
dock: Bind actions only when the tab panel is not collapsed (#964) 2025-06-17 13:38:24 +08:00
Floyd Wang
f183236d52
dock: Hide suffix action when tab_panel is collapsed (#963) 2025-06-17 11:50:52 +08:00
Jason Lee
60bebaf51f
markdown: Fix Todo list item checkbox style. (#962)
<img width="394" alt="image"
src="https://github.com/user-attachments/assets/dee22c50-4110-46e3-9205-320809c2ef00"
/>
2025-06-17 10:50:57 +08:00
Jason Lee
d2633faf82
modal: Add scrollbar to Modal for overflow contents. (#960)
- Add `overlay` variable to Theme.

<img width="536" alt="image"
src="https://github.com/user-attachments/assets/12ed43c8-00b5-41b1-8cf6-0f31b533525c"
/>
2025-06-16 17:35:02 +08:00
Jason Lee
61283a71f0
scrollbar: Refactor ScrollbarState to have Cell inside. (#959)
## Break Change

- Now we added `Rc<Cell<>>` inside the ScrollbarState.

```diff
- scroll_state: Rc<Cell<ScrollbarState>>,
+ scroll_state: ScrollbarState,
```
2025-06-16 15:11:52 +08:00
Victor Quiroz
769c0990a4
number_input: Allow signed numbers (#957)
Allow negative numbers and explicit positive numbers.

Added these tests:

1. Only one sign at the start of the number.
2. No signs in the middle of the number.
3. No signs in the fractional part.
4. Sign doesn't break formatting.


https://github.com/user-attachments/assets/89c4f4c7-d3bf-4cc1-aeca-7e9bedd02e20

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-06-16 10:05:37 +08:00
Floyd Wang
aaa855053f
list: Add a default style for empty data (#955)
<img width="890" alt="image"
src="https://github.com/user-attachments/assets/68339cab-023f-42bc-93cc-0cded1b690b0"
/>
2025-06-13 15:44:00 +08:00
Jason Lee
89c210c4ca
highlighter: Avoid crash when language not registered. (#954)
Close #952 

Fallback to use plain text to display.
2025-06-12 19:45:29 +08:00
Jason Lee
1032881103
markdown: Add debounce 500ms to update markdown to avoid render slow. (#953)
Ref #933
2025-06-12 19:15:23 +08:00
Jason Lee
e29b51cc83
popover: Improve PopoverContent to support styled methods. (#951)
- Add `refine_style` method to `StyledExt`.
- Also improve the Popover example style.

<img width="1053" alt="image"
src="https://github.com/user-attachments/assets/bf435a79-6c34-41ab-802a-29a7600ecd29"
/>
2025-06-12 15:00:00 +08:00
Jason Lee
d61b0d2510
highlighter: Fix highlight offset and reset highlight when replace all text. (#950)
- Improve JSON highlights.

<img width="839" alt="image"
src="https://github.com/user-attachments/assets/3f28ae1c-9f07-4df4-a477-f875a26d4c7d"
/>
2025-06-12 14:11:01 +08:00
Floyd Wang
2febe2611b
dock: Use disabled instead of hiding the zoom menu (#949) 2025-06-12 12:10:03 +08:00
Jason Lee
ed6adc2dae
input: Simplify newline logic for multi-line text and fix auto-grow lines count. (#948)
- Fix to only keep indent in CodeEditor mode.

https://github.com/user-attachments/assets/4b926a18-b0b5-4419-97dd-21778cd20fb3
2025-06-12 10:59:41 +08:00
Jason Lee
6ea427549a
input: Add focus_bordered method to toggle Input focus border. (#946) 2025-06-11 21:34:37 +08:00
Jason Lee
a3a4f1942d
chart: Update Chart story by use JSON file data. (#947) 2025-06-11 21:34:22 +08:00
enpitsulin
1214798abd
chore: Update GPUI and fix uniform_list API changes. (#945)
close #943

I am not sure about title specification of PR. pls feel free to edit.
2025-06-11 17:48:04 +08:00
Jason Lee
f82c347e37
title_bar: Fix pl to override default TitleBar left padding. (#944) 2025-06-11 16:52:51 +08:00
Jason Lee
a7505487e1
highlighter: Fix Zig language highlight. (#942)
<img width="1143" alt="image"
src="https://github.com/user-attachments/assets/62f87eb4-1d16-4165-8504-803aadf1b0fe"
/>
2025-06-11 16:18:38 +08:00