Commit graph

351 commits

Author SHA1 Message Date
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
xda
51df8f2f04
drawer: support ESC to close it by on_action and call on_close (#341)
Fix #263

![2024-10-14 21 26
02](https://github.com/user-attachments/assets/b6060f82-117a-4935-91df-d336f905624d)
2024-10-15 21:47:45 +08:00
Floyd Wang
9b8240c6bc
table: Improve render_tr to bind the context_menu (#347)
<img width="559" alt="image"
src="https://github.com/user-attachments/assets/2aecfa35-5ee1-45cb-a3f3-2409bd09efd7">
2024-10-15 21:35:17 +08:00
Jason Lee
6a5fff889e
dock: Disallow move panel when it is zoomed in. (#346)
Closes #342
2024-10-15 14:52:40 +08:00
Jason Lee
3041d0020f
webview: Update wry. (#343)
To match Wry recently API changes.

Ref: https://github.com/tauri-apps/wry/pull/1385
2024-10-14 22:19:35 +08:00
Jason Lee
b18207728b
dropdown: Use difference chevron icon color for enabled/disabled dropdown. (#336)
<img width="547" alt="image"
src="https://github.com/user-attachments/assets/07239a63-b1ae-4462-b8ba-d30d7e7e66f5">
2024-10-14 10:19:58 +08:00
Jason Lee
5fd2ebf522
panel: Always not show active tab style, when the dock is collapsed. (#335)
## Before

<img width="249" alt="image"
src="https://github.com/user-attachments/assets/2dfee593-1a07-4b75-913b-d2e17decb67a">

## After

<img width="271" alt="image"
src="https://github.com/user-attachments/assets/20752d04-1f25-498c-8e6e-4ff0f21401bf">
2024-10-14 10:06:20 +08:00
xda
5c8d0d7eb4
scrollbar: Do not show scrollbar event mouse is in Element rect, only show when hovered on scrollbar area or scrolled (#333)
Let the scrollbar only display when hovering and scrolling. The effect
comparison is on the left GPUI and on the right mac. I guess they used
the 10th power ease-in function, and the effect is similar.

Fixes https://github.com/huacnlee/gpui-component/issues/260

![2024-10-11 22 06
51](https://github.com/user-attachments/assets/4fa35150-2f93-4b79-bdbb-d8b7783e4b5a)
2024-10-13 10:53:53 +08:00
Jason Lee
5f1b68a431
menu: Add menu_with_element to add a custom render item. (#330)
<img width="230" alt="image"
src="https://github.com/user-attachments/assets/e12dbde4-c02e-4445-b8ff-5bf0b54c7aac">
2024-10-10 20:22:25 +08:00
xda
2706656e27
resizable: Keep the ratio when adjust widths (rather than falling back to 33.33% when resizing back) (#329)
The essence of the problem is that flex_basis initial_size and
flex_basis size are in conflict: the size overwrites the initial_size
percentage and loses the original percentage in extremely narrow parent
groups, so we have to add the field to the state persisting the desired
percentage.

Fix #262

![2024-10-10 19 35
17](https://github.com/user-attachments/assets/3d06954d-8589-4e12-8c0e-897b0b38cbc5)
2024-10-10 18:50:46 +08:00
Jason Lee
efa044f417
menu: Fix Menu scrollbar will always showing bug. (#328)
- Improved Scrollbar size.
2024-10-10 18:10:28 +08:00
Jason Lee
5915618928
dock: Fix zoom support for side dock panel. (#327)
- Fix emit `PanelEvent::LayoutChanged` when panel resized.
2024-10-10 15:16:16 +08:00
Jason Lee
2198134832
Add col_padding to Table delegate to control the column padding. (#326)
<img width="775" alt="image"
src="https://github.com/user-attachments/assets/a7189c06-9945-4508-86fb-e71fd819cc41">
2024-10-10 13:58:49 +08:00
Jason Lee
fd09229541
story: Fix invalid focus code cause PopupStory Input cannot input anything. (#325)
Closes #324

When we create a Wry WebView, it will take the focus into the WebView.
So we must care to use it, make sure no WebView create if there no need
to display.

> The `ui::WebView` has implemented when we click out of the WebView to
move focus back to the main window.
>
> But by my test, first render it not work will because the Render is
not trigger so the click out event not listened.

Currently change just removed WebViewStory from the demo.
2024-10-09 15:08:18 +08:00
Jason Lee
0220cf8cc6
dock: Add version to DockArea to allow us check the persisted state is need to update. (#323) 2024-10-08 20:46:12 +08:00
Jason Lee
45d4b445ec
panel: Toggle to zoom out when close a panel. (#322) 2024-10-08 18:09:41 +08:00
Jason Lee
4fd233ae6b
webview: Invoke blur on call hide method for WebView and update example. (#321) 2024-10-08 18:09:25 +08:00
Jason Lee
33200aa685
webview: Blur WebView when clicked out to fix IME cannot input bug. (#320)
- Closes #316 
- Ref https://github.com/tauri-apps/wry/pull/1385

## Before

https://github.com/user-attachments/assets/cc614334-47fe-4722-8745-aea783fbab4a

## After

On macOS, now the IME bug is gone.

https://github.com/user-attachments/assets/363bb016-229f-4766-84f7-6a4838e490bf

https://github.com/user-attachments/assets/320c5c1c-cfac-4165-af8a-bc9708952460
2024-10-08 17:01:52 +08:00
Jason Lee
007288487e
table: Fix horzizontal scrollbar size when there have fixed cols. (#317) 2024-10-07 21:47:26 +08:00
Jason Lee
e1e66e8f07
dock: Fix toggle button check will stack overflow bug. (#312)
Continue #297 #309

```
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
[1]    45068 abort      cargo run
```
2024-10-04 15:00:00 +08:00
Jason Lee
3df75566b3
table: Fix to render table vertical scrollbar under the head. (#311)
Closes #308, #305 

<img width="819" alt="image"
src="https://github.com/user-attachments/assets/e22d7ae7-2dfd-4357-be0e-3b94434b1020">
2024-10-04 14:35:36 +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
cf88a48bec
dock: Fix toggle dock button display when have nested panels. (#309) 2024-10-04 14:22:24 +08:00
Jason Lee
185eca6c67
scrollbar: Update GPUI and fix scrollbar with new API. (#307)
The https://github.com/zed-industries/zed/pull/18513 has been changed
the `UniformListScrollHandle` API, it provided the scroll contents size,
so we not need calculate it again.
2024-10-04 10:23:11 +08:00
Jason Lee
9a64bc43d9
tooltip: Fix Tooltip text line-height. (#304)
<img width="247" alt="image"
src="https://github.com/user-attachments/assets/483d6fed-2494-432a-81c3-59a2c220df9d">
2024-10-03 18:01:56 +08:00
Jason Lee
ca5a0e02d5
dock: Add to support save left, right, bottom dock state. (#303)
The dock state have been updated to use `DockAreaState`.
2024-10-03 17:25:31 +08:00
Jason Lee
19bb5eee3a
Fix clippy warnings and fix CI to fail when have warnings. (#301) 2024-10-03 10:46:02 +08:00
Jason Lee
ce10a0340c
table: Set fixed height to table head to fix some case table head disappear bug. (#300)
Closes #299 

- Improved sort icon to better color.
- Improved table story.
- Disable `horizontal_scroll_handle.scroll_to_item` on select_col, there
have a bug need to fix.
2024-10-03 10:14:44 +08:00
Jason Lee
494e6d15f3
dock: Fix incorrect toggle button shown, when there is not have left or right dock. (#297) 2024-10-02 23:00:26 +08:00
Jason Lee
fecb2170a8
table: Fix table sort icon display. (#296)
- Update first sort behaviour to `descending`.
2024-10-02 22:31:38 +08:00
Jason Lee
13e42dfac3
table: Add to support fixed column on left to Table. (#295)
- Update table details, fix table head height.
- Add `table_row_border` theme color and use this for row border.

## Demo

https://github.com/user-attachments/assets/91df4b9d-f079-4ddb-b14d-fbcf303dcc44

Fix #292
2024-10-02 22:02:21 +08:00
Jason Lee
33e5fdcb78
scrollbar: Smaller the scrollbar size. (#294)
<img width="918" alt="image"
src="https://github.com/user-attachments/assets/787766ab-63eb-4568-972b-5abd668511f7">
2024-10-02 18:15:53 +08:00
Jason Lee
6f1be83b6e
dock: Add left, bottom, right fixed dock and support toggle. (#291)
- Improve TabPanel to support control closable.

## Demo 


https://github.com/user-attachments/assets/dcf8cde3-61ee-42f6-be93-76f10fc8cf34
2024-10-02 17:42:52 +08:00
ihavecoke
20b9f9c0f2
input: Move caret to line start or end with selected content (#288)
Ref: https://support.apple.com/en-hk/102650

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-10-02 17:35:27 +08:00
ihavecoke
b9e7217662
table: Add refresh method to Table, for reload table use when the columns or rows has been updated. (#293) 2024-10-02 17:29:50 +08:00
Jason Lee
7de1c6981e
windows: Fix keybinding display on Windows. (#289)
<img width="191" alt="image"
src="https://github.com/user-attachments/assets/7cc4d80f-5759-4432-9a13-6fd027af4b27">
2024-09-29 23:07:45 +08:00
xda
e43cc48465
Deduplicate Switch animations (#287) 2024-09-29 20:21:56 +08:00
Jason Lee
baa45173d1
button: Fix Button text to align vertical center. (#286)
<img width="1188" alt="image"
src="https://github.com/user-attachments/assets/084727c3-5822-4325-9bbf-374b357b670f">

The point is add `.font_family(".SystemUIFont")` to root view.
2024-09-27 20:44:23 +08:00
Jason Lee
2b134e47a1
button: Reduce gap between icon and label for small, xsmall button. (#285) 2024-09-27 20:28:57 +08:00
Jason Lee
69e94cce1c
table: Add size to Table to support Large, Medium(default), Small, XSmall. (#283)
Closes #219
2024-09-27 14:45:52 +08:00
Floyd Wang
c5b4505560
feat(button): Remove track_focus (#282) 2024-09-27 14:39:48 +08:00
Floyd Wang
2c1119a7bd
feat(button): Support customize loading icon (#281) 2024-09-27 13:56:04 +08:00
Jason Lee
76be7a8ed8
table: Add horizontal scrollbar to Table. (#278) 2024-09-27 13:48:46 +08:00
Floyd Wang
708e373ab6
feat(indicator): Update icon type (#280) 2024-09-27 11:58:14 +08:00
Jason Lee
e1bf3556a9
menu: Blocking mouse move event to back view, when PopupMenu has open. (#277)
Closes #275


https://github.com/user-attachments/assets/7061fd93-10dd-4645-8080-ec7dbb65a80e
2024-09-26 21:38:52 +08:00
Jason Lee
709c706adf
menu: Improve Menu to avoid invalid or duplicate separators. (#276) 2024-09-26 21:28:42 +08:00
Floyd Wang
d2f26795eb
feat(list_item): Add stop_propagation/prevent_default when trigger click event (#273) 2024-09-26 11:55:02 +08:00
Jason Lee
098315ee92
button: Reduce px for compact small button. (#271)
<img width="882" alt="image"
src="https://github.com/user-attachments/assets/c41955ea-5126-4d1a-b2dd-dea2e4b89c9e">
2024-09-25 21:48:44 +08:00
Jason Lee
2d6f478512
dock: Add zoomable support to Panel. (#269) 2024-09-24 22:37:29 +08:00
xda
1e44b5659f
table: Render table stripe on background even there is no enough rows (#256)
<img width="1202" alt="image"
src="https://github.com/user-attachments/assets/57a744c3-673a-4118-ba97-03837b0b9390">

- And add `flex_shrink_0` to table head.

Fix https://github.com/huacnlee/gpui-component/issues/160

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-09-24 22:07:27 +08:00