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
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
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
e03a0d4f4e
chore: Fix Switch, Radio, Checkbox to use inline layout. ( #569 )
2025-01-23 18:05:32 +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
41c64e2912
chore: Update controls detail. ( #352 )
...
- Better icon style in Input, Dropdown, DatePicker.
2024-10-16 17:51:39 +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
75b4f34b92
Try fix Button, Checkbox, Radio text line-height ( #240 )
...
<img width="1202" alt="屏幕截图 2024-09-12 224306"
src="https://github.com/user-attachments/assets/b96fee5e-6d39-4ba0-829c-3eaf4aed8ff2 ">
2024-09-16 10:36:18 +08:00
Jason Lee
55585f9699
windows: Fix button and checkbox line-height again. ( #244 )
...
<img width="1202"
src="https://github.com/user-attachments/assets/6741041a-f449-4600-bec1-751841dcec88 ">
2024-09-13 22:55:59 +08:00
Jason Lee
fbbb985e84
ui: Improve UI details (Modal, Checkbox, Radio and MenuItem) ( #233 )
...
- modal: Reduce modal title line height.
- checkbox, radio: Fix label line height to align with checkbox.
- menu: Update Menu item style, height to 28px, and fix divider padding.
<img width="523" alt="image"
src="https://github.com/user-attachments/assets/c254dc07-9d37-4885-b687-58ec4d8e95a4 ">
<img width="453" alt="image"
src="https://github.com/user-attachments/assets/3ad44419-1953-4048-8173-4d8c0646777a ">
<img width="369" alt="image"
src="https://github.com/user-attachments/assets/84d23eb2-15f9-47d7-b6d4-15295ab3a544 ">
2024-09-10 19:42:54 +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
a049f606c0
Fix Checkbox, Radio label color. ( #200 )
2024-09-02 00:24:57 +08:00
Jason Lee
bb6d8d8f60
Cleanup first version impls ( #132 )
2024-08-11 14:46:55 +08:00
Jason Lee
e9d409a4b1
Add Link style Button ( #97 )
...
<img width="1305" alt="image"
src="https://github.com/user-attachments/assets/ee42d86f-e237-4544-aa2d-1414dabfb55e ">
- Update `primary`, `danger`, `outline`, `ghost`, `link` methods to as a
builder method to just change style.
- Add `compact` used to reduce padding.
<img width="1279" alt="image"
src="https://github.com/user-attachments/assets/ccbd71c0-9157-4ef8-b164-b99ade24cf92 ">
2024-08-01 19:54:35 +08:00
Jason Lee
d659713555
Fix Label, Checkbox, Radio to support label text wrap. ( #90 )
...
<img width="1102" alt="image"
src="https://github.com/user-attachments/assets/1443378d-54e9-43a4-8bb8-0d0f4581169d ">
2024-07-31 11:49:32 +08:00
Floyd Wang
4d9077fe85
Rename ui::stock to ui::stack
2024-07-09 16:25:07 +08:00
Jason Lee
cbbd20867f
Add Icon Button support. ( #11 )
...
When the Button have no label present, it will use the Icon mode.
<img width="891" alt="image"
src="https://github.com/huacnlee/gpui-component/assets/5518/ca6240d5-02c8-4201-9a79-4afdf9938dd8 ">
2024-07-01 21:32:03 +08:00
Jason Lee
3288270b49
Add Popover ( #6 )
2024-06-29 10:03:59 +08:00
Jason Lee
daf4e713d1
Fix ListItem check icon.
2024-06-28 10:11:00 +08:00
Jason Lee
e4fcd24382
Add label to Switch
2024-06-26 10:25:51 +08:00
Jason Lee
08a99217a2
Add TabBar
2024-06-25 19:07:05 +08:00
Jason Lee
8440df938a
Add checkbox, title_bar.
2024-06-25 17:16:04 +08:00