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