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
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
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
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
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
Jason Lee
c2824eb01e
calendar: Add small, medium, large size support to Calendar. ( #393 )
...
Fix #272
2024-11-04 19:25:30 +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
41c64e2912
chore: Update controls detail. ( #352 )
...
- Better icon style in Input, Dropdown, DatePicker.
2024-10-16 17:51:39 +08:00
Floyd Wang
c5b4505560
feat(button): Remove track_focus ( #282 )
2024-09-27 14:39:48 +08:00
Jason Lee
2a331fcb79
theme: Add shadow option to support toggle shadow for base controls, default: true. ( #268 )
...
- Add shadow to Button if it enabled.
2024-09-24 10:52:01 +08:00
Jason Lee
8f0ba2e5c3
modal: Only focus modal when it not focused on. ( #250 )
...
- Fix dropdown to mouse down out to dismiss.
https://github.com/user-attachments/assets/f5ab4aca-bfdc-460e-ae5a-cd0a31a30906
2024-09-17 18:48:06 +08:00
Jason Lee
a8d4abea69
button: Improve ButtonGroup to add style, size methods. ( #241 )
...
- Add `ButtonStyled` trait to apply the style for Button and
ButtonGroup.
2024-09-13 12:00:47 +08:00
ihavecoke
303dd51047
Use small size for calendar month item to fixed content overflow ( #231 )
2024-09-10 00:16:31 +08:00
Jason Lee
821487bed5
Improve popup snap to window with margin. ( #225 )
...
- Also update GPUI.
Ref: https://github.com/zed-industries/zed/pull/17159
<img width="866" alt="image"
src="https://github.com/user-attachments/assets/0737e4e4-7069-4554-a766-b9fc7b487fd6 ">
2024-09-07 11:50:38 +08:00
ihavecoke
d996144713
date_picker: Add range_mode method to DatePicker to set as range mode. ( #216 )
...
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-09-04 21:41:01 +08:00
Jason Lee
2c469da55a
Update GPUI and apply opacity feature. ( #215 )
2024-09-04 19:29:51 +08:00
Jason Lee
9c4411ff2b
date_picker: Reduce DatePicker popup position. ( #195 )
2024-09-01 00:36:51 +08:00
Floyd Wang
a02a6ed6b8
Set default true for cleanable & trigger event when dropdown clean ( #152 )
2024-08-15 18:01:43 +08:00
Jason Lee
70bc526fbb
Fix Dropdown and DatePicker anchor to snap to window. ( #139 )
...
<img width="786" alt="image"
src="https://github.com/user-attachments/assets/c40fab1d-2cbe-4750-b05e-ed42cb43dd3c ">
2024-08-13 18:10:30 +08:00
Jason Lee
b934ff76e6
Add Modal ( #138 )
...
https://github.com/user-attachments/assets/f4c2f9dd-2508-4251-a861-1af3af7542a3
2024-08-13 17:41:12 +08:00
Jason Lee
7059165fa6
datepicker: Fix calender popup background. ( #136 )
...
Closes #135
2024-08-12 18:52:58 +08:00
Jason Lee
bb6d8d8f60
Cleanup first version impls ( #132 )
2024-08-11 14:46:55 +08:00
Jason Lee
97dd09fbda
Fix to display correct days in calendar view. ( #124 )
...
<img width="624" alt="image"
src="https://github.com/user-attachments/assets/3e6528a0-d649-42a9-9c82-f1e06539ec46 ">
<img width="617" alt="image"
src="https://github.com/user-attachments/assets/370dfa05-e8b1-4aa6-8eda-070d6f4a2661 ">
2024-08-09 10:16:31 +08:00
Jason Lee
5d55c5c31e
Add DateRangePicker ( #123 )
...
https://github.com/user-attachments/assets/cc934401-78c5-42d6-afc8-a365fea2129b
2024-08-08 23:29:54 +08:00
Jason Lee
27d094c590
datepicker: Add Year, Month select mode. ( #119 )
...
https://github.com/user-attachments/assets/b6232d8e-0832-449d-a982-49e015232cfa
2024-08-07 23:09:42 +08:00
Jason Lee
ebdcf244e2
Add Calendar and DatePicker. ( #117 )
...
https://github.com/user-attachments/assets/dda87fa7-f080-418a-8dd7-ab8581eb3beb
2024-08-07 20:25:11 +08:00