Jason Lee
ebe93210af
Use normal cursor for buttons. ( #760 )
...
This change to follow native UI to use normal cursor for all buttons,
items.
Only use `pointer` for link item.
2025-04-01 17:59:27 +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
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
649e765729
story: Add TitleBar to examples. ( #586 )
2025-01-26 15:07:34 +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
466c5e2005
root: Add window shadow to Root for support window border style on Linux. ( #514 )
...
And fix the title bar buttons click handle on Linux.
2024-12-24 13:33:06 +08:00
Jason Lee
4b5d917e83
title_bar: Update on_close_window to support binding with cx.listener. ( #388 )
2024-11-01 18:39:25 +08:00
Jason Lee
80230c643f
title_bar: Add on_close_window method callback for TitleBar to custom close window method for Linux. ( #387 )
2024-11-01 17:06:31 +08:00
Floyd Wang
b997eabcba
title_bar: Make the left padding adjustable ( #386 )
2024-11-01 14:20:49 +08:00
Jason Lee
292d1a6a9a
theme: Rename title_bar_background to title_bar. ( #382 )
...
Use same name rule as other theme variables.
2024-10-30 14:25:21 +08:00
Jason Lee
53311b06f8
title_bar: Impl Styled to TitleBar. ( #375 )
2024-10-22 14:42:40 +08:00
Jason Lee
38fc226c22
title_bar: Export TitleBarElement. ( #369 )
2024-10-21 19:23:20 +08:00
Jason Lee
2aaf424df9
title_bar: Fix move window support for Linux. ( #368 )
2024-10-21 15:23:36 +08:00
Jason Lee
f35db249a6
theme: Update GPUI and imporve dark color. ( #358 )
...
## Before
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/f4e74cf0-e386-4e91-86d1-05ee75b26471 ">
## After
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/da393ea9-79ee-4535-a46d-68684d7ad738 ">
2024-10-17 19:14:42 +08:00
Jason Lee
6b54396c9c
title_bar: Fix TitleBar prefix padding when is zoomed and support double click to toggle zoom. ( #357 )
2024-10-17 18:22:32 +08:00
Jason Lee
fdca75d5a7
title_bar: Add a new TitleBar, remove the old version. ( #348 )
...
- Removed old workspace crate, moved out to
[gpui-workspace](https://github.com/huacnlee/gpui-workspace )
<img width="491" alt="image"
src="https://github.com/user-attachments/assets/5048491c-9b98-4af5-9f0f-9a0f20c2308f ">
Icons for Windows and Linux use by SVG icon, it based on:
-
https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font
- Download Font: [Segoe Fluent
Icons](https://learn.microsoft.com/en-us/windows/apps/design/downloads/#fonts )
2024-10-16 16:22:17 +08:00
Jason Lee
f2703122b8
Move title_bar, util into workspace.
2024-07-01 23:51:47 +08:00
Jason Lee
8440df938a
Add checkbox, title_bar.
2024-06-25 17:16:04 +08:00