Commit graph

733 commits

Author SHA1 Message Date
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