Commit graph

35 commits

Author SHA1 Message Date
Jason Lee
04abdbe771
theme: Fix some dropdown to use popover for bg, and improve macos-cla… (#1702)
<img width="1136" height="859" alt="image"
src="https://github.com/user-attachments/assets/16764390-2089-43b9-bb96-77912263f07e"
/>

<img width="1136" height="859" alt="image"
src="https://github.com/user-attachments/assets/c2cb7e4f-76d6-458e-8ff9-2734d4944008"
/>
2025-11-28 08:57:13 +00:00
Jason Lee
55da14edb2
theme: Use difference color like the window background for TitleBar. (#1686) 2025-11-26 11:54:28 +08:00
han
e5fa0709d1
theme: Add switch.thumb.background theme config support (#1685)
## Description:
This PR adds support for customizing the Switch component's thumb color.

- Changes:
•  Added switch_thumb field to ThemeColor and ThemeConfig.
•  Updated Switch component to use cx.theme().switch_thumb.
• Config key: switch.thumb.background (falls back to background color if
not set).

Co-authored-by: hl <hl@nmcsoft.com>
2025-11-26 10:25:35 +08:00
Jason Lee
6c4de54fa4
theme: Use font_family for all elements. (#1618)
Close #1613

- And add `mono_font_family` and `mono_font_size` for code editor.
2025-11-17 03:18:17 +00:00
Jason Lee
945db0be56
dialog: Rename Modal to Dialog. (#1538)
## Break Change

- Renamed `Modal` to `Dialog`.

```diff
- window.open_modal(...)
+ window.open_dialog(...)

- window.close_modal(...);
+ window.close_dialog(...);
```

- Renamed `show_close` method to `close_button` in Dialog.
```diff
- .show_close(false)
+ .close_button(true)
```
2025-11-07 17:25:55 +08:00
obito
80cdf6a44c
theme: Allows to use alpha color for active_border but at least 0.3. (#1531)
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-11-06 22:23:55 +08:00
Jason Lee
998a5fd922
chore: Standardize the overall API and improve docs. (#1516) 2025-11-05 19:10:30 +08:00
Jason Lee
9fa2669ff4
list, table: Refactor List, Table to have ListState, TableState. (#1468)
## Break Change

- Like Select, Input API design, now `List`, `Table` also has ListState
and TableState.

```diff
- let table = cx.new(|_| Table::new(delegate, window, cx).stripe(true).border(true))
+ let table = cx.new(|_| TableState::new(delegate, window, cx))
+ Table::new(&table).stripe(true).border(true) // for render

- let list = cx.new(|_| List::new(delegate, window, cx))
+ let list = cx.new(|_| ListState::new(delegate, window, cx))
+ List::new(&list) // for render
```

- ListDelegate, TableDelegate methods has changed some argument type:
  
- If first argument is `&mut self`, the `cx` has been changed to `&mut
Context<ListState<Self>>` or `&mut Context<TableState<Self>>`.
  

    ```diff
- fn confirm(&mut self, _secondary: bool, _: &mut Window, cx: &mut
Context<List<Self>>)
+ fn confirm(&mut self, _secondary: bool, _: &mut Window, cx: &mut
Context<ListState<Self>>)
    ```

- If first argument is `&self`, the `cx` has been changed to `&mut App`.

    ```diff
- fn render_item(&self, ix: IndexPath, _: &mut Window, _: &mut
Context<List<Self>>)
    + fn render_item(&self, ix: IndexPath, _: &mut Window, _: &mut App)
    ```
2025-11-02 12:59:37 +00:00
Jason Lee
34ef0ff6d0
chore: Rename Dropdown to Select, TextInput to Input. (#1449)
## Break Change

- The `Dropdown` has been renamed to `Select`.
- The `TextInput` has been renamed to `Input`.

| Before | After |
| --- | --- |
| TextInput | Input |
| Dropdown | Select |
| DropdownItem | SelectItem |
| DropdownItemGroup | SelectGroup |
| DropdownState | SelectState |
| DropdownEvent | SelectEvent |
| DropdownDelegate | SelectDelegate |
| dropdown::ListEvent | ~~Removed~~ |

- Renamed `PopupMenuExt` to `DropdownMenu`.
- Removed pub mod `menu::popup_menu`, `menu::context_menu`, they are
moved into `menu` mod.
- Renamed `popup_menu` method to `dropdown_menu` for `DropdownMenu`,
`Panel`, `PanelView` and `DropdownButton`.

| Before | After |
| --- | --- |
| popup_menu::PopupMenuExt | menu::DropdownMenu |
| popup_menu | dropdown_menu |
| popup_menu_with_anchor | dropdown_menu_with_anchor |
2025-10-28 21:22:31 +08:00
Jason Lee
904c9f3fa7
theme: Export more theme options for schema. (#1442)
- Fix theme switch to support other UI settings (e.g.: radius, shadow,
font_size).
- Update `matrix` theme to use rounded 0px.

<img width="1380" height="1139" alt="image"
src="https://github.com/user-attachments/assets/24832fde-5b5e-4508-9b38-6c3c2890aedb"
/>
2025-10-28 03:28:18 +00:00
Jason Lee
cc0f936348
tiles: Add tile_radius theme option and default 0px. (#1441) 2025-10-28 02:54:41 +00:00
Copilot
08b5013b36
theme: Update scrollbar background color to transparent for all themes. (#1421)
## Problem

When scrolling quickly, a distracting background color was appearing in
the scrollbar area, as shown below:

<img
src="https://github.com/user-attachments/assets/c9ebe200-a6b2-47ca-992d-ceaa5ed3db04">

## Root Cause

Several theme files had scrollbar background colors configured with
partial transparency (alpha values like `33`, `44`, `80`, etc.) instead
of full transparency (`00`). This caused a semi-transparent background
to become visible during fast scrolling, creating an unwanted visual
artifact.

## Solution

Updated all `scrollbar.background` color values to use full transparency
by setting the alpha channel to `00`. This ensures the scrollbar
background is completely invisible across all themes, with only the
scrollbar thumb (the draggable indicator) remaining visible.

## Changes

Modified 7 theme files with non-transparent scrollbar backgrounds:

- **alduin.json**: `#28282833` → `#28282800`
- **hybrid.json**: `#E0E0E044` → `#E0E0E000`, `#1D1F2144` → `#1D1F2100`
- **jellybeans.json**: `#26262633` → `#26262600`
- **mellifluous.json**: `#fafafa33` → `#fafafa00`
- **molokai.json**: `#FEFAF933` → `#FEFAF900`
- **solarized.json**: `#EEE8D533` → `#EEE8D500`, `#002b3633` →
`#002b3600`
- **default-theme.json**: `#fafafa80` → `#fafafa00`, `#17171780` →
`#17171700`

All other themes already had transparent scrollbar backgrounds and
remain unchanged.

## Impact

- Eliminates the visual glitch where a background color appears during
fast scrolling
- Provides a consistent, clean scrollbar appearance across all 20 themes
plus the default theme
- No functional changes to scrollbar behavior - only visual appearance
- Total of 37 scrollbar.background entries now fully transparent

Fixes the issue reported by @huacnlee in the comments.





<issue_title>A different background color appears when the scroll bar
scrolls quickly</issue_title>
&gt;<issue_description>A different background color appears when the
scroll bar scrolls quickly
&gt; 
&gt;<img
src="https://github.com/user-attachments/assets/c9ebe200-a6b2-47ca-992d-ceaa5ed3db04"></issue_description>
&gt; 
&gt;<agent_instructions>Make change to update scrollbar background color
to transparent for all themes.</agent_instructions>
&gt; 
&gt; ## Comments on the Issue (you are @copilot in this section)
&gt; 
&gt;<comments>
&gt;<comment_new><author>@huacnlee</author>
&gt; That is the scrollbar background color. I am still on to consider
removing that color.</comment_new>
&gt;</comments>
&gt;

Fixes longbridge/gpui-component#1402

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>A different background color appears when the scroll bar
scrolls quickly</issue_title>
> <issue_description>A different background color appears when the
scroll bar scrolls quickly
> 
> <img width="1338" height="387" alt="Image"
src="https://github.com/user-attachments/assets/c9ebe200-a6b2-47ca-992d-ceaa5ed3db04"
/></issue_description>
> 
> <agent_instructions>Make change to update scrollbar background color
to transparent for all themes.</agent_instructions>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> <comment_new><author>@huacnlee</author><body>
> That is the scrollbar background color. I am still on to consider
removing that color.</body></comment_new>
> </comments>
> 


</details>

Fixes longbridge/gpui-component#1402

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute
survey](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: huacnlee <5518+huacnlee@users.noreply.github.com>
2025-10-23 18:13:33 +08:00
Jason Lee
6ca9ac46fa
chore: Bump crate version. (#1340) 2025-10-09 15:20:34 +08:00
Jason Lee
d0396d779e
editor: Add document_colors LSP. (#1329) 2025-10-06 18:08:12 +08:00
Jason Lee
5e504d10bb
chore: Refactor tab key to switch focus. (#991)
Wait https://github.com/zed-industries/zed/pull/33008,
https://github.com/zed-industries/zed/pull/34804 to merge.


https://github.com/user-attachments/assets/3c21ebc9-44a0-4311-bb0f-5f63fe8d4bb3

- Improved `focus_ring` to render like an outline.
- Added to support press `Enter`, `Space` key to trigger Checkbox,
Button, Radio.

## Break Changes

- The `FocusableExt` has been changed to only for crate internal.
- The `FocusableCycle` has been removed, now GPUI has it own tab stop
implementation.
2025-09-29 16:48:24 +08:00
Jason Lee
02b432ed17
scrollbar: Fix scrollbar width on always show mode. (#1196)
And fixes #1192 render bug.
2025-09-02 15:48:06 +08:00
Jason Lee
34d2a75894
theme: Add theme_name to get current active theme name. (#1190)
And fix theme menu selected item in example when theme mode changed.
2025-09-01 11:39:01 +08:00
Jason Lee
709a888e15
accordion: Fix Accordion hover background. (#1184)
- Improved `accordion.hover` theme color default fallback to `accent`.
- Fix incorrect Accordion border top radius on hover.
- Removed unused `accordion.active.background` theme variable.

<img width="1106" height="799" alt="image"
src="https://github.com/user-attachments/assets/3b1d3e56-7e77-4118-ac3c-231c6571940a"
/>
2025-08-29 11:51:32 +08:00
Jason Lee
74b3aa7e67
text_view: Add to support selection. (#1169)
### Links

Maybe we can do it in TextLayout in GPUI:


fda6eda3c2/crates/gpui/src/elements/text.rs (L309)

## Demo


https://github.com/user-attachments/assets/abbebee7-df8f-4067-86a7-15bc1a4c44cd

## Todo

- [x] Test for HTML View.
- [x] CodeBlock selection support.
- [x] Selection lines sometimes incorrect.
- [x] Listener Bounds changed to unselect.
2025-08-28 18:09:30 +08:00
Jason Lee
c4c948b177
theme: Fix reload theme to keep last selected. (#1164) 2025-08-20 17:33:12 +08:00
Jason Lee
eb5fa06809
theme: Use more lighter group_box fallback color. (#1163) 2025-08-20 17:19:10 +08:00
Jason Lee
396c8dbe63
theme: Improve theme color fallback to use blend to avoid alpha. (#1162)
Also updated the themes colors to match this default rule.
2025-08-20 16:37:46 +08:00
Jason Lee
6ae7558c44
theme: Add ThemeRegistry to load and watch themes dir. (#1148) 2025-08-18 19:29:27 +08:00
Jason Lee
dcca730d65
group_box: Add GroupBox element. (#1146)
Close #1144 

## Break Changes

- Renamed used theme variable `card`, `card_foreground` to `group_box`,
`group_box_foreground` for GroupBox.

<img width="1088" height="958" alt="image"
src="https://github.com/user-attachments/assets/adb1cbe6-fd6f-4d22-a434-39455f57ce09"
/>
2025-08-18 11:36:07 +08:00
Jason Lee
9a389224f3
chore: Update GPUI and other crates. (#1136) 2025-08-14 19:57:53 +08:00
Jason Lee
771fd78416
tabs: Fix tab_bar_segmented default fallback color to secondary. (#1101) 2025-07-29 14:42:46 +08:00
Jason Lee
fcf447d612
theme: Fix scrollbar default color and list hover color. (#1085) 2025-07-23 11:50:42 +00:00
Jason Lee
9c782796c2
theme: Improve theme color fallbacks based on base colors. (#1069)
- Added a lot of default fallbacks for theme colors based on `base`
colors.
- Added `hue`, `saturation`, `lightness` method to change Hsla color.
- Update stories to use theme colors, not a direct color.
- Improve `Badge`, `Avatar` to use theme colors.
- Added a new theme: `Fahrenheit`.
2025-07-17 11:43:40 +08:00
Jason Lee
977ce5df29
theme: Refactor Theme config to support JSONSchama. (#1068) 2025-07-16 19:22:09 +08:00
Jason Lee
ac026e26c9
theme: Improve theme color fallbacks and add more themes. (#1063) 2025-07-15 18:33:36 +08:00
Jason Lee
d139198c15
theme: Impl Default for Theme. (#1061) 2025-07-15 16:35:12 +08:00
Jason Lee
c9b5993472
story: Improve story case style. (#1060) 2025-07-15 11:56:07 +08:00
Jason Lee
cfd1551575
theme: Add more theme and fix to use default color from base color. (#1058) 2025-07-14 20:17:11 +08:00
Jason Lee
44427afacb
theme: Add to support highlight color to theme config. (#1055)
<img width="1058" height="1026" alt="image"
src="https://github.com/user-attachments/assets/300fb16b-c5e4-4eef-9690-54fcabc4fe47"
/>
<img width="836" height="855" alt="image"
src="https://github.com/user-attachments/assets/3fdc8301-375d-4223-a2ea-8d4f411a90bd"
/>
2025-07-14 17:04:18 +08:00
Jason Lee
8bf66443b2
theme: Add theme schema to support JSON theme config. (#1050) 2025-07-07 19:40:00 +08:00