Jason Lee
a6b9c96a27
title_bar: Fix TitleBar drag area. ( #936 )
...
Ref https://github.com/zed-industries/zed/pull/30828 changed new GPUI
API for better details for TitleBar drag area.
2025-06-09 23:09:07 +08:00
Jason Lee
c5201e6de9
input: Revert #929 changed replace_text_in_range result an incorrect cursor pos. ( #930 )
2025-06-09 19:02:09 +08:00
Jason Lee
d648874860
input: Add cmd-], cmd-[ to indent, outdent text. ( #929 )
2025-06-09 18:31:14 +08:00
Jason Lee
6aab9d3345
code-editor: Show hover popover for diagnostics. ( #924 )
...
<img width="719" alt="image"
src="https://github.com/user-attachments/assets/75fa9737-09e1-4baa-b7ac-304e847005c8 "
/>
2025-06-09 16:16:15 +08:00
Jason Lee
c3ec1deb97
code-editor: Update CodeEditor to support external language. ( #928 )
...
Add [Navi](https://navi-lang.org ) language for example to external
language for CodeEditor.
<img width="864" alt="image"
src="https://github.com/user-attachments/assets/73afa56d-31bd-4867-a9f2-0a8cf790af0f "
/>
2025-06-09 14:27:33 +08:00
Floyd Wang
44ec74f1fb
chart: Draw dashed lines using gpui PathBuilder ( #927 )
...
https://github.com/zed-industries/zed/pull/31678
2025-06-09 11:55:32 +08:00
Ylin
01197769df
list: Improve the selection method to support more scenarios ( #925 )
2025-06-06 19:50:49 +08:00
Jason Lee
d598e58666
tag: Add rounded to Tag and support outline for all variants. ( #923 )
...
<img width="1316" alt="image"
src="https://github.com/user-attachments/assets/e06f672d-f311-4dc2-b62a-c1f5cbce6973 "
/>
2025-06-06 13:35:24 +08:00
Floyd Wang
936ee27a2c
input: Fix the panic issue in end_of_line ( #922 )
2025-06-06 10:07:11 +08:00
Jason Lee
74de042b60
popup_menu: Do not dismiss PopupMenu when clicked on a submenu item. ( #921 )
2025-06-06 09:25:04 +08:00
Jason Lee
a8f5ced4e6
code-editor: Add markers for display diagnostics to CodeEditor. ( #920 )
...
Ref:
https://microsoft.github.io/monaco-editor/typedoc/functions/editor.setModelMarkers.html


2025-06-05 23:04:01 +08:00
Floyd Wang
9afe0063a4
plot: Fix incorrect tooltip dot left position ( #919 )
2025-06-05 16:25:28 +08:00
Floyd Wang
ecfa6b8451
chart: Add decimal feature ( #918 )
2025-06-05 16:03:20 +08:00
Duane Bester
4477cca969
highlighter: Adding tree-sitter-sequel for SQL support. ( #917 )
...
📦 Adding dependency:
[tree-sitter-sequel](https://github.com/derekstride/tree-sitter-sql )
### Previews
<img width="1398" alt="Screenshot 2025-06-04 at 9 27 08 PM"
src="https://github.com/user-attachments/assets/4aee67be-6fb3-4c57-95be-20792639851a "
/>
<img width="1398" alt="Screenshot 2025-06-04 at 9 34 02 PM"
src="https://github.com/user-attachments/assets/730e148f-2bc9-481d-8eea-8110f7884e69 "
/>
2025-06-05 11:54:52 +08:00
Floyd Wang
a1bdd50735
story: Reorder story menu
2025-06-04 19:29:32 +08:00
Floyd Wang
516c8fada4
chart: Introduce chart ( #878 )
...
Add a new component called `plot`. It provides a low-level approach to
data analysis and visualization.
Chart is a collection of ready-to-use chart components built with
`plot`.
| Light | Dark |
| - | - |
| <img width="1712" alt="SCR-20250604-qhxb"
src="https://github.com/user-attachments/assets/bf7ce76e-ab7a-42c2-92e7-17cd135de66f "
/> | <img width="1712" alt="SCR-20250604-qhxr"
src="https://github.com/user-attachments/assets/dd3e44ea-bbb5-41a2-8cce-38b316d7d800 "
/> |
2025-06-04 19:22:11 +08:00
Jason Lee
7934e8af31
story: Fix double border in ResizableStory.
2025-06-04 18:11:00 +08:00
Jason Lee
c97cdd7b89
input: Fix line number width, when line number not enable. ( #916 )
2025-06-03 23:40:21 +08:00
Jason Lee
2b796c94e9
highlighter: Improve performance for large file. ( #911 )
...
Still need to improve.
This version can work smooth when the file lines are less than 5000
lines.
> cargo run --release on MacBook Pro, Apple M3 CPU
- Editing at 110 FPS+
- Display at 120 FPS.
<img width="977" alt="image"
src="https://github.com/user-attachments/assets/37958bcb-20d8-486b-8c50-2728d16f971b "
/>
2025-06-03 23:20:33 +08:00
Floyd Wang
dc1d516a30
button: Impl Selectable for the dropdown button ( #913 )
...
## Break Change
- Add `is_selected` to the `Selectable` trait; Returns true if the
element is selected.
2025-06-02 14:25:18 +08:00
Jason Lee
901312bc5a
chore: Switch gpui to depends on Zed official. ( #912 )
...
Now, GPUI have merged `window_handle` support for all platforms.
- https://github.com/zed-industries/zed/pull/24327
- https://github.com/zed-industries/zed/pull/24545
- https://github.com/zed-industries/zed/pull/28152
It's time to depends on Zed official main branch.
2025-06-02 10:05:45 +08:00
Jason Lee
a4aff404ce
highlighter: Use tree-sitter to highlight code. ( #904 )
...
<img width="1318" alt="image"
src="https://github.com/user-attachments/assets/4a8e7b93-a7e7-4648-b8da-c5a6e7ede4f9 "
/>
<img width="1318" alt="image"
src="https://github.com/user-attachments/assets/bfc35845-719f-4c97-bf50-087feb0f6775 "
/>
2025-05-29 19:54:52 +08:00
Floyd Wang
838ffe0a79
modal: Display overlay at the correct z-index ( #909 )
...
| Before | After |
| - | - |
| <img width="1712" alt="SCR-20250528-ksil"
src="https://github.com/user-attachments/assets/3725f142-0792-478a-ac7e-1a9c5604821a "
/> | <img width="1712" alt="SCR-20250528-krmi"
src="https://github.com/user-attachments/assets/b0fac5db-97b2-4ebd-83e2-94786950185c "
/> |
2025-05-28 11:57:23 +08:00
Floyd Wang
49f1ac511d
form: Add text wrapping support for label ( #907 )
2025-05-27 19:31:06 +08:00
Jason Lee
bad9506ebb
inspector: Fix Inspector on release build. ( #906 )
2025-05-27 18:51:57 +08:00
Jason Lee
372c78fac6
input: Fix enter newline position incorrect by #901 change. ( #905 )
2025-05-27 17:25:54 +08:00
Jason Lee
0389608f59
chore: Update GPUI and fix Edges type chagnes.
2025-05-27 09:54:13 +08:00
Jason Lee
9073818d4e
input: Fix outdent when selection first line is no indent. ( #903 )
...
## Before
https://github.com/user-attachments/assets/67f94a09-b01b-43e4-9809-2e876f53a7b7
## After
https://github.com/user-attachments/assets/0ff7fee8-cbbc-4f55-8877-96c7ad07d662
2025-05-26 22:46:26 +08:00
Jason Lee
5419600fcd
input: Fix Input may out of char boundary ( #901 )
...
```
byte index 3 is not a char boundary; it is inside '吧' (bytes 1..4) of `L吧2`: 0: <unknown>
```
2025-05-26 22:42:31 +08:00
Jason Lee
1cbbf6ef18
code-editor: Improve CodeEditor to has default themes. ( #900 )
2025-05-26 18:17:15 +08:00
Floyd Wang
ebe10e20c7
alert: Add support for text wrapping ( #899 )
...
<img width="935" alt="image"
src="https://github.com/user-attachments/assets/6eb10c67-5301-4414-af7f-9b4444b77fb6 "
/>
2025-05-26 17:09:12 +08:00
Jason Lee
0a9de15d79
input: Change InputState::disabled to as builder method. ( #898 )
...
## Break Changes
- The `disabled` method now is for builder method, and `is_disabled` for
get state.
```diff
- pub fn disabled(mut self) -> bool
+ pub fn is_disabled(&self) -> bool
+ pub fn disabled(mut self, disabled: bool) -> Self
```
2025-05-26 17:00:17 +08:00
Jason Lee
1c11b5fb55
inspector: Add Inspector. ( #897 )
...
<img width="1434" alt="image"
src="https://github.com/user-attachments/assets/f6ec2e1d-ff1c-4798-90fe-d29bef20fa9d "
/>
2025-05-26 16:44:11 +08:00
Floyd Wang
a1ad647527
number_input: Add support for prefix and suffix ( #896 )
...
<img width="1097" alt="image"
src="https://github.com/user-attachments/assets/b4c1fc69-88ad-4ecd-b1c8-1a5a92836e82 "
/>
2025-05-26 16:16:22 +08:00
Jason Lee
a95482fdd8
chore: Upgrade GPUI 2025/05/26 with inspector changes. ( #895 )
...
https://github.com/zed-industries/zed/pull/31315
2025-05-26 13:40:27 +08:00
Jason Lee
c99e696cb1
code-editor: Update code highlight theme colors. ( #888 )
2025-05-25 10:21:37 +08:00
Jason Lee
f539817d9b
alert: Add banner mode and on_close to Alert. ( #893 )
...
## Break Changes
- The `Alert::new` method change to 2 args, first is `id`.
```diff
- fn new(message: impl Into<Text>) -> Self
+ fn new(id: impl Into<ElementId>, message: impl Into<Text>) -> Self
```
<img width="1120" alt="image"
src="https://github.com/user-attachments/assets/214df737-6129-4a53-8f3b-86e83bc8082b "
/>
2025-05-23 19:20:13 +08:00
Jason Lee
a1e2160083
menu: Fix sub-menu item height to match with other items. ( #892 )
2025-05-23 17:24:52 +08:00
Jason Lee
8dc9666214
input: Fix cursor and IME popup position when IME typing. ( #889 )
...
- Fix cursor position when IME typing.
- Fix selection range when canceled IME typing.
- Fix IME popup position to follow the cursor position.
- Fix IME text to render with underline style.
Close #55
<img width="1231" alt="image"
src="https://github.com/user-attachments/assets/c746703f-23de-4b3b-bd5b-210a8447eeba "
/>
2025-05-23 15:00:24 +08:00
Jason Lee
2c4a28a6da
code-editor: Add current line background. ( #887 )
...
https://github.com/user-attachments/assets/3ab6a1b5-648c-4431-91d2-7ebefee2f511
2025-05-22 23:03:53 +08:00
Jason Lee
2d6284694d
code-editor: Fix highlight offset on Windows. ( #886 )
...
Again, caused by need `split('\n')` not use `.lines()`.
2025-05-22 22:10:59 +08:00
Jason Lee
d0ccb6bf17
code-editor: Improve code highlight performance. ( #885 )
...
- Split code to lines to improve performance and cache hit rate, close
#881
- Update default code highlight theme to use `macOS Classic`.
<img width="1208" alt="image"
src="https://github.com/user-attachments/assets/511b442d-5960-493f-88cc-b8aceb68f77b "
/>
<img width="1208" alt="image"
src="https://github.com/user-attachments/assets/6e5b2728-384f-4b62-b069-268118dec9ab "
/>
2025-05-22 18:09:18 +08:00
Floyd Wang
244090ddc5
number_input: Remove InputEvent from NumberInputEvent ( #884 )
...
## Break Change
- Number input no longer emits `InputEvent`; you need an additional
subscription for `InputEvent`.
2025-05-22 14:38:43 +08:00
Jason Lee
119d348e4a
input: Fix indent, outdent to consider \r on Windows. ( #880 )
...
https://github.com/user-attachments/assets/c662c251-36e5-4a80-bad9-7438ba1b395c
2025-05-21 22:37:07 +08:00
Jason Lee
445b1e4e02
input: Fix click can not to position cursor on empty line on Windows. ( #875 )
...
Reverts longbridge/gpui-component#874
Ref https://github.com/zed-industries/zed/pull/31031
2025-05-21 10:01:53 +08:00
ZW
6a190da785
calendar: Support custom matcher ( #873 )
...
See #870
2025-05-20 21:07:17 +08:00
Jason Lee
e68419bc95
example: Add resizable feature to HTML, Markdown example. ( #872 )
2025-05-20 18:25:14 +08:00
Jason Lee
5658db42c7
input: Add CodeEditor mode. ( #863 )
...
## TODO
- [x] Cache highlight result.
- [x] Add a `code-editor` example with more languages test.
- [x] Support setup font to Input (Base on window scope text style).
- [x] Line number
- [x] Change font size and font family.
- [x] Enter newline to keep indent.
- [x] Height with flex_1
- [x] Add to support press `up`, `down` to move cursor to start or end
of the selection, if there is selected.
- [x] Add `Tab`, `Shift-Tab` to indent or outdent for cursor and
selection.
- [x] Double click to select at least 1 char.
https://github.com/user-attachments/assets/af74862d-15a9-4802-b4b4-2aeb606227ec
2025-05-20 15:51:00 +08:00
Jason Lee
67dd658635
input: Fix selection rendering for empty lines. ( #868 )
...
<img width="491" alt="image"
src="https://github.com/user-attachments/assets/b24e4fbc-40e8-4570-b254-2974aa7735a7 "
/>
2025-05-19 20:32:46 +08:00
Jason Lee
b97abd6394
input: Fix auto-grow height. ( #865 )
...
Fix #864
Updated InputState API to split `single_line`, `multi_line` and
`auto_grow`.
The `InputState::new` for default single_line, and added `multi_line`
and `auto_grow` to change other mode.
### With no wrap
https://github.com/user-attachments/assets/22a8f0d6-e264-4f39-bb30-386a41975d2b
### With soft wrap
https://github.com/user-attachments/assets/b71f0fb1-5937-470b-a278-8b1de7cfd7d7
2025-05-19 19:26:27 +08:00
Jason Lee
769b1887d0
dock: Ensure add panel to StackPanel is type of TabPanel or StackPanel. ( #862 )
2025-05-17 22:42:03 +08:00
Jason Lee
1e2cc8315a
dock: Show keybinding for ToggleZoom menu and button. ( #861 )
...
And binding `Shift-Esc` for example to toggle zoom panel, `Ctrl-W` for
close panel.

2025-05-17 22:23:45 +08:00
Jason Lee
3c85ccbe2a
number_input: Fix NumberInput appearance by #858 change. ( #860 )
2025-05-17 10:51:04 +08:00
Jason Lee
bc398adbf3
input: Refactor Input, Picker as stateless mode. ( #858 )
2025-05-16 23:41:26 +08:00
Ratazzi
f3d97bf8e2
chore: Unify icon parameter types in ListItem and Dropdown. ( #857 )
...
## Changes
This PR unifies icon parameter types in UI components:
- Changed `ListItem.check_icon` parameter type from `IconName` to `impl
Into<Icon>`
- Changed `Dropdown.icon` parameter type from `impl Into<IconName>` to
`impl Into<Icon>`
- Updated related rendering logic
## Impact
- **API Consistency**: All components now accept the same icon parameter
type
- **Backward Compatible**: Existing code using `IconName` continues to
work
- **Enhanced Flexibility**: Components can now accept custom `Icon`
instances directly
2025-05-15 16:13:30 +08:00
Jason Lee
c0e0d82594
input: Add mask pattern to format display. ( #854 )
...
- Add `mask_pattern` to Input, NumberInput.
- Fix Input `set_text` to move cursor to end.
https://github.com/user-attachments/assets/2d7e362a-3f80-47a4-94e3-efd729bffcac
2025-05-14 22:27:46 +08:00
Jason Lee
1535df796e
resizable: Refactor to use stateless Resizable element. ( #852 )
...
## Break Changes
- The `ResizablePanelGroup` and `ResizablePanel` are changed to as
stateless element, please check out the diff to migrate.
2025-05-12 17:15:11 +08:00
Jason Lee
0a95f7c0f1
resizable: Add size_range to limit panel size and fix resize and initial_size of panel. ( #844 )
...
## Fix panel resize bug
- Fix some panel resizing details.
- Fix initial_size for panel and ensure split dock panel to get average
size.
### Before
https://github.com/user-attachments/assets/cd6c7e10-aec7-46a6-8a4d-11bf4d221f92
### After
https://github.com/user-attachments/assets/90c8b865-630a-4abd-98c9-310800b12fee
2025-05-12 11:07:06 +08:00
Michael Angerman
28582bc905
chore: Remove unused file text_view ( #850 )
...
The file text_view was empty.
So it does not need to be in the repo.
2025-05-12 10:40:00 +08:00
Jason Lee
8bea37ed74
dock: Update drop panel target mask to 50% of panel. ( #845 )
2025-05-09 22:55:48 +08:00
Jason Lee
d288a51e06
dock: Revert panel radio size to back to use Pixels type for panel size. ( #842 )
...
This PR to revert previous dock changes to back to use `Pixels` type for
panel size.
- #833
- #839
- #840
2025-05-09 16:47:24 +08:00
Jason Lee
f8e30c6f5d
dock: Revert dock to use absolute size. ( #840 )
...
This change to revert `Dock` to use `Pixels` for size, not use ratio,
because in most case we need to keep dock size, not wants it change when
window resize, we just only want center dock to change.
The `Panel` will keep the relative size changes.
2025-05-08 16:29:55 +08:00
Jason Lee
a26311dc0e
dock: Improve dock, panel to support absolute or fraction size. ( #839 )
2025-05-08 12:01:16 +08:00
Jason Lee
6514aec22a
dock: Refactor to use ratio for dock, panel size. ( #833 )
2025-05-07 01:32:31 +08:00
Jason Lee
e530af9b51
notification: Add action button to Notification. ( #832 )
...
- Fix `Icon` clone to keep text_color and other attributes.
<img width="1303" alt="image"
src="https://github.com/user-attachments/assets/abb35045-166e-450e-a200-1d4a1d2b6dd8 "
/>
2025-05-06 16:58:07 +08:00
Jason Lee
9906a482ec
style: Add smaller, larger method to Size. ( #831 )
2025-05-06 15:31:11 +08:00
Jason Lee
0c6d631a39
scrollbar: Improve the scrollbar size. ( #830 )
...
## Idle
<img width="1086" alt="image"
src="https://github.com/user-attachments/assets/1acd847c-9ea4-477f-a1be-a9dd6305de60 "
/>
## Hover
<img width="1086" alt="image"
src="https://github.com/user-attachments/assets/08a700ce-98f5-41ff-b504-37ea3cf90d81 "
/>
2025-05-06 14:45:22 +08:00
Jason Lee
f4e8b952e9
modal: Add alert method to create modal with a Ok button. ( #829 )
...
- Fix to handle close modal when `on_ok`, `on_cancel` not present.
2025-05-02 10:28:26 +08:00
Jason Lee
2c06a032fb
svg_img: Fix SvgImg first load can work. ( #828 )
2025-04-30 17:35:11 +08:00
Jason Lee
38d9c24af5
chore: Update getter method to return reference to view components. ( #827 )
2025-04-30 17:18:44 +08:00
Jason Lee
3a915dba89
chore: Update GPUI 2025/04/30 ( #826 )
2025-04-30 14:41:08 +08:00
Jason Lee
6dea2cb57c
input: Clean focused_input on Input blur. ( #825 )
2025-04-30 14:08:39 +08:00
Sunli
69dad78867
svg_img: No longer use the global image loader. ( #823 )
...
Update SvgImg load logic and try to drop image to fix VRAM leak issue.
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-04-30 11:56:24 +08:00
Floyd Wang
a5e5fc52b4
dropdown: Support change options for the dropdown ( #824 )
2025-04-30 10:33:21 +08:00
Jason Lee
dd3b8b1f3d
theme: Export colors attribute. ( #822 )
2025-04-30 10:16:35 +08:00
Jason Lee
832f8b8f75
svg_img: Refactor SvgImg to avoid assign source image size and fix drop image error. ( #821 )
...
## Break Change
- Removed `source` method from `SvgImg`, now need assign source in `new`
method.
- There is no need to give image size, it will read the size from SVG
file.
2025-04-29 19:25:43 +08:00
Sunli
dc776224f9
svg_img: Fix memory leak in SvgImg ( #818 )
2025-04-28 14:42:37 +08:00
Floyd Wang
547c9c1827
gallery: Fix the error active panel display with search keywords ( #817 )
...
## Before
https://github.com/user-attachments/assets/25b925e5-c0f3-42b0-97f3-190fb738a10a
## After
https://github.com/user-attachments/assets/2d6e2b23-f3e2-45fd-a58c-69f31d0646a8
2025-04-25 19:06:39 +08:00
Ylin
f946560837
dropdown: Add display_title to DropdownItem to support custom title to dropdown input. ( #816 )
...
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-04-25 19:05:24 +08:00
Jason Lee
9085879795
gallery: Add DatePicker and Calendar. ( #815 )
2025-04-25 16:05:47 +08:00
Jason Lee
a9d145dd50
Update disabled menu, button, dropdown etc. to use default cursor. ( #814 )
...
To follow macOS UX design.
2025-04-24 21:28:15 +08:00
Jason Lee
bbb267f2bf
accordion: Add gap between title and icon. ( #813 )
2025-04-24 21:01:11 +08:00
Floyd Wang
f7c900d8eb
input: Add Copy and Eq derives for StepAction ( #812 )
2025-04-24 11:06:32 +08:00
Jason Lee
b0ff230588
table: Disable auto scroll when resize column out of the table right bounds. ( #811 )
...
https://github.com/user-attachments/assets/f1569eb5-e6e6-43f9-9425-0de5e2235163
Do same behavior like the macOS table.
2025-04-23 22:18:40 +08:00
Jason Lee
3cff72cc37
table: Fix render_tr to ensure apply with h_flex. ( #810 )
...
- Reduce last empty column to 12px.
2025-04-23 22:09:14 +08:00
Jason Lee
b4449f10cf
dropdown: Avoid selected value text wrap. ( #808 )
2025-04-22 21:19:20 +08:00
Jason Lee
5cacffcc06
chore: Fix cargo clippy.
2025-04-22 19:36:09 +08:00
Jason Lee
a195795978
input: Refactor window.focused_input by use better way to ensure update. ( #809 )
2025-04-22 19:34:41 +08:00
Jason Lee
373d97ddf0
root: Fix to reset focused_input when close modal or drawer. ( #807 )
2025-04-22 18:54:07 +08:00
Ylin
affd29dc85
table: Ensure to select row when prev or next. ( #805 )
2025-04-22 18:46:41 +08:00
Jason Lee
39da30815a
input: Fix Input escape to propagate to parent element. ( #806 )
...
Fix #803 changes broke Escape to dismiss dropdown menu.
2025-04-22 18:40:27 +08:00
Jens Krause
f7be6a245a
input: Add Esc to clean. ( #803 )
2025-04-20 10:24:47 +08:00
Jason Lee
16eb0f304b
gallery: Add to support search stories. ( #802 )
...
<img width="1196" alt="image"
src="https://github.com/user-attachments/assets/daa3f47a-0c4d-404c-a673-8e18880e8f6c "
/>
2025-04-17 20:46:57 +08:00
Jason Lee
be63d9701c
theme: Improve Switch and Sidebar selected item bg color. ( #801 )
2025-04-17 19:53:32 +08:00
Jason Lee
413d156ef4
input: Update Input text method to return &SharedString type. ( #800 )
...
## Break Changes
- input: Now the `text` method `Input` changed return type from
`SharedString` to `&SharedString`.
- list: Remove `set_query` and `query` method from `List`, you can use
`query_input` to instead.
2025-04-17 19:52:14 +08:00
Jason Lee
bef1dd2544
story: Add ClipboardStory ( #799 )
2025-04-17 18:57:23 +08:00
Jason Lee
034e465d28
list: Select first item on search. ( #798 )
2025-04-17 17:29:02 +08:00
Jason Lee
5b508d7219
gallery: Redesign the gallery. ( #797 )
...
Close #773
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/e27a28ca-cdd7-4970-8518-4fd0104bb3f8 "
/>
2025-04-17 17:12:48 +08:00
Jason Lee
225a306169
theme: Improve ThemeMode to add more features.
2025-04-16 15:26:14 +08:00
Jason Lee
e2463bbdcf
linux: Fix sync_system_appearance on Linux. ( #796 )
...
Close #104
2025-04-16 14:55:01 +08:00
Jason Lee
8d37716b88
list: Export query_input for support update the default Query Input. ( #794 )
...
## Break Change
- Updated `set_placeholder` and `set_pattern` method to add `window` and
`cx` argument.
```diff
- fn set_placeholder(&mut self, placeholder: impl Into<SharedString>)
+ fn set_placeholder(&mut self, placeholder: impl Into<SharedString>, _:
&Window, cx: &mut Context<Self>)
- fn set_pattern(&mut self, pattern: regex::Regex)
+ fn set_pattern(&mut self, pattern: regex::Regex, window: &mut Window,
cx: &mut Context<Self>)
```
2025-04-15 20:36:04 +08:00
Floyd Wang
0c4a0538e6
sidebar: Better active menu background ( #793 )
2025-04-15 14:36:02 +08:00
Floyd Wang
8930acf648
sidebar: Add suffix for menu item ( #792 )
...
| Light | Dark |
| - | - |
| <img width="913" alt="SCR-20250415-mkdr"
src="https://github.com/user-attachments/assets/5c4931e6-4d03-48ec-91c6-ade2d86de75a "
/> | <img width="913" alt="SCR-20250415-mkec"
src="https://github.com/user-attachments/assets/f85af984-ecc3-4cd7-913c-c4e93384dbf1 "
/> |
2025-04-15 14:02:52 +08:00
Jason Lee
71b79cf1b4
chore: Add Windows CI ( #789 )
2025-04-14 20:46:32 +08:00
Jason Lee
aa44fd3a43
kbd: Fix Kbd keys ordering and on Windows. ( #788 )
2025-04-14 19:27:23 +08:00
Jason Lee
9a6a0f4421
tooltip: Add action, key_binding method to Tooltip. ( #787 )
2025-04-14 17:38:21 +08:00
Floyd Wang
8ef4e2eb17
modal: Respond confirm events only when on_ok or footer present ( #786 )
2025-04-14 16:56:16 +08:00
Jason Lee
d0a73011de
tooltip: Add KeyBinding to tooltip and Button. ( #783 )
...
- Improve `Kbd::format` method.
- Add `tooltip_with_action` method to Button for display key binding in
tooltip.
-
## Break change
- The `Tooltip::new` has been changed it argument and return type.
```diff
- pub fn new(text: impl Into<Text>, _: &mut Window, cx: &mut App) ->
AnyView
+ pub fn new(text: impl Into<Text>) -> Self
```
2025-04-14 16:40:40 +08:00
Floyd Wang
95fb86ec08
checkbox: Make checked icon sizable ( #785 )
...
| Before | After |
| - | - |
| <img width="642" alt="SCR-20250414-nbwx"
src="https://github.com/user-attachments/assets/fa3daaf8-5465-49f5-8cd5-d59c19b50494 "
/> | <img width="644" alt="SCR-20250414-nbli"
src="https://github.com/user-attachments/assets/e45aa560-0183-460a-b76d-e3cb0203067f "
/> |
2025-04-14 14:47:15 +08:00
Jason Lee
73be54a0f7
input: Improve clear button position in Input. ( #782 )
...
| Before | After |
| -- | -- |
| <img width="529" alt="image"
src="https://github.com/user-attachments/assets/02fdba71-7e83-43b9-ba4c-476eb21dcf28 "
/> | <img width="530" alt="image"
src="https://github.com/user-attachments/assets/ad7b6378-c9ff-4ea4-943a-87af53a2ac79 "
/> |
2025-04-11 19:13:17 +08:00
Floyd Wang
d04866eb77
checkbox: Support sizable ( #781 )
...
| Before | After |
| - | - |
| <img width="672" alt="SCR-20250409-pgbg"
src="https://github.com/user-attachments/assets/73a46b13-a3bb-4f58-afb0-aa388bbaefb5 "
/> | <img width="669" alt="SCR-20250409-phiy"
src="https://github.com/user-attachments/assets/1230a02d-cdc7-4c2e-9949-bcad09eb2edc "
/> |
2025-04-09 17:31:56 +08:00
Jason Lee
aaa88db52c
story: Add example for secondary click table row. ( #780 )
2025-04-09 13:42:08 +08:00
Floyd Wang
206a1e049b
description_list: Wrap description value if it’s too long ( #779 )
...
| Before | After |
| - | - |
| <img width="752" alt="SCR-20250408-nfvl"
src="https://github.com/user-attachments/assets/5ed558af-869a-4634-bbb5-80fc1481a15c "
/> | <img width="752" alt="SCR-20250408-ngcy"
src="https://github.com/user-attachments/assets/a5871af5-978b-421d-b608-12fa940a884c "
/> |
2025-04-08 14:57:30 +08:00
Jason Lee
231e8ea2db
history: Fix redo, undo chars order for Input. ( #775 )
...
Ref #469
https://github.com/user-attachments/assets/b12187cc-c778-4452-8761-63a849ef58a3
2025-04-03 21:17:17 +08:00
Jason Lee
d186bf7c9e
sidebar: Fix Sidebar details, something like icon size, remove view_id argument. ( #774 )
...
Also updated the Sidebar example to support expand multiple root items.
## Break Change
- Sidebar create not need assign parent view_id now.
2025-04-03 15:02:05 +08:00
王子凌
b016d9fff4
modal: Fix close Modal by clicking overlay to support closing layer by layer. ( #771 )
...
Fix the issue that wrongly trigger `overlay` click event for the
layer-stacked `modals`.
Fix #772
I.E. When clicking the `overlay`, only the last modal will possibly be
hide(If the last modal is not `overlayClosable`, click the overlay, all
the modals will not be hide).

I had tried another solution:


If this one is better than prev, I will commit it~
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-04-03 13:29:31 +08:00
Jakku Sakura
3051b9c1c4
dock: Fix to sync active state to panels when collapse dock. ( #770 )
...
This is a continuation of #764
Without this, if we drag webview to sidebar and collapse, webview is not
aware of itself being hidden
<img width="994" alt="image"
src="https://github.com/user-attachments/assets/6d8d66d1-2a9b-472a-a42f-d04b47aefaac "
/>
2025-04-03 13:13:29 +08:00
Jason Lee
a60acd7e4d
list: Add secondary confirm support to list. ( #769 )
2025-04-02 16:45:27 +08:00
Jason Lee
c91dce3139
input: Add max_rows to support auto-grow. ( #768 )
...
Closes #762
https://github.com/user-attachments/assets/068a3f11-8498-4db6-a2ac-00cc043f16cf
2025-04-02 15:54:19 +08:00
Jason Lee
253c93063f
input: Fix delete beginning_of_line and end_of_line to handle empty line. ( #767 )
...
https://github.com/user-attachments/assets/58ff94df-3ff7-45ae-8657-a526b3ee75f7
2025-04-02 13:41:37 +08:00
Jason Lee
e921621a8b
scrollbar: Update min thumb size to 24px. ( #766 )
...
<img width="330" alt="image"
src="https://github.com/user-attachments/assets/ace52246-65ed-4d28-9906-c16281b6bd79 "
/>
2025-04-02 11:37:19 +08:00
Jakku Sakura
4f0617e96f
example: Fix to hide WebView when switch tab. ( #764 )
...
fixes #763
it also prevent crashing on linux due to gtk not initialized
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-04-02 10:50:20 +08:00
Jason Lee
99e7f8ee70
history: Ensure unique History in redos and undos when push. ( #761 )
2025-04-01 19:35:16 +08:00
Jason Lee
ebe93210af
Use normal cursor for buttons. ( #760 )
...
This change to follow native UI to use normal cursor for all buttons,
items.
Only use `pointer` for link item.
2025-04-01 17:59:27 +08:00
Victor Quiroz
7986c2072b
sidebar: Fix menu item click handler ( #759 )
...
The sidebar stopped working properly. Only one item was handling the
click, by giving the ID to the `SidebarMenuItem` the issue seems to be
resolved. I guess something changed within `gpui` itself that it broke.
**Before**
https://github.com/user-attachments/assets/e4fd21a9-e16d-4be6-b687-64a8a040eee7
**After**
https://github.com/user-attachments/assets/aed91762-c8ae-49f3-aaa8-77df2155f0c6
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-04-01 16:41:46 +08:00
Jason Lee
88b5e5c023
input: Add mask_toggle button to toggle masked state to Input. ( #758 )
2025-03-31 22:57:07 +08:00
Jason Lee
3357197f60
example: Remove duplicate ProgressStory in main example. ( #757 )
...
Ref #740
2025-03-31 22:05:33 +08:00
Jason Lee
c310afadc6
tile: Add to support resize tile from left and top side. ( #756 )
2025-03-31 19:35:02 +08:00
Floyd Wang
f34ebdf621
theme: Update table_head_foreground ( #753 )
2025-03-31 15:12:54 +08:00
Floyd Wang
13de7d5a7e
chore: Update GPUI 2025/03/31 ( #752 )
2025-03-31 10:31:39 +08:00
Floyd Wang
417e097b1a
dock: Add tab_name for collapsed tab panels ( #751 )
2025-03-28 11:44:34 +08:00
Floyd Wang
9f103bac6f
svg_img: Use system fonts to support CJK characters ( #750 )
...
| Before | After |
| - | - |
| <img width="528" alt="SCR-20250327-mpcz"
src="https://github.com/user-attachments/assets/22dc30ea-582a-4133-996a-90bcf8cb54be "
/> | <img width="535" alt="SCR-20250327-mnbv"
src="https://github.com/user-attachments/assets/5f360d17-8285-44d8-963b-17784c4c0eb5 "
/> |
2025-03-27 14:44:04 +08:00
Jason Lee
aadcf4e1df
accordion: Fix toggle accordion item. ( #749 )
...
Close #740

2025-03-27 14:22:00 +08:00
Floyd Wang
26b59ea23e
story: Sync number input value when changed ( #748 )
...
Closed #741
https://github.com/user-attachments/assets/ec572918-a574-4adb-a8c0-c59010dc4d5e
2025-03-27 11:27:38 +08:00
Jason Lee
05fea87ec4
example: Fix modal example button id. ( #747 )
...
Ref #740
- Fix modal example button id.
- Fix switch example to allow check.
2025-03-27 11:24:06 +08:00
Jason Lee
e8f89e04d6
button: Update ButtonCustomVariant default variable value to use transparent. ( #746 )
2025-03-27 10:43:40 +08:00
Jason Lee
17926cea16
button: Add warning, success, info variant to Button. ( #745 )
...
<img width="1342" alt="SCR-20250327-jfzq"
src="https://github.com/user-attachments/assets/7c44458a-9467-4095-9cd6-1dcb35cc351b "
/>
<img width="1342" alt="SCR-20250327-jgak"
src="https://github.com/user-attachments/assets/07d33d60-f581-46d4-9a54-174e56ab82ca "
/>
2025-03-27 10:15:53 +08:00
Jason Lee
e582d22f11
sidebar: Fix collapsed to display icon only. ( #743 )
...
<img width="1056" alt="image"
src="https://github.com/user-attachments/assets/162f9e47-72ef-47c2-b3a4-9bc10682a624 "
/>
2025-03-27 09:35:01 +08:00
Angelk90
a70a0f168d
i18n: Add italian ( #738 )
2025-03-26 21:54:30 +08:00
Jason Lee
814ea0e824
alert: Add to support styled. ( #736 )
2025-03-25 15:04:28 +08:00
Jason Lee
22d9394266
alert: Add Alert. ( #735 )
...


<img width="821" alt="image"
src="https://github.com/user-attachments/assets/6350f48b-6ced-4063-b115-06422d49b92c "
/>
<img width="821" alt="image"
src="https://github.com/user-attachments/assets/3d71688a-b0ca-4223-a097-858388a47f6d "
/>
<img width="821" alt="image"
src="https://github.com/user-attachments/assets/ec3af860-0f8f-420b-9da7-f390c4742492 "
/>
<img width="821" alt="image"
src="https://github.com/user-attachments/assets/d9a85c06-209a-4ef9-ac9a-8456491fedc6 "
/>
2025-03-25 14:10:24 +08:00
Jason Lee
f650491605
menu: Add external link icon to link menu item. ( #734 )
...
<img width="403" alt="image"
src="https://github.com/user-attachments/assets/ad6682b6-2114-4f55-be84-d06c02ae401e "
/>
2025-03-24 22:30:29 +08:00
Jason Lee
e0f4a7d3cd
menu: Add label item to PopupMenu. ( #733 )
...
<img width="883" alt="image"
src="https://github.com/user-attachments/assets/06071f62-ddd3-4f9e-ae2f-82b583089792 "
/>
2025-03-24 22:04:47 +08:00
Floyd Wang
f759cc5023
calendar: Fix duplicate IDs cause click events not respond ( #732 )
2025-03-24 20:01:29 +08:00
Jason Lee
8a3b858d1a
tabs: Add menu to TabBar to display more items. ( #731 )
...
<img width="752" alt="image"
src="https://github.com/user-attachments/assets/a7efb600-553a-4b78-a8f4-aaba504d44f0 "
/>
- tabs: Use default cursor when Tab is disabled.
- popup_menu: Add to support add menu item with disabled state.
2025-03-24 18:05:54 +08:00
Floyd Wang
760c0597eb
description_list: Fix incorrect align items for horizontal layout ( #730 )
...
| Before | After |
| - | - |
| <img width="539" alt="image"
src="https://github.com/user-attachments/assets/ecd997b5-1f59-4c41-83a3-dfdee6b1be8a "
/> | <img width="556" alt="image"
src="https://github.com/user-attachments/assets/1088d466-1635-45c3-b578-9ada1c960d66 "
/> |
2025-03-24 17:15:46 +08:00
Jason Lee
12e3678e55
description_list: Update label_width type to accept any Into<DefiniteLength>. ( #729 )
2025-03-24 15:29:50 +08:00
Jason Lee
ffa36c1c5b
input: Add focused_input, has_focused_input method to Root. #727
...
Add this to save current focused Input, this used to avoid some special keybinding conflict.
For example: `/` as ToggleSearch, if on this action, we can check is there `has_focused_input` to decide to ignore or handle action.
- dock: Rename toggle button visible method.
2025-03-21 17:34:32 +08:00
Floyd Wang
9d2a70be48
svg_img: Reduce ImageSource creation ( #728 )
2025-03-21 17:22:12 +08:00
Jason Lee
393e7e8f85
story: Update layout state file location on release mode.
2025-03-21 17:17:35 +08:00
Floyd Wang
0d1c40a56a
dock: Support hide dock toggle buttons ( #726 )
2025-03-21 11:55:02 +08:00
Jason Lee
a89f971108
chore: Update GPUI 2025/03/20 and fix spawn method. ( #725 )
...
- Update `resvg`, `usvg` to 0.45.0
2025-03-20 21:23:50 +08:00
Jason Lee
c98e4f0521
checkbox: Add children to Radio, Checkbox to display long texts. ( #724 )
...
This change is going to solve the wrapped text line-height.
Before this change, the Label is must set `line-height: 100%` to render
at same line with the checkbox.
But if there have a long text in label, wrapped lines need more
line-height to leave lines spaces. But if we set line-height over the
100%, that the checkbox will not align horizontal center.
So, this change to use other child to solve this issue, we can set
line-height to the child not to the label.
<img width="1204" alt="image"
src="https://github.com/user-attachments/assets/981cf925-01c7-48d7-9dd2-881c727a1759 "
/>
2025-03-20 19:12:48 +08:00
Floyd Wang
49e8b06ccb
label: Fix typo ( #722 )
2025-03-19 14:15:49 +08:00
Jason Lee
88325ea14b
input: Add insert and replace method to Input. ( #721 )
...
Close #719
https://github.com/user-attachments/assets/aed24aef-c69f-4512-81bb-bb7e4a6de14e
2025-03-17 22:40:09 +08:00
Jason Lee
a0c7d0b791
tab: Adjust underline tab style. ( #720 )
...
<img width="1293" alt="image"
src="https://github.com/user-attachments/assets/bd0cdd71-9e83-460a-8224-f255a590f2ac "
/>
2025-03-17 21:50:39 +08:00
Floyd Wang
7442aa1fba
dock: Fixed panels will lose height when dragged to minimum ( #718 )
...
## Before
https://github.com/user-attachments/assets/c49464bf-6106-422b-b948-83c5b4c4de60
## After
https://github.com/user-attachments/assets/b83fba18-ecfd-458f-8f25-5d59a60a66cb
2025-03-14 15:55:51 +08:00
Floyd Wang
8e7ef5631e
dropdown_button: Support outline style ( #716 )
2025-03-12 17:23:37 +08:00
Jason Lee
87b8958059
modal: Use bold text for Modal title. ( #715 )
...
<img width="995" alt="image"
src="https://github.com/user-attachments/assets/3e9ba919-eb91-4e8d-ba89-3a85e263e550 "
/>
2025-03-12 11:57:59 +08:00
Jason Lee
6da7de5299
button: Improve Button to support combine outline with other variants. ( #714 )
...
<img width="1385" alt="image"
src="https://github.com/user-attachments/assets/240df695-bfd5-4680-89a2-2640db206b24 "
/>
2025-03-12 11:57:25 +08:00
Jason Lee
89170eea1d
color_picker: Add icon use icon as color picker button. ( #711 )
2025-03-11 21:14:14 +08:00
Jason Lee
d0abcb2456
switch: Fix switch label to vertical center. ( #710 )
...
<img width="775" alt="image"
src="https://github.com/user-attachments/assets/c004e552-c161-4e09-9543-13727382204b "
/>
2025-03-11 20:55:58 +08:00
Jason Lee
c2dddf6f55
input: Update gap between input and prefix, suffix. ( #709 )
...
<img width="813" alt="image"
src="https://github.com/user-attachments/assets/9d99a74a-92b6-44f5-bf33-35ddef6a7ca0 "
/>
2025-03-11 20:40:50 +08:00
Jason Lee
df94217999
tiles: Fix back panels flick when hover on top panel in tiles. ( #708 )
...
- Move resize handle out of the panel to avoid conflict with scrollbar.
2025-03-11 19:56:50 +08:00
Jason Lee
d8ec1ee516
title_bar: Fix TITLE_BAR_HEIGHT const to it actually height 34px. ( #707 )
2025-03-11 18:50:32 +08:00
Jason Lee
5e4e810c0d
description_list: Add to support border style to DescriptionList vertical layout. ( #706 )
...
<img width="899" alt="image"
src="https://github.com/user-attachments/assets/38108d88-7b27-4964-8b1d-07b81522698b "
/>
<img width="980" alt="image"
src="https://github.com/user-attachments/assets/c4467a72-0011-486b-9918-af21297b8c3e "
/>
<img width="980" alt="image"
src="https://github.com/user-attachments/assets/21e8fc31-1642-4ab4-b180-01aea6e81b38 "
/>
<img width="980" alt="image"
src="https://github.com/user-attachments/assets/65a02a85-7538-4b6f-83e5-33502c30367e "
/>
2025-03-11 17:59:56 +08:00
Jason Lee
65fad70c21
menu: Fix min_w support to PopupMenu. ( #705 )
2025-03-11 13:41:41 +08:00
Jason Lee
d451ce5c2d
menu: Add menu_element_with_icon, menu_element_with_check to PopupMenu. ( #704 )
...
- Added `menu_element_with_icon` and `menu_element_with_check` method to
PopupMenu.
<img width="317" alt="image"
src="https://github.com/user-attachments/assets/d32575e3-25fc-4d6f-bde2-ec5bc5f238dd "
/>
## Break changes
- menu: Renamed `menu_with_element` method to `menu_element`.
2025-03-11 11:18:43 +08:00
Jason Lee
6a00cfcc4a
text_view: Fix HTML render to support blockquote. ( #703 )
...
<img width="850" alt="image"
src="https://github.com/user-attachments/assets/4d8f662f-aebe-4c40-bc56-828627f16064 "
/>
2025-03-10 22:53:53 +08:00
Floyd Wang
81e6da503b
chore: Remove unused feature ( #702 )
2025-03-10 22:17:27 +08:00
Jason Lee
61bb78d174
tab: Update default tab size padding x to match with Panel's padding. ( #701 )
...
- Fix muted_foreground in dark mode.
- Fix secondary button active color in dark mode.
- Fix to ensure render last empty space when TabBar have suffix.
<img width="1203" alt="image"
src="https://github.com/user-attachments/assets/65144893-6705-4087-87f3-7e478eaa1405 "
/>
<img width="1203" alt="image"
src="https://github.com/user-attachments/assets/0fe3b72b-11f5-4917-959c-a2c88ba0213c "
/>
2025-03-10 21:23:00 +08:00
Jason Lee
54d74a9617
kdb: Add min width 20px to Kdb. ( #700 )
...
<img width="358" alt="image"
src="https://github.com/user-attachments/assets/824a0cdd-e03b-49f4-bde6-b77ae0ab48cd "
/>
2025-03-10 17:12:43 +08:00
Jason Lee
4db0fd5819
kbd: Use background for Kbd. ( #699 )
2025-03-10 17:03:41 +08:00
Jason Lee
3e4a3ed046
tag: Add color to Tag to support more colors. ( #698 )
...
- Add `ColorName` enum.
<img width="588" alt="image"
src="https://github.com/user-attachments/assets/20670946-1a4f-45ff-b5ac-81e7eb760242 "
/>
<img width="586" alt="image"
src="https://github.com/user-attachments/assets/7ce4a87f-fa6b-4794-83c5-3f18e6d09dcb "
/>
2025-03-07 21:41:04 +08:00
Jason Lee
4c9c7980ee
chore: Upgrade GPUI 2025/03/07 ( #697 )
2025-03-07 20:22:58 +08:00
Jason Lee
8f2ca40c51
tab: Add new pill style, renamed old pill tab to outline. ( #696 )
...
<img width="1011" alt="image"
src="https://github.com/user-attachments/assets/4800a737-4e57-405b-b083-bf57ae3038ad "
/>
## Break Changes
- As you see on the above screenshot, the old `pill` style has been
renamed to `outline`.
2025-03-07 18:46:47 +08:00
Jason Lee
8611a23aae
kbd: Add Kdb to show keystroke. ( #695 )
...
<img width="627" alt="image"
src="https://github.com/user-attachments/assets/c2a6f385-8820-4629-be57-bb5958e531ce "
/>
2025-03-07 14:29:50 +08:00
Jason Lee
c5416c4774
menu: Fix sub-menu render position. ( #694 )
...
<img width="385" alt="image"
src="https://github.com/user-attachments/assets/2e8527af-08af-4176-b4cf-931f79b6d45c "
/>
2025-03-07 11:47:27 +08:00
Jason Lee
bf1420357b
icon: Fix icon to support style size. ( #693 )
2025-03-07 10:52:57 +08:00
Jason Lee
3a4f442945
tab: Keep last empty when suffix exist. ( #692 )
2025-03-06 19:38:45 +08:00
Jason Lee
c9c6449d24
toggle: Add Toggle and ToggleGroup. ( #691 )
...
- Improve `Icon` to inherit parent element font size by default.
<img width="777" alt="image"
src="https://github.com/user-attachments/assets/1a0ee94e-46ef-4b02-9538-09880586d3f2 "
/>
<img width="777" alt="image"
src="https://github.com/user-attachments/assets/4ecb016f-2e7c-4266-9a25-eae2566b2844 "
/>
2025-03-06 19:10:28 +08:00
Jason Lee
d009b37bf1
tab: Add tab_bar_segemented theme variable. ( #690 )
2025-03-05 19:07:58 +08:00
Floyd Wang
9194d7f6bb
popup_menu: Ensure focus is returned after menu is closed ( #689 )
2025-03-05 16:41:43 +08:00
Jason Lee
4c96679cf7
tab: Improve segmented tab style and add for icon mode tab support. ( #688 )
...
<img width="873" alt="image"
src="https://github.com/user-attachments/assets/f616a9ba-0a60-49f5-8291-04f79f5b582c "
/>
<img width="948" alt="image"
src="https://github.com/user-attachments/assets/5ba1b50e-5b5f-45e1-89ca-683bcac8331a "
/>
<img width="929" alt="image"
src="https://github.com/user-attachments/assets/6545b67f-6c53-482f-a3ac-b7929c9bec99 "
/>
<img width="1153" alt="image"
src="https://github.com/user-attachments/assets/06abb411-43a7-4472-8e58-d7c8032bed7b "
/>
2025-03-05 15:41:03 +08:00
Jason Lee
6bf26f6f72
scrollbar: Update Scrollbar default to use hover to show on Linux. ( #687 )
...
Continue #686
2025-03-05 10:34:16 +08:00
Jens Krause
c06a0c5d78
scrollbar: Fix Scrollbar not clickable when it is always showing. ( #686 )
...
On `platform` level,
[should_auto_hide_scrollbars()](76a81607de/crates/gpui/src/platform.rs (L205) )
might be `false` for some `platform`s, e.g. for `Linux`.
That's why another check is needed to make scrollbars work properly on
Linux.
Fixes #685
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-03-05 10:14:22 +08:00
Jason Lee
c3f08d52b9
text_view: Add syntax highlight to CodeBlock. ( #684 )
...
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/e7539df4-20db-431b-9bbc-52e08e9de062 "
/>
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/85d52319-1029-4306-8629-ec0321d0571b "
/>
2025-03-04 21:50:50 +08:00
Jason Lee
8c4884d881
tab: Remove w_full from TabBar. ( #683 )
2025-03-04 17:31:40 +08:00
Floyd Wang
f8a530279a
dock: Fix incorrect extra inner padding in Panels. ( #682 )
2025-03-04 17:22:17 +08:00
Jason Lee
6c9a317b3b
scrollbar: Fix scroll to show scrollbar. ( #681 )
...
Fix #624 was broke scroll to show behaviors.
2025-03-04 15:37:13 +08:00
Jason Lee
581d92378c
tab: Add xsmall, large style to Tab. ( #680 )
...
<img width="1047" alt="image"
src="https://github.com/user-attachments/assets/763fc4c9-bda8-4292-83c5-4a44db091938 "
/>
<img width="1047" alt="image"
src="https://github.com/user-attachments/assets/e21d5344-f31c-43b3-af6b-28d845af77f8 "
/>
<img width="1047" alt="image"
src="https://github.com/user-attachments/assets/3da37f16-55aa-44b3-98c2-4cadfae458b3 "
/>
<img width="1047" alt="image"
src="https://github.com/user-attachments/assets/cfbb1f7e-c810-4387-b7dc-d1d2870d50a6 "
/>
2025-03-04 10:26:12 +08:00
Jason Lee
793a35eff2
text_view: Fix img height in TextView. ( #679 )
...
Close #643
<img width="1103" alt="image"
src="https://github.com/user-attachments/assets/0f0a0af0-8fe2-4322-b012-0f970ba9e13d "
/>
Ref https://github.com/zed-industries/zed/pull/25632
2025-03-03 20:51:26 +08:00
Jason Lee
c4331c9419
tab: Improve TabBar API. ( #678 )
...
- Fixed scroll support for TabBar.
- Remove `id` argument from Tab, it will set from TabBar iter.
- Add `id` to TabBar to ensure scroll_handle state will store correct.
- Update `label` argument of Tab, to use `impl Into<SharedString>` type
for better use.
- Added `child` to Tab for render custom element as label.
2025-03-03 19:48:28 +08:00
Jason Lee
bc89ce2536
tab: Add to support string children for TabBar. ( #677 )
...
## Break changes
- Removed `id` argument from `TabBar::new` method.
2025-03-03 17:34:17 +08:00
Jason Lee
1aa43b1bfe
tab: Add Pill, Segmented, Underline style Tab and complete the Tab API. ( #676 )
...
<img width="985" alt="image"
src="https://github.com/user-attachments/assets/3d3860ff-ac7c-459a-bb6e-d0ea09b8eac8 "
/>
<img width="936" alt="image"
src="https://github.com/user-attachments/assets/abb39b8f-4139-4f41-9c12-2a22f767bec0 "
/>
<img width="985" alt="image"
src="https://github.com/user-attachments/assets/9fccce5f-8da5-4c78-8679-1a85dcfc56f0 "
/>
Run example:
```
cargo run --example tabs
```
2025-03-03 17:09:52 +08:00
Jason Lee
76efa2715b
tiles: Fix panels get item out of bound error when removed some panel. ( #675 )
2025-02-28 18:53:25 +08:00
Jason Lee
9732c3b7e8
tiles: To support close panel. ( #674 )
...
- Add `remove_panel` method to DockArea.
2025-02-28 18:36:58 +08:00
Jason Lee
5cf11ffe1b
tiles: Remove cursor style on Tile's title. ( #673 )
2025-02-28 16:57:01 +08:00
Jason Lee
7eaac7b171
chore: Update TabPanel closable doc. ( #672 )
2025-02-28 15:40:33 +08:00
Jason Lee
42c82bfc31
story: Rename closeable to closable. ( #671 )
2025-02-28 14:33:30 +08:00
Jason Lee
7582ad3fb3
text_view: Add heading_base_font_size to TextViewStyle and fix text wrap for list item. ( #670 )
...
- Fix list item to wrap text.
<img width="797" alt="image"
src="https://github.com/user-attachments/assets/9e8156ad-bf58-4d7a-a850-69dfcb56c850 "
/>
2025-02-28 11:43:08 +08:00
Jason Lee
e443a219be
panel: Add title_suffix to panel and write a custom container panel example. ( #669 )
...
- Add to support `xsmall` size for TextInput.
- Add `global`, `global_mut`, `build_panel` static method to
`PanelRegistry`.
<img width="1011" alt="image"
src="https://github.com/user-attachments/assets/1a6e61c4-502a-4d1c-a4ea-2644777fd4d8 "
/>
2025-02-27 14:52:28 +08:00
Floyd Wang
e61f6204cc
calendar: Differentiate text color of disabled and non-current month ( #668 )
...
| Before | After |
| - | - |
| <img width="341" alt="image"
src="https://github.com/user-attachments/assets/452d57b1-5ec6-4ad3-bc30-ed8a966d12e5 "
/> | <img width="350" alt="image"
src="https://github.com/user-attachments/assets/9f664cea-aa55-479a-8d5b-61570101a66f "
/> |
2025-02-27 11:14:28 +08:00
Jason Lee
3ba63915ce
text_view: Fix some case may lose spaces, <br> in HTML and Markdown render. ( #667 )
2025-02-26 17:52:18 +08:00
Jason Lee
ffa848fb26
text_view: Fix markdown table alignment. ( #666 )
2025-02-26 15:49:13 +08:00
Jason Lee
6a125b391e
chore: Update example images in Markdown and HTML examples. ( #664 )
2025-02-26 15:26:22 +08:00
Jason Lee
98625edf01
tiles: Fix active_panel method to returns actually Panel view, avoid return TabPanel. ( #665 )
...
- Limit `add_item` only allows TabPanel type.
- Export `items` method in DockArea.
2025-02-26 11:33:58 +08:00
Jason Lee
00e5385878
input: Add h, h_full to Input for multi-line mode. ( #642 )
...
Close #641
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/9cbe090c-a5d7-4929-98db-5f71349fe559 "
/>
2025-02-25 16:17:39 +08:00
Jason Lee
c74791aac8
description_list: Add DescriptionList. ( #658 )
...
<img width="1089" alt="image"
src="https://github.com/user-attachments/assets/15069422-14aa-4fa3-b661-65fcf7417323 "
/>
<img width="1089" alt="image"
src="https://github.com/user-attachments/assets/df4a4b90-b304-40d3-a9ce-1be73eaaa9f4 "
/>
<img width="1089" alt="image"
src="https://github.com/user-attachments/assets/1deaf1e8-4b30-4afd-90af-1bd0eecf53e2 "
/>
2025-02-25 15:32:59 +08:00
Floyd Wang
dc4d7e614c
dock: Panel trait set_zoomed with mutable window and cx ( #661 )
...
Need Update panel functions to mutable `self`, `window` and `cx`.
2025-02-25 14:34:49 +08:00
Jason Lee
9f429592ce
text_view: Remove last paragraph bottom margin. ( #660 )
...
Now, we can be easy to use TextView for 1 line text.
## Break Changes
- Removed `inline` method by previous #649 added, this is not needed.
2025-02-25 14:27:59 +08:00
Floyd Wang
f75f96f135
dock: Panel trait set_active with mutable window and cx ( #659 )
2025-02-25 14:15:42 +08:00
Jason Lee
8edd80d5ee
modal: Do not occlude when overlay is not enable. ( #657 )
2025-02-25 12:25:46 +08:00
Jason Lee
806c6dffe8
tiles: Add active_panel method to Tiles. ( #656 )
2025-02-25 12:00:43 +08:00
Ylin
6d7f20cd4f
webview: Update visible state when hide or show ( #654 )
2025-02-25 11:49:29 +08:00
Floyd Wang
9739493bce
dock: Add mutable reference for set_active ( #655 )
2025-02-25 11:46:54 +08:00
Jason Lee
3b4065ce4e
text_view: Stop propagation on click link in TextView. ( #650 )
...
To avoid trigger parent element, for example as a Label for checkbox.
2025-02-24 18:07:53 +08:00
Jason Lee
6bcc34c7f0
checkbox, switch: Improve Checkbox, Switch to use wrap text and TextView. ( #651 )
...
This change to revert #233 to let label to wrap.
<img width="1279" alt="image"
src="https://github.com/user-attachments/assets/8081216f-0ea0-4ba2-9095-6fd84102e03b "
/>
2025-02-24 18:04:06 +08:00
Jason Lee
8fa210bc21
text_view: Update Switch, Checkbox, Radio to let label method support TextView. ( #649 )
...
- Add `style` method to TextView.
- Add `inline` method to TextView to use default inline style.
2025-02-24 15:49:54 +08:00
Jason Lee
9dade704fb
webview: Let webview as a feature and not default enable. ( #648 )
...
Close #646
2025-02-24 14:24:22 +08:00
Jason Lee
d54dcdf417
text_view: Refactor TextView to RenderOnce to easy usage. ( #647 )
2025-02-24 14:13:50 +08:00
ihavecoke
c303b84303
dock: Add item to tiles layout should use default TabPanel view ( #645 )
2025-02-23 22:22:27 +08:00
ihavecoke
03d5f83a83
dock: Implement core panel addition logic for tiling layout ( #644 )
2025-02-20 21:20:59 +08:00
Jason Lee
06f9178ec4
text: Add TextView with Markdown and Simple HTML support. ( #639 )
2025-02-20 20:08:59 +08:00
ihavecoke
6c39078e8a
dock: Add drag drop event for tiles ( #640 )
2025-02-19 22:20:48 +08:00
Jason Lee
75212c3aba
chore: Fix focusd_border typo in #635 ( #637 )
2025-02-17 17:29:40 +08:00
Jason Lee
c62be93da6
panel: Reduce tool buttons gap from 8px to 4px. ( #636 )
...
<img width="314" alt="image"
src="https://github.com/user-attachments/assets/eab5f4f8-b604-4c5c-bfd4-2535340b1d1e "
/>
And use `selected` style for zoom button when zoomed:
<img width="114" alt="image"
src="https://github.com/user-attachments/assets/fa11ec81-a4db-42ea-8edc-39ed8ad40ba1 "
/>
2025-02-17 14:46:44 +08:00
Jason Lee
4c554580c9
chore: Rename outline styled method to focused_border. ( #635 )
...
This change to avoid conflict with `outline` method in Button.
## Break changes:
- The `outline` method in `StyledExt` now renamed to `focused_border`.
2025-02-17 14:34:54 +08:00
Jason Lee
d96b4b44d2
number_input: Fix button margin. ( #634 )
2025-02-17 14:29:33 +08:00
Jason Lee
231772ee4e
modal: Remove opacity animation for improve Modal appear. ( #633 )
2025-02-17 13:32:17 +08:00
Jason Lee
2c377985bb
tiles: Limit panel x to out of bounds, but keep retaining 64px. ( #632 )
...
- Adjust `tile_grid_size` default to `8px`.
- Fix unexpected scroll size by `-1px` design.
2025-02-17 11:51:10 +08:00
Jason Lee
d446c0e7b3
tile: Add to support setup tiles background color, tile_shadow, tile_grid_size. ( #631 )
2025-02-17 10:49:26 +08:00
Jason Lee
e4c31f1ce4
tiles: Limit tile panel move to avoid out of the container. ( #630 )
2025-02-17 10:24:06 +08:00
Jason Lee
b18dd47ce0
panel: Only highlight resize handle when dragging. ( #629 )
2025-02-14 18:42:56 +08:00
Jason Lee
851099f890
sidebar: Refactor Sidebar API to avoid map call will segmentation fault on release. ( #628 )
...
Close #471
```
Finished `release` profile [optimized] target(s) in 9.99s
Running `target/release/examples/sidebar`
[1] 30606 segmentation fault cargo run --example sidebar --release
```
This may cause by used `map` break by maybe Rust compiler bug, I
detected that if I remove a `map`, then the crash will gone.
So, this changes to refactor the Sidebar API to avoid use `map`.
2025-02-14 17:18:39 +08:00
Jason Lee
0ebedbe79f
chrome: Refactor state fields to remove is_ prefix. ( #627 )
2025-02-14 15:20:18 +08:00
Jason Lee
bf300a2880
sidebar: Fix sidebar example and add right side example. ( #626 )
2025-02-14 15:06:37 +08:00
Jason Lee
cca6277ea5
example: Add modal example. ( #625 )
...
```
cargo run --example modal
```
2025-02-14 14:44:26 +08:00
Jason Lee
6e2bb3fb58
scrollbar: Update scrollbar hitbox to it bounds, not fill the full of parent view. ( #624 )
...
And revert some #621 wrong changes for hover to show scrollbar.
2025-02-14 13:54:02 +08:00
Floyd Wang
c7257d36cf
calendar: Add Matcher for disabled dates ( #623 )
...
| Day Of Week | Interval | Range |
|--------------|---------|-------|
| <img width="420" alt="image"
src="https://github.com/user-attachments/assets/e23f69b8-3191-4370-8adf-266362680e5c "
/> | <img width="264" alt="image"
src="https://github.com/user-attachments/assets/c211d7c3-9878-402e-a6cc-e3ac1b50e588 "
/> | <img width="337" alt="image"
src="https://github.com/user-attachments/assets/2b894ef1-14d0-4fc3-89e5-4e38b5e8572c "
/> |
2025-02-13 17:43:19 +08:00
Jason Lee
83375147fe
panel: Improve resize handle to show highlight color on dragging. ( #622 )
...
https://github.com/user-attachments/assets/aabbd73b-3c11-43e2-a4f2-121d46fba1d7
2025-02-13 16:07:00 +08:00
Jason Lee
437f1b2098
theme: Add to support always show scrollbar mode and default to match with system style. ( #621 )
...
Close #573
- Fix theme settings to keeping when switch theme mode.
2025-02-12 15:15:33 +08:00
Floyd Wang
d95cbabcc3
dropdown: Do not reset the selected index when cancelling ( #618 )
...
## Before
https://github.com/user-attachments/assets/e33c2324-94f0-42b0-99cc-9e2dcdee3f3d
## After
https://github.com/user-attachments/assets/7c5c6fee-b0f6-4cd5-986e-ea8f6f0e7f9d
2025-02-11 18:54:52 +08:00
Jason Lee
0050685a58
chore: Avoid some unnecessary window.refresh call. ( #617 )
...
Ref
https://github.com/zed-industries/zed/discussions/24260#discussioncomment-12135749
2025-02-11 17:06:17 +08:00
Jason Lee
4a26776289
label: Avoid String alloc and remove custom text-align. ( #616 )
...
Reverted #615 and recreate again.
## Break changes
- Remove `TextAlign` and `text_left`, `text_right` ... method from
label, we can use same things from GPUI.
<img width="1151" alt="image"
src="https://github.com/user-attachments/assets/95e9066a-e58d-47a8-9acf-b483b0203b1b "
/>
2025-02-11 10:30:45 +08:00
Floyd Wang
44e678b9bc
dock: Make the panel inner padding controllable ( #613 )
2025-02-10 17:55:57 +08:00
Floyd Wang
cd9c88a0f7
dock: Leave some space between the tabs title and panel ( #612 )
...
## Before
<img width="541" alt="image"
src="https://github.com/user-attachments/assets/a41390ec-a86b-4ca2-bcf4-a2b368c1e2e0 "
/>
## After
<img width="518" alt="image"
src="https://github.com/user-attachments/assets/0896abe5-d499-4052-aa84-0864029c0346 "
/>
2025-02-10 15:55:08 +08:00
Jason Lee
7ceae0acff
Revert "dock: Revert AnyView cached ( #607 )" ( #611 )
...
This reverts commit 2479fc3418 .
> NOTE: When we enabled this, we need make sure call `cx.nofity()` when
the data has been updated.
In real world application, this may reduce about 3% CPU cost.
<img width="550" alt="image"
src="https://github.com/user-attachments/assets/9188cde9-3402-4860-9e03-328aa74a74e7 "
/>
> I watched this data about 5 minutes, the CPU cost is always like this.
2025-02-10 14:09:09 +08:00
Jason Lee
a5db381ef4
chore: Upgrade GPUI 2025/02/10 ( #610 )
...
- Replace `Window::parent_view_id()` with `Window::current_view()`
https://github.com/zed-industries/zed/pull/24212
- Fix SvgImg crash by move `use_asset` to `request_layout`.
- Fix Input to implement `character_index_for_point` method
https://github.com/zed-industries/zed/pull/23989
- Fix Input IME position to under the cursor line.
<img width="504" alt="image"
src="https://github.com/user-attachments/assets/8a6f56c8-6aae-4c0c-8c5a-3959d6a9d224 "
/>
- Fix Input overflow sub crash.
2025-02-10 11:53:25 +08:00
Jens Krause
b1bae7ca21
color_picker: Fix popup does not close by clicking color button again. ( #608 )
2025-02-09 11:07:46 +08:00
Jens Krause
a6922e3a10
example: Fix tiles needs package gpui-component ( #609 )
2025-02-08 23:43:37 +08:00
Floyd Wang
2479fc3418
dock: Revert AnyView cached ( #607 )
...
* This may cause the interface to not update in real time.
2025-02-07 10:22:29 +08:00
Jason Lee
2e3f3dd669
scrollbar: Add max_fps to limit drag scroll update rate for reduce CPU usage. ( #604 )
...
And set Table to use 60 FPS.
2025-02-07 10:07:47 +08:00
Floyd Wang
abb3de013e
Rename package from ui to gpui-component ( #606 )
...
## 🚨 Break Change
Update dependencies from `ui` to `gpui-component`.
2025-02-06 17:21:46 +08:00
Floyd Wang
e423497da6
tooltip: Support render element ( #605 )
...
<img width="376" alt="image"
src="https://github.com/user-attachments/assets/52793001-03cb-46ca-80a3-42aa3db57ecb "
/>
2025-02-06 16:05:44 +08:00
Jason Lee
99a4c793c5
chore: Update crate name to gpui-component for publish crate to hold the name. ( #603 )
2025-02-06 11:57:34 +08:00
Jason Lee
bc579c0b93
table: Fix Table subtract with overflow error. ( #602 )
...
```
thread 'main' panicked at gpui-component-f2cfc37a601d48ab/dffb419/crates/ui/src/[table.rs:1562](http://table.rs:1562/ ):45:
attempt to subtract with overflow
stack backtrace:
```
2025-02-05 19:26:19 +08:00
Jason Lee
9675f1e02b
dock: Add cache to panel view. ( #600 )
2025-02-05 17:23:40 +08:00
Jason Lee
3e16c0d220
chore: Remove reexport prelude. ( #599 )
...
This is useless, we can just use `gpui::prelude`, so I removed it.
## Break changes
- The `ui::prelude` has been removed, you can replace by use
`gpui::prelude`.
2025-02-04 17:37:28 +08:00
Jason Lee
155f2ee3b9
chore: Refactor ClearButton to as method. ( #598 )
2025-02-04 17:34:26 +08:00
Jason Lee
dffb419145
chore: Fix subscriptions leak. ( #597 )
2025-02-04 15:43:26 +08:00
Jason Lee
3ffbbb0688
theme: Ensure all elements to use radius. ( #596 )
...
- Fix menu dispatch action.
2025-02-03 19:03:16 +08:00
Jason Lee
eaec664a8d
theme: Add doc for Theme variables. ( #595 )
...
## Break change
- Removed unused `cx.theme().panel` variable.
2025-02-03 17:03:15 +08:00
Jason Lee
85c6872e68
input: Use closest_index_for_position from GPUI. ( #593 )
2025-02-03 15:03:31 +08:00
Jason Lee
8e931bd862
list: Avoid duplicate active item background. ( #594 )
2025-02-03 14:55:51 +08:00
Jason Lee
7539e6d44c
input: Fix Input to vertical center the mask chars. ( #590 )
...
Close #467
Windows:
<img width="397" alt="image"
src="https://github.com/user-attachments/assets/0a185b42-1432-404a-b889-da1143706035 "
/>
macOS:
<img width="510" alt="image"
src="https://github.com/user-attachments/assets/ed186552-862b-404e-96dc-b0f3a0b552d6 "
/>
2025-01-30 10:54:02 +08:00
Jason Lee
43f529c6d2
input: Add to support move, select and delete by word. ( #591 )
...
Close #466
https://github.com/user-attachments/assets/48cda905-f2bf-4896-b3ae-08b7cd61467d
2025-01-30 10:47:11 +08:00
Jason Lee
6fa1888ee6
chore: Upgrade for GPUI API changes. ( #589 )
2025-01-29 16:49:17 +08:00
Jason Lee
327d40e0e0
chore: Upgrade GPUI 3 ( #587 )
...
The pervious version has keep on
[gpui2](https://github.com/longbridge/gpui-component/tree/gpui2 ) branch,
if there need to use.
Ref https://github.com/zed-industries/zed/pull/22632
## Prepare
### Generate index.scip
```bash
rust-analyzer scip ./ > index.scip
```
### Get [refactor](https://github.com/zed-industries/refactor )
```bash
https://github.com/zed-industries/refactor.git
```
## Refactor exist code
```bash
cd refactor
cargo run -- ~/work/gpui-component
```
Then will get result if successed:
```
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.03s
Running `target/debug/refactor /Users/jason/work/gpui-component`
Loaded 115 SCIP documents
Processing files starting with focus path: ""
Changed 90 files
```
-------------
## Changes
```diff
- View<T>
- Model<T>
+ Entity<T>
- WeakView<T>
+ WeakEntity<T>
- FocusableView
+ Focusable
- cx.bounds()
+ window.bounds()
- cx.refresh()
+ window.refresh()
- cx.focused()
+ window.focused(cx)
- cx.with_optional_element_state
- window.with_optional_element_state
```
```diff
- &mut WindowContext
+ &mut Window, &mut App
- cx: &mut WindowContext
+ window: &mut Window, cx: &mut App
- &mut ViewContext<
+ &mut Window, &mut Context<
- cx: &mut ViewContext<
+ window: &mut Window, cx: &mut Context<
```
```diff
- cx.spawn(|_, mut cx| async move {
+ cx.spawn_in(window, |_, mut cx| async move {
- cx.dispatch_action(Box::new(...))
+ window.dispatch_action(Box::new(...), cx)
```
`cx.spawn`
```diff
- cx.spawn(|view, mut cx| async move {
+ cx.spawn_in(window, |view, mut window| async move {
+ _ = view.update_in(&mut window, move |view, window, cx| {
```
2025-01-27 03:58:48 +08:00
Jason Lee
8d0773fc62
chore: Remove typo println debug info in Input.
2025-01-27 03:54:06 +08:00
Jason Lee
e658aeee96
table: Improve sort icon color and fix stripe row display. ( #578 )
...
- Improve sort icon color:
<img width="139" alt="image"
src="https://github.com/user-attachments/assets/6374c26a-4555-4735-953b-dbd961fe5b31 "
/>
- Avoid duplicate border when enabled fixed column.
<img width="587" alt="image"
src="https://github.com/user-attachments/assets/6e186d29-5d8a-404e-b160-20c2af6a16fa "
/>
TODO
- [x] The extra rows not show when `stripe` is true.
2025-01-26 16:25:34 +08:00
Jason Lee
649e765729
story: Add TitleBar to examples. ( #586 )
2025-01-26 15:07:34 +08:00
Jason Lee
71de5dd882
input: Fix position cursor in multi-line mode. ( #583 )
...
Close #581
Ref https://github.com/zed-industries/zed/pull/23668
https://github.com/user-attachments/assets/c69d098e-d2cb-4053-b739-6c7dd666e769
2025-01-26 14:12:08 +08:00
Jason Lee
852ce923ae
input: Update carret style. ( #585 )
...
- 1px width.
- Add `cx.theme.carret` variable for color and default use foreground
color.
- Reduce height to match with font size.
https://github.com/user-attachments/assets/d16a51eb-2c9a-4586-8b0d-67922a738002
2025-01-26 14:11:51 +08:00
Jason Lee
cd613db6d6
number_input: Improve NumberInput to better handle mouse down position cursor and fix sizable API. ( #582 )
...
Close #579
- Leave some space before the Input to support mouse down to position
cursor at start of line.
- Fix to match with size appearance.
- Keep padding left and right to Input, even setup `appearance: false`.
## Break Changes
- The `xlarge`, `large`, `small`, `xsmall` ... method has been moved to
use `ui::Sizable` trait to same as other component.
2025-01-24 23:39:19 +08:00
Jason Lee
68de692290
input: Fix to position cursor at correct offset on mouse down or select. ( #580 )
...
Ref: https://github.com/zed-industries/zed/pull/23603
---
## TODO
Here still have a little bug in multiple lines and soft wrapped line.
Only the first line can get correct position, the wrapped line is always
got the offset +1, so the first char of that soft wrapped line, we can't
position the cursor at the first.
2025-01-24 22:57:24 +08:00
Jason Lee
1689f4208f
table: Add measure to table. ( #577 )
...
- Improve to not calc extra rows if `stripe` not enable.
- Improve to not change offset, when scrollbar drag changed less than
1px.
- Improve render cells to use `Vec::with_capacity` to prepare enough
space.
```bash
ZED_MEASUREMENTS=1 MTL_HUD_ENABLED=1 cargo run --release --example table
```
2025-01-24 18:59:01 +08:00
Jason Lee
86db990b51
chore: Add #[inline] to util methods. ( #576 )
2025-01-24 15:34:57 +08:00
Floyd Wang
7aade44e7a
dock: Fix the tab panel cannot fill the entire height ( #575 )
...
## Before
<img width="411" alt="image"
src="https://github.com/user-attachments/assets/8801361d-20fd-4ba5-8b9e-bb18f6e8cc5a "
/>
## After
<img width="410" alt="image"
src="https://github.com/user-attachments/assets/91975382-5ed1-45a4-acd2-a131d2a162f5 "
/>
2025-01-24 15:28:51 +08:00
Jason Lee
878a51e5a9
example: Split single examples. ( #574 )
...
```bash
cargo run --example table
cargo run --example list
```
2025-01-24 11:13:24 +08:00
Jason Lee
1dba2b6c70
input: Fix mouse click to position cursor to before of the char. ( #572 )
2025-01-23 20:46:52 +08:00
Jason Lee
77badb5799
radio: Add RadioGroup. ( #571 )
...
<img width="1265" alt="image"
src="https://github.com/user-attachments/assets/7ff51cb8-0aad-4d7d-a80a-e97c572c468a "
/>
2025-01-23 20:13:01 +08:00
Floyd Wang
1ff84a9943
popup_menu: Add max_h to set the height of menu ( #570 )
2025-01-23 18:43:34 +08:00
Jason Lee
e03a0d4f4e
chore: Fix Switch, Radio, Checkbox to use inline layout. ( #569 )
2025-01-23 18:05:32 +08:00
Floyd Wang
07b12b726c
number_input: Do not trigger step event when the input is disabled ( #568 )
2025-01-23 16:31:33 +08:00
Jason Lee
a89e2430d3
form: Add Form and FormField. ( #565 )
...
<img width="899" alt="image"
src="https://github.com/user-attachments/assets/842dac65-36c3-4f3a-b55a-59d204d9a93c "
/>
<img width="901" alt="image"
src="https://github.com/user-attachments/assets/616b7a3a-4a84-4d27-b554-63ebd5213ad7 "
/>
2025-01-23 16:09:50 +08:00
Jason Lee
4028f46cb9
date_picker: Avoid focus back to DatePicker, when dismiss picker by clicked on Input. ( #567 )
2025-01-23 11:52:58 +08:00
Jason Lee
78ce573a52
list, table: Refactor to control loading by use delegate. ( #562 )
...
- Add `loading` method to `ListDelegate` and `TableDelegate` to control
loading view display.
## Break Changes
- Remove `loading`, `set_loading` method from List and Table, use
`loading` method in delegate instead.
2025-01-21 20:33:37 +08:00
Jason Lee
9f2cd84b23
color: Add mix method and merge ColorExt to Colorize. ( #561 )
...
- Add `mix` method to mix two color.
- Export `ui::theme::*` to crate root, before `use
ui:theme::ActiveTheme` to `use ui::ActiveTheme`.
## Break Changes
- Moved `ui::theme::Colorize` to `ui::Colorize`.
- Merged `ColorExt` to `Colorize`.
- Renamed `to_hex_string` to `to_hex`, `parse_hex_string` to
`parse_hex`.
2025-01-21 18:31:01 +08:00
Jason Lee
73c92f3a6b
input: Fix crash cause by incorrect selected range. ( #560 )
...
The `selected_range` should be UTF-8.
2025-01-21 11:49:36 +08:00
Jason Lee
493acdefab
story: Fix story and merge checkbox, radio to switch story.
2025-01-21 10:43:10 +08:00
Jason Lee
20feab5f40
modal: Add confirm Modal with default Ok, Cancel buttons. ( #558 )
...
<img width="581" alt="image"
src="https://github.com/user-attachments/assets/ad53fb63-f3be-41e6-90c0-f03cba48c4db "
/>
- Added `overlay_closable` method to Modal to control overlay click to
close modal.
- Added `on_ok`, `on_cancel` callback method.
- Added `confirm` to setup to use default confirm style (With a Ok,
Cancel button).
## Break Changes
- The `footer` method has been changed to with a fn not a element.
2025-01-20 17:42:05 +08:00
Jason Lee
ad04b699fc
clipboard: Add value_fn to get copy value with callback to Clipboard. ( #557 )
2025-01-20 15:54:27 +08:00
Jason Lee
355dfa5556
slider: Add vertical and reverse support to Slider. ( #556 )
...
- Fix to support stop at any position.
- Fix click bounds.
2025-01-20 15:22:28 +08:00
Floyd Wang
06e9b1a25c
dropdown_button: Add compact style ( #555 )
2025-01-20 13:49:42 +08:00
Floyd Wang
bd3cdd7167
dropdown_button: Add more style preferences ( #554 )
2025-01-17 16:24:46 +08:00
Jason Lee
4fa8b9d65c
list: Fix #552 broken move down to select first item. ( #553 )
2025-01-17 16:19:03 +08:00
Jason Lee
f41edfd318
list: Add ListEvent to List. ( #552 )
...
- Add `ListEvent` and emit event for List with `Select`, `Confirm`,
`Cancel` events.
## Break Changes
- Removed useless `ListDelegate::confirmed_index` method.
- Updated `ListDelegate::confirm` method, to change `ix: Option<usize>`
to `ix: usize`.
2025-01-17 16:00:28 +08:00
Floyd Wang
569a4e7262
dropdown_button: Add new component ( #551 )
...
## Regular
<img width="162" alt="image"
src="https://github.com/user-attachments/assets/4e597d0b-41d1-4b0e-9939-728cae71fe65 "
/>
## Active
<img width="162" alt="image"
src="https://github.com/user-attachments/assets/0871ed6b-3188-44dd-93d4-5996f9213edc "
/>
<br />
<img width="162" alt="image"
src="https://github.com/user-attachments/assets/b05ccdc6-e405-47d0-97e7-470afadbbd38 "
/>
## Break Change
Move `ButtonGroup` into the `button`.
2025-01-17 14:16:24 +08:00
Jason Lee
04d720f3a7
chore: Improve Table, List load more threshold, and avoid duplicate request. ( #550 )
...
- Default `threshold` changed to 20.
2025-01-17 11:25:41 +08:00
Floyd Wang
0312e47554
input: Move number input into input ( #549 )
2025-01-17 10:07:41 +08:00
Jason Lee
8dca96469e
chore: Update GPUI with MSAA and PathBuilder. ( #548 )
2025-01-15 16:52:03 +08:00
Jason Lee
a0f6b48eff
chore: Update GPUI 2025/01/14 ( #547 )
2025-01-14 19:21:04 +08:00
Jason Lee
7848311046
list, table: Add default loading animation to List and Table. ( #546 )
...
<img width="485" alt="image"
src="https://github.com/user-attachments/assets/568cbf3a-6e32-4b21-8816-5e3cb26acc82 "
/>
<img width="755" alt="image"
src="https://github.com/user-attachments/assets/5e13d6b8-e6f4-4cc3-b1f6-9b378ff523a4 "
/>
2025-01-14 11:36:33 +08:00
ihavecoke
1d18edef12
list: Allow disabling List selection. ( #545 )
...
## Break changes
- Renamed list `enable_scrollbar` to `scrollbar_visible` to match with
the table API.
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-01-14 10:05:49 +08:00
Jason Lee
1218ceb7dc
table: Add scrollbar_visible to Table for control the scrollbar visibility. ( #544 )
...
Ref #513 #542
Add this to ability to render some custom view on top of the table, but
below of the scrollbar.
## Break changes
- table: Renamed `scrollbar_state` to `vertical_scrollbar_state`.
- table: Removed `scroll_handle` and `horizontal_scroll_handle` method,
there have a pub `vertical_scroll_handle` and `horizontal_scroll_handle`
prop.
2025-01-13 14:59:03 +08:00
Ylin
eb10186463
table: Add visible_rows_changed, visible_cols_changed method to table delegate. ( #543 )
...
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-01-13 13:51:20 +08:00
Jason Lee
205a499bc9
table: Revert deferred render scrollbr for table. ( #542 )
...
This will make scrollbar always stay on top, even there have other
element cover it.
2025-01-12 22:32:43 +08:00
Floyd Wang
464fceac96
theme: Rename destructive to danger ( #541 )
2025-01-10 15:16:19 +08:00
Floyd Wang
31736b0e21
badge: Add new component ( #540 )
...
<img width="137" alt="image"
src="https://github.com/user-attachments/assets/6d7008b2-fe0f-4c4e-bd16-1dd8ae883f11 "
/>
<img width="118" alt="image"
src="https://github.com/user-attachments/assets/3137dd88-5038-4c59-90c1-cee2cdc542bd "
/>
2025-01-10 14:28:27 +08:00
Floyd Wang
2aad7e412a
tag: Rename badge to tag ( #539 )
2025-01-10 10:28:47 +08:00
Floyd Wang
ceba66c22d
dock: Add PanelControl for pinning the toolbar button ( #537 )
...
<img width="387" alt="image"
src="https://github.com/user-attachments/assets/b3d3f2a8-dc4e-49e6-8e82-e7f551d70bc7 "
/>
2025-01-09 19:18:59 +08:00
Jason Lee
de42cc46a7
panel: Update Panel toolbar_buttons method to use ViewContext<Self>. ( #536 )
...
## Break changes
The `toolbar_buttons` trait method in Panel has been changed:
```diff
- fn toolbar_buttons(&self, cx: &WindowContext) -> Vec<Button>
+ fn toolbar_buttons(&self, cx: &mut ViewContext<Self>) -> Option<Vec<Button>>
```
2025-01-09 16:49:35 +08:00
Jason Lee
bf82e3db13
list, table: Add scroll_to_item to List, scroll_to_row to Table. ( #535 )
2025-01-09 14:23:46 +08:00
Floyd Wang
8aac2f75e4
popup_menu: More compact checked style ( #534 )
...
## Before
<img width="360" alt="image"
src="https://github.com/user-attachments/assets/be388143-efed-4a47-b4f7-11018fe22f99 "
/>
## After
<img width="336" alt="image"
src="https://github.com/user-attachments/assets/449b7dd3-c51f-4673-a068-34ac813d79fd "
/>
2025-01-08 18:37:14 +08:00
Floyd Wang
bf8eb3f459
ci: Fix lint
2025-01-08 16:25:35 +08:00
Floyd Wang
d48a6d4b43
table: Support clear selection ( #533 )
2025-01-08 16:18:49 +08:00
dependabot[bot]
804705a260
build(deps): bump wry from 0.47.2 to 0.48.0 ( #530 )
...
Bumps [wry](https://github.com/tauri-apps/wry ) from 0.47.2 to 0.48.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tauri-apps/wry/releases ">wry's
releases</a>.</em></p>
<blockquote>
<h2>wry v0.48.0</h2>
<!-- raw HTML omitted -->
<pre><code>Updating crates.io index
Locking 404 packages to latest compatible versions
Adding html5ever v0.26.0 (available: v0.29.0)
Adding soup3 v0.5.0 (available: v0.7.0)
Adding toml v0.8.2 (available: v0.8.19)
Adding toml_datetime v0.6.3 (available: v0.6.8)
Adding toml_edit v0.20.2 (available: v0.20.7)
Fetching advisory database from
`https://github.com/RustSec/advisory-db.git `
Loaded 722 security advisories (from /home/runner/.cargo/advisory-db)
Updating crates.io index
Scanning Cargo.lock for vulnerabilities (405 crate dependencies)
Crate: atk
Version: 0.18.2
Warning: unmaintained
Title: gtk-rs GTK3 bindings - no longer maintained
Date: 2024-03-04
ID: RUSTSEC-2024-0413
URL: https://rustsec.org/advisories/RUSTSEC-2024-0413
Dependency tree:
atk 0.18.2
└── gtk 0.18.2
├── wry 0.48.0
├── webkit2gtk 2.0.1
│ └── wry 0.48.0
└── tao 0.31.0
└── wry 0.48.0
<p>Crate: atk-sys
Version: 0.18.2
Warning: unmaintained
Title: gtk-rs GTK3 bindings - no longer maintained
Date: 2024-03-04
ID: RUSTSEC-2024-0416
URL: <a
href="https://rustsec.org/advisories/RUSTSEC-2024-0416 ">https://rustsec.org/advisories/RUSTSEC-2024-0416 </a>
Dependency tree:
atk-sys 0.18.2
├── gtk-sys 0.18.2
│ ├── webkit2gtk-sys 2.0.1
│ │ ├── wry 0.48.0
│ │ └── webkit2gtk 2.0.1
│ │ └── wry 0.48.0
│ ├── webkit2gtk 2.0.1
│ └── gtk 0.18.2
│ ├── wry 0.48.0
│ ├── webkit2gtk 2.0.1
</tr></table>
</code></pre></p>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tauri-apps/wry/blob/dev/CHANGELOG.md ">wry's
changelog</a>.</em></p>
<blockquote>
<h2>[0.48.0]</h2>
<ul>
<li><a
href="eb0c8163f1 "><code>eb0c816</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1423 ">#1423</a> by
<a
href="https://github.com/tauri-apps/wry/../../SpikeHD "><code>@SpikeHD</code></a>)
Rename <code>{WebViewBuilderExtWindows,
WebViewBuilderExtUnix}::with_extension_path</code> to
<code>with_extensions_path</code>.</li>
<li><a
href="b4ba5b47f2 "><code>b4ba5b4</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1426 ">#1426</a> by
<a
href="https://github.com/tauri-apps/wry/../../FabianLars "><code>@FabianLars</code></a>)
On Windows, Wry will now log PostMessage errors instead of
panicking.</li>
<li><a
href="f0c6b947dd "><code>f0c6b94</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1441 ">#1441</a> by
<a
href="https://github.com/tauri-apps/wry/../../renovate "><code>@renovate</code></a>)
Updated <code>webview2-com</code> to <code>0.34</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="2ffcd494af "><code>2ffcd49</code></a>
Apply Version Updates From Current Changes (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1424 ">#1424</a>)</li>
<li><a
href="6ad66d3880 "><code>6ad66d3</code></a>
chore(deps): update rust crate pollster to 0.4.0 (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1405 ">#1405</a>)</li>
<li><a
href="f0c6b947dd "><code>f0c6b94</code></a>
fix(deps): update rust crate webview2-com to 0.34 (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1441 ">#1441</a>)</li>
<li><a
href="ca74176748 "><code>ca74176</code></a>
chore(deps): update rust crate winit to 0.30 (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1235 ">#1235</a>)</li>
<li><a
href="72f386f1c5 "><code>72f386f</code></a>
fix: tried to access uninitialized instance variable (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1425 ">#1425</a>)</li>
<li><a
href="413817c8ad "><code>413817c</code></a>
chore(deps): update rust crate tao to 0.31 (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1351 ">#1351</a>)</li>
<li><a
href="e3ef45f586 "><code>e3ef45f</code></a>
fix(deps): update rust crate thiserror to v2 (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1411 ">#1411</a>)</li>
<li><a
href="b4ba5b47f2 "><code>b4ba5b4</code></a>
fix: log postmessage errors (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1426 ">#1426</a>)</li>
<li><a
href="4740c0bf60 "><code>4740c0b</code></a>
refactor: destruct tuples to enhance readability (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1438 ">#1438</a>)</li>
<li><a
href="eb0c8163f1 "><code>eb0c816</code></a>
refactor!: Rename <code>with_extension_path</code> to
<code>with_extensions_path</code> (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1423 ">#1423</a>)</li>
<li>See full diff in <a
href="https://github.com/tauri-apps/wry/compare/wry-v0.47.2...wry-v0.48 ">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores )
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-08 15:11:33 +08:00
Jason Lee
63a9e61fd1
Fix lint
2025-01-08 15:08:41 +08:00
Jason Lee
3773337e04
list: Add load_more. ( #532 )
2025-01-08 15:05:40 +08:00
xda
da4c188bc6
input: Support Cmd+Up, Cmd+Down, Cmd+Shift+Up, Cmd+Shift+Down ( #531 )
...

2025-01-06 23:02:40 +08:00
Jason Lee
e012eb6d07
history: Add unique mode to keep unique item in History. ( #529 )
2025-01-06 19:19:36 +08:00
Jason Lee
99e51288e0
table: Binding popup menu on the table not on row for avoid render it on each rows. ( #528 )
...
- Add `TableEvent::DoubleClickedRow` to emit double clicked row event to
table.
2025-01-03 18:10:07 +08:00
Jason Lee
5be03543dd
history: Export undos, redos methods, and add clear method. ( #527 )
2025-01-03 16:57:00 +08:00
xda
8b89b5ba7c
input: Fix TextInput cursor getting stuck on Down key press ( #526 )
...
## Before

## After

2025-01-03 14:46:51 +08:00
xda
0cc6b90cde
input: Handle moving above the first line ( #525 )
2025-01-03 12:22:48 +08:00
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
Jason Lee
a5427ae662
title_bar: Avoid zoom window on double clicked on title bar right area. ( #522 )
...
Close #516
2024-12-31 18:57:11 +08:00
xda
66d9a34844
tiles: Add History<I> to track changes with undo, redo methods. ( #510 )
...

2024-12-31 18:47:21 +08:00
Jason Lee
ecce9f2633
number_input: Fix Number Input border to use cx.theme.input. ( #521 )
2024-12-27 19:03:24 +08:00
Jason Lee
d7cd0e54c2
list: Fix selected and confirmed list item detail. ( #520 )
...
Closes #519 to fix popup_menu attempt to subtract with overflow bug.
2024-12-27 18:41:27 +08:00
Jason Lee
0327df323d
modal: Fix Model, Drawer overlay size on tiling mode. ( #518 )
2024-12-27 17:22:02 +08:00
Jason Lee
6851e53183
dock: Fix to active prev tab, when current tab is invisible. ( #517 )
2024-12-27 11:58:19 +08:00
Jason Lee
9eba97ddf6
modal: Fix modal, drawer overlay position on Linux. ( #515 )
...
- Update `overlay` for Modal, still handle click out to dismiss, even it
no overlay.
2024-12-24 14:43:37 +08:00
Jason Lee
6acbfb5298
root: Fix window border and add cx.theme().window_border
2024-12-24 13:48:28 +08:00
Jason Lee
466c5e2005
root: Add window shadow to Root for support window border style on Linux. ( #514 )
...
And fix the title bar buttons click handle on Linux.
2024-12-24 13:33:06 +08:00
Jason Lee
3601cb399b
table: Use deferred to render scrollbar to avoid some element overflow it. ( #513 )
2024-12-24 11:40:50 +08:00
Jason Lee
7d8166a05e
linux: Fix window border on Linux.
2024-12-24 11:33:33 +08:00
Jason Lee
ea0954b425
drawer: Render notification at the side of drawer when drawer (top, right) it opened. ( #512 )
...
This change to make sure notification will display when WebView render
on the drawer.

2024-12-24 09:46:40 +08:00
Jason Lee
d051ac6a8c
table: Update last empty column to 20px width. ( #511 )
2024-12-23 19:36:58 +08:00
Jason Lee
11dbdb125a
chore: Removed ScrollableAxis use Axis instead. ( #509 )
2024-12-23 15:30:36 +08:00
Jason Lee
500aa2d7c5
table: Fix to only handle one way scrolling at same time. ( #507 )
...
Closes #314
2024-12-20 22:07:01 +08:00
Jason Lee
28463d3a18
panel: Fix panel to unexpected size chagnes when moved some panel. ( #506 )
...
### Before
https://github.com/user-attachments/assets/9174033b-d901-412f-9176-cdef6438822f
2024-12-20 19:15:31 +08:00
Jason Lee
57c1da2441
panel: To keep panel size when it going to hidden. ( #505 )
...
This change for make sure when Panel to hide and show, the original
panel size will keep.
2024-12-20 19:02:55 +08:00
Jason Lee
c8fae22684
story: Fix image story image size.
2024-12-20 18:29:11 +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
2f4b7a3eca
virtual_list: Try to use second item to measure. ( #504 )
2024-12-20 18:15:33 +08:00
Jason Lee
1a4ee348f8
dock: Add visible method to Panel trait to control panel visible. ( #503 )
...
Closes #502 #499
## Added
- Add `visible` method to `Panel` trait, if return false this panel will
disappear.
## Break changes
- Renamed `closeable` to `closable`.
- The `title_style`, `closable`, `zoomable` in `Panel` trait have been
change `cx: &WindowContext` to `cx: &AppContext`.
2024-12-20 10:21:21 +08:00
Jason Lee
4b211bfe21
panel: Add set_active, set_zoomed method to Panel trait. ( #501 )
...
It will called when the panel active, zoom state changed.
2024-12-19 10:29:58 +08:00
Jason Lee
4e3b988e24
theme: Fix secondary active color in light mode. ( #498 )
...
<img width="968" alt="image"
src="https://github.com/user-attachments/assets/e86a3772-227e-4223-adbd-fb0387f9d735 "
/>
2024-12-18 18:13:46 +08:00
Jason Lee
d4819b34aa
chore: Update GPUI with AnchorCorner renamed to Corner. ( #497 )
...
Ref https://github.com/zed-industries/zed/pull/22119
2024-12-18 18:02:47 +08:00
Jason Lee
24982fb78c
scrollbar: Improve thumb bounds for avoid trigger scrollbar. ( #496 )
2024-12-18 17:21:57 +08:00
Jason Lee
4f7ca4bb9a
virtual_list: Add VirtualList ( #495 )
...
Vistual List for render a large number of differently sized
rows/columns.
> NOTE: This must ensure each column width or row height.
Unlike the `uniform_list`, the each item can have different size. This
is useful for more complex layout, for example, a table with different
row height.
2024-12-18 16:38:58 +08:00
reya
8260b5f6a0
fix: wrong size variant in sizable trait ( #493 )
2024-12-17 09:22:48 +08:00
xda
5874c6974f
tiles: Add Tiles ( #435 )
...
## Break Changes
- Renamed `DockItemState` to `PanelState`.
- Renamed `DockItemInfo` to `PanelInfo`.
- Update `cx` type from `WindowContext` to `AppContext` for Panel trait
`panel_name` method.
## TODO
- [ ] Support merge panels into TabPanel.
- [ ] Support split panels into Tile.
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-12-16 20:33:14 +08:00
Jason Lee
a5a72fcb5a
panel: Avoid render panel when TabPanel is collapsed. ( #492 )
...
Close #488
- Fix `collapsed` sync to `TabPanel` when load state.
2024-12-13 11:23:00 +08:00
Jason Lee
5630154590
chore: Save layout.json to target/layout.json.
2024-12-13 10:20:30 +08:00
Jason Lee
d701baed28
dock: Do not active tab when drop to TabPanel right empty area. ( #491 )
2024-12-12 19:18:42 +08:00
Jason Lee
28c072d9c6
table: Fix incorrect column offset when have fixed columns. ( #490 )
2024-12-12 17:40:25 +08:00
Jason Lee
8558da4a7b
table: Improve Table to only render visible range columns for performance up to stable on 120 FPS ( #489 )
...
This change to make Table to only render visible range columns.
With the example table story case:
- 32 columns
## Before
- Normally fast scroll: 80~90 FPS
- Drag fast scroll: 60 FPS
## After
- Normally fast scroll: 120 FPS
- Drag fast scroll: 90~100 FPS

2024-12-12 17:09:26 +08:00
Jason Lee
64a3b4399b
chore: Update GPUI with gradient support. ( #487 )
2024-12-12 10:19:38 +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
cf090923a7
theme: Fix lighten, darken method. ( #483 )
...
Close #332
2024-12-10 17:35:44 +08:00
Jason Lee
9f0f05af2d
scrollbar: Adjust scrollbar style and add scrollbar_thumb_hover to theme. ( #482 )
...
<img width="297" alt="image"
src="https://github.com/user-attachments/assets/1779bf6c-2d01-4a12-9052-2ba571bff68b ">
<img width="301" alt="image"
src="https://github.com/user-attachments/assets/9971b248-9a48-47ff-847c-00eafff17fe1 ">
2024-12-10 17:08:09 +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

2024-12-10 16:18:38 +08:00
Jason Lee
26024ba2b5
scrollbar: Use default cursor style when hovered on scrollbar. ( #480 )
...
- Move prepare code to `prepaint` stage.
Close #474
2024-12-10 14:43:02 +08:00
Jason Lee
22f60c7299
story: Revert scrollable for StoryContainer for fix size_full. ( #479 )
...
Ref #478
2024-12-10 14:38:09 +08:00
Jason Lee
782cea35fc
chore: Rename longbridgeapp to longbridge. ( #477 )
2024-12-10 11:36:39 +08:00
Jason Lee
9288dc91c2
input: Add to support multi-line Input. ( #463 )
2024-12-09 20:17:05 +08:00
ihavecoke
39ec84b989
table: Add a theme color to fixed the drag column in dark mode text style ( #476 )
2024-12-09 20:00:48 +08:00
Jason Lee
62ce148c19
scrollbar: Fix position may out of container bounds when clicked scrollbar bg. ( #475 )
2024-12-09 17:21:48 +08:00
Floyd Wang
59d9341280
image_story: Fix the pie_chart size
2024-12-09 16:00:19 +08:00
ihavecoke
bf0e3a22de
table: Emit MoveCol when moved column. ( #473 )
2024-12-09 15:21:37 +08:00
Jason Lee
d8636a31bd
chore: Fix clippy warnings. ( #465 )
2024-12-05 12:03:29 +08:00
reya
07a8e70d1a
dock: Add DockItem::panel ( #464 )
...
**Description**:
Improve the flexibility of `DockArea`, sometime user won't need a
`TabPanel`, just display some message or UI elements. Curren implement
only allow use Tab or Split. So this PR will add `Plain` to `DockItem`,
user can put anything which implement `PanelView` trait.
**Usage**:
```rust
let left_panels = DockItem::panel(Arc::new(<- PanelView ->));
_ = dock_area.update(cx, |view, cx| {
view.set_version(DOCK_AREA.version, cx);
view.set_left_dock(left_panels, Some(px(260.)), true, cx);
view.set_center(dock_item, cx);
view.set_dock_collapsible(
Edges {
left: false,
..Default::default()
},
cx,
);
});
```
**Screenshot**
<img width="1300" alt="image"
src="https://github.com/user-attachments/assets/a01e427c-50f1-4509-82d1-76cc016aa7b3 ">
2024-12-05 11:12:08 +08:00
Jason Lee
bc7dfb877b
badge: Add Badge. ( #462 )
...
<img width="824" alt="image"
src="https://github.com/user-attachments/assets/1aacdb99-a890-46fb-a0db-a94eb125598b ">
<img width="824" alt="image"
src="https://github.com/user-attachments/assets/b9af9807-4994-4050-84d9-cf5d4d8d172a ">
2024-12-03 23:07:39 +08:00
Jason Lee
cc23291d19
breadcrumb: Add Breadcrumb. ( #461 )
...
<img width="1187" alt="image"
src="https://github.com/user-attachments/assets/a64b88da-bc57-4d28-a440-b4b7b456612b ">
2024-12-03 22:24:44 +08:00
Jason Lee
23f9352295
button: Rename ButtonStyle to ButtonVariant. ( #460 )
...
This is a breaking changes, we need refactor exist code by this:
- `ButtonStyled` -> `ButtonVariants`
- `.style` -> `.with_variant`
- `ButtonStyle` -> `ButtonVariant`
- `ButtonCustomStyle` -> `ButtonCustomVariant`
2024-12-03 19:22:28 +08:00
Floyd Wang
7560542659
divider: Support custom colors ( #459 )
...
<img width="850" alt="image"
src="https://github.com/user-attachments/assets/0161b14d-88ae-4bdf-a515-34df9aefb845 ">
2024-12-03 19:06:10 +08:00
Jason Lee
bdcf552ecf
theme: Remove Theme::get_global, there have Theme::global method. ( #458 )
2024-12-03 18:55:50 +08:00
Ylin
ee38970d68
table: Make selected_{row,col} public ( #456 )
2024-12-03 16:21:36 +08:00
Ylin
dd1b767b8a
table: Make set_selected_row, set_selected_col public ( #455 )
...
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-12-03 12:00:15 +08:00
Jason Lee
97c01c75e8
theme: Fix menu item hover style. ( #454 )
...
<img width="470" alt="image"
src="https://github.com/user-attachments/assets/0255d03d-1e67-49c7-ad3f-5507777d82a3 ">
<img width="449" alt="image"
src="https://github.com/user-attachments/assets/ab7dd027-8e81-408b-8d02-69cc27fcb801 ">
<img width="255" alt="image"
src="https://github.com/user-attachments/assets/e789cceb-8aa6-432e-abb0-ba7a14b793bd ">
2024-12-03 10:07:53 +08:00
Jason Lee
23d273eaf9
sidebar: Add Sidebar ( #452 )
...
Close #430
<img width="1150" alt="image"
src="https://github.com/user-attachments/assets/2564bcfa-7aff-41d3-a7be-496ef2365e30 ">
<img width="1150" alt="image"
src="https://github.com/user-attachments/assets/18c6718a-7641-4e8f-ad0f-bc18bd91fc42 ">
2024-12-02 23:21:39 +08:00
Ylin
09455df61c
table: Fix disabled sort field change to default ( #451 )
...
Co-authored-by: linxin <xin.lin@longbridge-inc.com>
2024-12-02 11:28:16 +08:00
Jason Lee
8c464d6709
dock: Fix some panel cannot able to split ( #450 )
...
- Rename `set_root` to `set_center`.
2024-12-02 10:42:31 +08:00
Jason Lee
9d476f9517
scrollbar: Use paint_layer for scrollbar paint. ( #448 )
...
And increase scrollbar thumb color in normal mode.
But, it looks like no difference for performance.
2024-11-28 11:42:19 +08:00
Jason Lee
5468d034da
theme: Add color method for default color palette to get color by a scale number. ( #447 )
...
```rs
ui::red(50);
ui::blue(600);
```
2024-11-28 11:36:33 +08:00
Jason Lee
a941c7b32e
panel: Fix toggle button border overlap with first tab. ( #446 )
...
<img width="202" alt="image"
src="https://github.com/user-attachments/assets/ab7b9865-52be-4bdb-bade-9b0c47e83bb7 ">
2024-11-27 23:00:25 +08:00
Jason Lee
36dcc53824
dock: Add set_dock_collapsible to support setting the Docks to be collapsible or not. ( #445 )
...
Close #442
In this case, the left Dock is not collapsible:
<img width="1165" alt="image"
src="https://github.com/user-attachments/assets/21422cdd-d686-4931-9285-925b8e8d3343 ">
2024-11-27 21:34:44 +08:00
Jason Lee
7fe91e4e12
dock: Add panel_style to support always show TabBar. ( #444 )
...
Close #441
```rs
DockArea::new(MAIN_DOCK_AREA.id, Some(MAIN_DOCK_AREA.version), cx).panel_style(PanelStyle::TabBar)
```
<img width="1433" alt="image"
src="https://github.com/user-attachments/assets/2013188e-990b-4709-ac7e-43c2de8bc895 ">
2024-11-27 21:34:27 +08:00
xda
53fe5823ef
dock: Fix panel should have a maximal width restriction when resizing ( #443 )
...
https://github.com/user-attachments/assets/617336d2-5392-4eba-a1b4-f1234c8d2eec
2024-11-27 20:36:05 +08:00
Jason Lee
142d092867
dock: Add add_panel method to add panel to DockArea. ( #440 )
...
Ref #438
https://github.com/user-attachments/assets/93b40aed-39f3-4d16-a442-13aa7a931895
2024-11-27 11:27:04 +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
dependabot[bot]
931d762955
build(deps): bump wry from 0.47.0 to 0.47.2 ( #434 )
2024-11-26 13:29:03 +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
Jason Lee
ea011d11d6
dock: Hide toggle button when side dock is not exist. ( #431 )
2024-11-22 15:38:47 +08:00
xda
d937a90db6
dock: Render toggle dock buttons inside the Panels. ( #414 )
...
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-11-22 14:41:04 +08:00
Jason Lee
c2678268b2
chore: Update background assign to use into.
2024-11-21 15:02:46 +08:00
Floyd Wang
8b23193f8f
dock: Make the panel dock open state controllable ( #429 )
2024-11-20 11:24:42 +08:00
Jason Lee
e6012fcc8f
table: Improve table render performance. ( #421 )
...
Before: ~85 - 100FPS
After: ~110 - 115FPS
2024-11-18 14:43:22 +08:00
Jason Lee
fa6abe5a9e
chore: Upgrade GPUI and fix API changes. ( #426 )
...
Refs:
- https://github.com/zed-industries/zed/pull/20349
- https://github.com/zed-industries/zed/pull/20371
- https://github.com/zed-industries/zed/pull/20686
2024-11-18 11:35:49 +08:00
dependabot[bot]
a4abc164bb
build(deps): bump wry from 0.46.3 to 0.47.0 ( #408 )
...
Bumps [wry](https://github.com/tauri-apps/wry ) from 0.46.3 to 0.47.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tauri-apps/wry/releases ">wry's
releases</a>.</em></p>
<blockquote>
<h2>wry v0.47.0</h2>
<!-- raw HTML omitted -->
<pre><code>Updating crates.io index
Locking 418 packages to latest compatible versions
Adding android-activity v0.5.2 (latest: v0.6.0)
Adding ash v0.37.3+1.3.251 (latest: v0.38.0+1.3.281)
Adding bit-set v0.5.3 (latest: v0.8.0)
Adding bit-vec v0.6.3 (latest: v0.8.0)
Adding bitflags v1.3.2 (latest: v2.6.0)
Adding block2 v0.3.0 (latest: v0.5.1)
Adding cairo-rs v0.18.5 (latest: v0.20.5)
Adding cairo-sys-rs v0.18.2 (latest: v0.20.0)
Adding calloop v0.12.4 (latest: v0.14.1)
Adding calloop-wayland-source v0.2.0 (latest: v0.4.0)
Adding cfg-expr v0.15.8 (latest: v0.17.0)
Adding cfg_aliases v0.1.1 (latest: v0.2.1)
Adding convert_case v0.4.0 (latest: v0.6.0)
Adding core-foundation v0.9.4 (latest: v0.10.0)
Adding core-graphics v0.23.2 (latest: v0.24.0)
Adding core-graphics-types v0.1.3 (latest: v0.2.0)
Adding cssparser v0.27.2 (latest: v0.34.0)
Adding d3d12 v0.19.0 (latest: v22.0.0)
Adding derive_more v0.99.18 (latest: v1.0.0)
Adding gdk-pixbuf v0.18.5 (latest: v0.20.4)
Adding gdk-pixbuf-sys v0.18.0 (latest: v0.20.4)
Adding generic-array v0.14.7 (latest: v1.1.0)
Adding gethostname v0.4.3 (latest: v0.5.0)
Adding getrandom v0.1.16 (latest: v0.2.15)
Adding gio v0.18.4 (latest: v0.20.5)
Adding gio-sys v0.18.1 (latest: v0.20.5)
Adding glib v0.18.5 (latest: v0.20.5)
Adding glib-macros v0.18.5 (latest: v0.20.5)
Adding glib-sys v0.18.1 (latest: v0.20.5)
Adding glow v0.13.1 (latest: v0.15.0)
Adding glutin_wgl_sys v0.5.0 (latest: v0.6.0)
Adding gobject-sys v0.18.0 (latest: v0.20.4)
Adding gpu-allocator v0.25.0 (latest: v0.27.0)
Adding gpu-descriptor v0.2.4 (latest: v0.3.0)
Adding gpu-descriptor-types v0.1.2 (latest: v0.2.0)
Adding hashbrown v0.12.3 (latest: v0.15.1)
Adding hashbrown v0.14.5 (latest: v0.15.1)
Adding heck v0.4.1 (latest: v0.5.0)
Adding html5ever v0.26.0 (latest: v0.29.0)
Adding icrate v0.0.4 (latest: v0.1.2)
Adding indexmap v1.9.3 (latest: v2.6.0)
Adding itoa v0.4.8 (latest: v1.0.11)
Adding jni-sys v0.3.0 (latest: v0.4.0)
</tr></table>
</code></pre>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tauri-apps/wry/blob/dev/CHANGELOG.md ">wry's
changelog</a>.</em></p>
<blockquote>
<h2>[0.47.0]</h2>
<ul>
<li><a
href="72212568cb "><code>7221256</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1365 ">#1365</a> by
<a
href="https://github.com/tauri-apps/wry/../../Norbiros "><code>@Norbiros</code></a>)
Add
<code>WebViewBuilder::with_initialization_script_for_main_only</code> to
enable injecting JavaScript code into main frame only or all
subframes.</li>
<li><a
href="c1b26b9612 "><code>c1b26b9</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1394 ">#1394</a> by
<a
href="https://github.com/tauri-apps/wry/../../amrbashir "><code>@amrbashir</code></a>)
Add <code>WebView::cookies</code> and
<code>WebView::cookies_for_url</code> APIs.</li>
<li><a
href="c193e2a04c "><code>c193e2a</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1408 ">#1408</a> by
<a
href="https://github.com/tauri-apps/wry/../../amrbashir "><code>@amrbashir</code></a>)
Fix <code>DragDropEvent::Drop</code> event never fired on Wayland (and
sometimes on X11).</li>
<li><a
href="1d63fa3253 "><code>1d63fa3</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1403 ">#1403</a> by
<a
href="https://github.com/tauri-apps/wry/../../SpikeHD "><code>@SpikeHD</code></a>)
Add <code>WebViewBuilder::with_extension_path</code> API to Windows and
Linux.</li>
<li><a
href="0c192f4fda "><code>0c192f4</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1414 ">#1414</a> by
<a
href="https://github.com/tauri-apps/wry/../../lucasfernog "><code>@lucasfernog</code></a>)
Fix Android static handlers not being replaced when the application UI
is relaunched while still running in the foreground.</li>
<li><a
href="9a2a2d42b6 "><code>9a2a2d4</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1412 ">#1412</a> by
<a
href="https://github.com/tauri-apps/wry/../../amrbashir "><code>@amrbashir</code></a>)
Fix icons of dragged items getting stuck when using
<code>WebViewBuilder::with_drag_drop_handler</code> on some distros like
Gnome.</li>
<li><a
href="fa9875bb16 "><code>fa9875b</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1409 ">#1409</a> by
<a
href="https://github.com/tauri-apps/wry/../../amrbashir "><code>@amrbashir</code></a>)
On Windows, disable Webview2's file drop when using
<code>WebViewBuilder::with_drag_drop_handler</code> which fix drag
events for files from "Recent files" view.</li>
<li><a
href="6007608277 "><code>6007608</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1400 ">#1400</a> by
<a
href="https://github.com/tauri-apps/wry/../../amrbashir "><code>@amrbashir</code></a>)
On Windows, fix webview slightly larger than the window inner size,
which resulted in a hidden 1px in the right and bottom borders of the
webview</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="08f3c68f56 "><code>08f3c68</code></a>
Apply Version Updates From Current Changes (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1399 ">#1399</a>)</li>
<li><a
href="c193e2a04c "><code>c193e2a</code></a>
fix(linux): fix <code>DragDropEvent::Drop</code> never fired on wayland
(<a
href="https://redirect.github.com/tauri-apps/wry/issues/1408 ">#1408</a>)</li>
<li><a
href="6007608277 "><code>6007608</code></a>
fix(windows): handle window borders when resizing to parent (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1400 ">#1400</a>)</li>
<li><a
href="58cc0824c2 "><code>58cc082</code></a>
fix(android): drop MainPipe on activity destroy (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1415 ">#1415</a>)</li>
<li><a
href="0c192f4fda "><code>0c192f4</code></a>
fix(android): allow static handlers to be replaced (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1414 ">#1414</a>)</li>
<li><a
href="9a2a2d42b6 "><code>9a2a2d4</code></a>
fix: call <code>ctx.drop_finish</code> in webkit2gtk drop handler (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1412 ">#1412</a>)</li>
<li><a
href="7c4f2b7299 "><code>7c4f2b7</code></a>
chore: typo <code>se</code> -> <code>set</code> (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1413 ">#1413</a>)</li>
<li><a
href="b1d4d830d4 "><code>b1d4d83</code></a>
ci: remove macos-12, no longer supported (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1410 ">#1410</a>)</li>
<li><a
href="fa9875bb16 "><code>fa9875b</code></a>
fix(windows): set WebView2 <code>AllowExternalDrop</code> to false (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1409 ">#1409</a>)</li>
<li><a
href="72212568cb "><code>7221256</code></a>
feat: Allow injecting JavaScript code into subframes (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1365 ">#1365</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tauri-apps/wry/compare/wry-v0.46.3...wry-v0.47 ">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores )
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-15 14:26:03 +08:00
Jason Lee
cdee8c7ffd
dock: Keep the panel state when meet invalid panel. ( #423 )
...
Close #422
2024-11-15 10:31:20 +08:00
Jason Lee
3db84c1247
Revert "dock: Change bottom dock to floating on bottom of the center view." ( #420 )
...
Reverts longbridgeapp/gpui-component#419
2024-11-14 19:01:57 +08:00
Jason Lee
a2d6752557
dock: Change bottom dock to floating on bottom of the center view. ( #419 )
2024-11-14 18:57:37 +08:00
Jason Lee
079cc35c48
dock: Limit drag move or close when tab panel or parent only have 1 panel. ( #418 )
2024-11-14 18:33:49 +08:00
Jason Lee
b29f4fb0e6
dock: Add set_locked to lock dock area to limit split, move panels. ( #417 )
...
But still allow to resize panels.
2024-11-14 15:47:26 +08:00
Jason Lee
7edbdd01f4
dock: Remove the inside toggle dock button in Dock to reduce complex and add dock::ToggleButtons. ( #415 )
...
Draft https://github.com/longbridgeapp/gpui-component/pull/414 to keep
old code.
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/749a5712-7ec4-43a8-a89d-595a7644a7ec ">
2024-11-14 12:05:58 +08:00
xda
47688a8af2
dock: Generalize Dock's panel to accommodate DockItem ( #412 )
...

2024-11-14 12:00:23 +08:00
ihavecoke
d53b30ff9f
drawer: Set paddings to base to support override drawer body paddings. ( #413 )
...
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-11-13 14:38:47 +08:00
ihavecoke
40345f1e42
webview: Add bounds method to WebView to get container bounds. ( #411 )
...
<img width="1463" alt="image"
src="https://github.com/user-attachments/assets/f70c2d6b-cb26-4cf5-bd2e-9760ff54c524 ">
2024-11-12 19:31:48 +08:00
Floyd Wang
e77578a53f
svg_img: Fix the conversion error of the SVG fill color with alpha ( #410 )
...
### Before
<img width="156" alt="image"
src="https://github.com/user-attachments/assets/c7177ac7-58aa-4865-81c9-4f7ddff9f145 ">
### After
<img width="176" alt="image"
src="https://github.com/user-attachments/assets/a010e78d-752e-4298-bf40-7a42b916e547 ">
2024-11-12 19:26:24 +08:00
Jason Lee
e478d5606f
chore: Add base ui attributes to Root and add change font size to story to test font adjust. ( #409 )
2024-11-12 11:17:16 +08:00
ihavecoke
f96c21782d
skeleton: Fix the bug where the theme color of the skeleton does not display in light mode ( #407 )
2024-11-11 11:48:03 +08:00
Jason Lee
5149b8a714
panel: Add toolbar_buttons to extend button to panel. ( #406 )
...
<img width="635" alt="image"
src="https://github.com/user-attachments/assets/42dc1cb4-a1dd-43c6-8fc3-9d404e86cb85 ">
2024-11-10 23:17:34 +08:00
Floyd Wang
ab772c04f1
svg_img: Remove the svg_img method ( #404 )
...
Use `SvgImg::new()`.
2024-11-08 16:42:33 +08:00
Floyd Wang
df54c7b2fb
svg_img: Embed the font file ( #401 )
...
<img width="644" alt="image"
src="https://github.com/user-attachments/assets/7acaff6c-0913-402a-8759-2660d2977ce5 ">
2024-11-08 15:45:00 +08:00
ihavecoke
5aad0bf340
modal: Add keyboard option to Modal to enable/disable default keyboard event. ( #400 )
2024-11-08 13:50:05 +08:00
Ylin
d4ee273bf5
table: Add render_last_empty_col to table delegate ( #399 )
...
Co-authored-by: linxin <xin.lin@longbridge-inc.com>
2024-11-07 17:53:21 +08:00
Floyd Wang
6d0b332071
svg_img: Render SVGs with text tags ( #390 )
...
<img width="620" alt="image"
src="https://github.com/user-attachments/assets/61f2a1f8-6926-484d-bcb8-076a9d85e89c ">
2024-11-07 11:39:06 +08:00
Jason Lee
270493f3ce
list: Fix to set_selected_index when List up, down to select item. ( #398 )
2024-11-06 18:44:10 +08:00
Floyd Wang
8c3997d795
divider: Make the size flexible ( #397 )
2024-11-06 17:45:38 +08:00
Jason Lee
3508453b11
theme: Rename Colors to ThemeColor and public it. ( #395 )
2024-11-05 23:02:54 +08:00
Jason Lee
26211000f7
button: Fix Button disabled style. ( #394 )
...
- Fix `lighten`, `darken` method for Hsla.
<img width="619" alt="image"
src="https://github.com/user-attachments/assets/75c64f46-1551-4abf-8521-f0b9c90682d2 ">
<img width="620" alt="image"
src="https://github.com/user-attachments/assets/9f3655ba-1506-4e58-aa20-b17546fbc215 ">
2024-11-05 14:36:05 +08:00
Floyd Wang
852c38f42c
table: Remove the unnecessary left margin from the icon
2024-11-05 11:08:21 +08:00
Jason Lee
c2824eb01e
calendar: Add small, medium, large size support to Calendar. ( #393 )
...
Fix #272
2024-11-04 19:25:30 +08:00
Floyd Wang
1c5d63edb1
table: Remove unnecessary actions that stop bubbling to ensure focused ( #392 )
2024-11-04 17:22:01 +08:00
Jason Lee
ca44ca6311
chore: Update to use WeakView for avoid dependency issue. ( #391 )
2024-11-04 16:36:21 +08:00
xda
19f6b82b61
scrollbar: show the narrower scrollbar in idle state ( #389 )
...

---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-11-04 11:34:57 +08:00
Jason Lee
4b5d917e83
title_bar: Update on_close_window to support binding with cx.listener. ( #388 )
2024-11-01 18:39:25 +08:00
Jason Lee
80230c643f
title_bar: Add on_close_window method callback for TitleBar to custom close window method for Linux. ( #387 )
2024-11-01 17:06:31 +08:00
Floyd Wang
b997eabcba
title_bar: Make the left padding adjustable ( #386 )
2024-11-01 14:20:49 +08:00
Jason Lee
c986a294e4
chore: Add view method to get the child view from Root. ( #385 )
2024-10-31 15:27:45 +08:00
ihavecoke
c871138ca7
webview: Upgrade wry version to fixed with_user_agent regression. ( #384 )
...
https://github.com/tauri-apps/wry/releases/tag/wry-v0.46.3
2024-10-31 14:24:10 +08:00
Floyd Wang
2dab196f68
button: Add flex_shrink_0 to the base ( #383 )
...
If you want the button to be flexible, add `flex_shrink`.
2024-10-31 10:35:37 +08:00
Jason Lee
d99c5246ee
Add Default support to DockAreaState.
2024-10-30 17:29:52 +08:00
Jason Lee
fe6566ce2f
table: Export scroll handles. ( #371 )
2024-10-30 14:25:38 +08:00
Jason Lee
292d1a6a9a
theme: Rename title_bar_background to title_bar. ( #382 )
...
Use same name rule as other theme variables.
2024-10-30 14:25:21 +08:00
Jason Lee
0b0fc61c2f
chore: Avoid cx.prevent_default when ListItem or other click ( #381 )
2024-10-29 16:54:08 +08:00
Floyd Wang
db041fea88
table: Add default option to perform_sort ( #379 )
2024-10-24 18:15:12 +08:00
Jason Lee
b7a1292d07
popup_menu: Add popup_menu_with_anchor method to control the Anchor for PopupMenu. ( #378 )
2024-10-24 11:05:13 +08:00
xda
b8c8ddd8f5
resizable: Fix the edge case of initializing Panels with zero initial_size ( #377 )
2024-10-24 00:07:45 +08:00
Jason Lee
53311b06f8
title_bar: Impl Styled to TitleBar. ( #375 )
2024-10-22 14:42:40 +08:00
Floyd Wang
c87b4c7f01
notification: Autohide should not panic when the window is not found ( #374 )
2024-10-22 10:43:00 +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:01:49 +08:00
Jason Lee
38fc226c22
title_bar: Export TitleBarElement. ( #369 )
2024-10-21 19:23:20 +08:00
Jason Lee
2aaf424df9
title_bar: Fix move window support for Linux. ( #368 )
2024-10-21 15:23:36 +08:00
Jason Lee
2c979c32c5
linux: Fix #104 Linux platform crash with BorrowMutError. ( #367 )
...

2024-10-19 01:21:31 +08:00
xda
8dbf1dd5d5
Add the Preset Ranges and add border for today ( #365 )
...
Preset Ranges have been added. The “Today” border has also been added.

---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-10-18 20:38:16 +08:00
Jason Lee
a798bd81c6
chore: Fix typos. ( #364 )
2024-10-18 14:30:24 +08:00
Jason Lee
274b9edc32
table: Fix selected row top, bottom border detail.
2024-10-18 14:13:15 +08:00
Jason Lee
a4260c109f
table, list: Avoid use deferred to show selected row style. ( #363 )
...
<img width="956" alt="image"
src="https://github.com/user-attachments/assets/0f72b556-76bc-4808-bca8-c261411656d1 ">
2024-10-18 13:27:59 +08:00
Jason Lee
4bef681c9a
table, list: Add right clicked row style and improve selection style. ( #362 )
...
- table: Add `content_menu` to TableDelegate.
<img width="644" alt="image"
src="https://github.com/user-attachments/assets/4c21299f-00e8-4a61-964d-338ef7daa802 ">
2024-10-18 11:52:14 +08:00
Jason Lee
c02cb802cb
list: Add cx argument to ListDelegate. ( #361 )
...
Following #360 TableDelegate changes.
2024-10-18 10:17:59 +08:00
julien-leclercq
536bb60900
table: Add cx argument to TableDelegate methods. ( #360 )
...
As discussed in #359 adds a `AppContext` argument to the
`table::TableDelegate::rows_count` method
---------
Co-authored-by: Julien Leclercq <julien-leclercq@users.noreply.github.com>
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-10-18 10:03:32 +08:00
Jason Lee
f35db249a6
theme: Update GPUI and imporve dark color. ( #358 )
...
## Before
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/f4e74cf0-e386-4e91-86d1-05ee75b26471 ">
## After
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/da393ea9-79ee-4535-a46d-68684d7ad738 ">
2024-10-17 19:14:42 +08:00
Jason Lee
6b54396c9c
title_bar: Fix TitleBar prefix padding when is zoomed and support double click to toggle zoom. ( #357 )
2024-10-17 18:22:32 +08:00
xda
913775c632
resizable: Fix the bug for parent groups when initializing Panels with sizes Some and None ( #356 )
...
Optimization of https://github.com/longbridgeapp/gpui-component/pull/329
The issue with the initial width of the Panel has been optimised to
ensure that the left side of a Panel combination like [Some(px(510.)),
None] is initially rendered with a width of 510px.
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-10-17 17:39:00 +08:00
Jason Lee
8eff75d357
accordion: Add Accordion. ( #355 )
...
<img width="920" alt="image"
src="https://github.com/user-attachments/assets/3269aa05-7531-43a1-84a9-469959a68d06 ">
2024-10-17 17:31:59 +08:00
Jason Lee
1fdcff3b51
theme: Add apply_color to theme to support merge a new color into theme color. ( #353 )
...
- Fix #334 to keep selected theme color.
## Example
<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/3a05f58c-2720-436c-8df9-c582871d87d5 ">
<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/5b8db494-1402-4785-8d98-a87173b15284 ">
<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/0305c05b-c2fb-4fea-9a50-5aa00de504fe ">
<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/91fbb7b6-7494-440d-95bf-2de37d6bbb44 ">
2024-10-16 18:38:21 +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
Floyd Wang
000c0bec57
dropdown: Add set_disabled for &mut self ( #351 )
2024-10-16 17:33:46 +08:00
Jason Lee
28d887cf5e
webview: Use Wry crate version.
2024-10-16 16:32:25 +08:00
Jason Lee
fdca75d5a7
title_bar: Add a new TitleBar, remove the old version. ( #348 )
...
- Removed old workspace crate, moved out to
[gpui-workspace](https://github.com/huacnlee/gpui-workspace )
<img width="491" alt="image"
src="https://github.com/user-attachments/assets/5048491c-9b98-4af5-9f0f-9a0f20c2308f ">
Icons for Windows and Linux use by SVG icon, it based on:
-
https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font
- Download Font: [Segoe Fluent
Icons](https://learn.microsoft.com/en-us/windows/apps/design/downloads/#fonts )
2024-10-16 16:22:17 +08:00
xda
51df8f2f04
drawer: support ESC to close it by on_action and call on_close ( #341 )
...
Fix #263

2024-10-15 21:47:45 +08:00
Floyd Wang
9b8240c6bc
table: Improve render_tr to bind the context_menu ( #347 )
...
<img width="559" alt="image"
src="https://github.com/user-attachments/assets/2aecfa35-5ee1-45cb-a3f3-2409bd09efd7 ">
2024-10-15 21:35:17 +08:00
Jason Lee
6a5fff889e
dock: Disallow move panel when it is zoomed in. ( #346 )
...
Closes #342
2024-10-15 14:52:40 +08:00
Jason Lee
2f4ee70f46
story: Fix story caes ( #345 )
...
- Remove WebView story.
- Fix dropdown size.
2024-10-15 14:21:47 +08:00
Jason Lee
3041d0020f
webview: Update wry. ( #343 )
...
To match Wry recently API changes.
Ref: https://github.com/tauri-apps/wry/pull/1385
2024-10-14 22:19:35 +08:00
Jason Lee
b18207728b
dropdown: Use difference chevron icon color for enabled/disabled dropdown. ( #336 )
...
<img width="547" alt="image"
src="https://github.com/user-attachments/assets/07239a63-b1ae-4462-b8ba-d30d7e7e66f5 ">
2024-10-14 10:19:58 +08:00
Jason Lee
5fd2ebf522
panel: Always not show active tab style, when the dock is collapsed. ( #335 )
...
## Before
<img width="249" alt="image"
src="https://github.com/user-attachments/assets/2dfee593-1a07-4b75-913b-d2e17decb67a ">
## After
<img width="271" alt="image"
src="https://github.com/user-attachments/assets/20752d04-1f25-498c-8e6e-4ff0f21401bf ">
2024-10-14 10:06:20 +08:00
xda
5c8d0d7eb4
scrollbar: Do not show scrollbar event mouse is in Element rect, only show when hovered on scrollbar area or scrolled ( #333 )
...
Let the scrollbar only display when hovering and scrolling. The effect
comparison is on the left GPUI and on the right mac. I guess they used
the 10th power ease-in function, and the effect is similar.
Fixes https://github.com/huacnlee/gpui-component/issues/260

2024-10-13 10:53:53 +08:00
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 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