Commit graph

88 commits

Author SHA1 Message Date
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
23d273eaf9
sidebar: Add Sidebar (#452)
Close #430

<img width="1150" alt="image"
src="https://github.com/user-attachments/assets/2564bcfa-7aff-41d3-a7be-496ef2365e30">

<img width="1150" alt="image"
src="https://github.com/user-attachments/assets/18c6718a-7641-4e8f-ad0f-bc18bd91fc42">
2024-12-02 23:21:39 +08:00
Jason Lee
8c464d6709
dock: Fix some panel cannot able to split (#450)
- Rename `set_root` to `set_center`.
2024-12-02 10:42:31 +08:00
Jason Lee
36dcc53824
dock: Add set_dock_collapsible to support setting the Docks to be collapsible or not. (#445)
Close #442 

In this case, the left Dock is not collapsible:

<img width="1165" alt="image"
src="https://github.com/user-attachments/assets/21422cdd-d686-4931-9285-925b8e8d3343">
2024-11-27 21:34:44 +08:00
Jason Lee
142d092867
dock: Add add_panel method to add panel to DockArea. (#440)
Ref #438 

https://github.com/user-attachments/assets/93b40aed-39f3-4d16-a442-13aa7a931895
2024-11-27 11:27:04 +08:00
xda
d937a90db6 dock: Render toggle dock buttons inside the Panels. (#414)
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-11-22 14:41:04 +08:00
Floyd Wang
8b23193f8f
dock: Make the panel dock open state controllable (#429) 2024-11-20 11:24:42 +08:00
Jason Lee
079cc35c48
dock: Limit drag move or close when tab panel or parent only have 1 panel. (#418) 2024-11-14 18:33:49 +08:00
Jason Lee
7edbdd01f4
dock: Remove the inside toggle dock button in Dock to reduce complex and add dock::ToggleButtons. (#415)
Draft https://github.com/longbridgeapp/gpui-component/pull/414 to keep
old code.

<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/749a5712-7ec4-43a8-a89d-595a7644a7ec">
2024-11-14 12:05:58 +08:00
xda
47688a8af2
dock: Generalize Dock's panel to accommodate DockItem (#412)
![2024-11-13 23 01
30](https://github.com/user-attachments/assets/dbb92e6b-ac5d-47c7-9a78-4029b414cdfc)
2024-11-14 12:00:23 +08:00
Jason Lee
e478d5606f
chore: Add base ui attributes to Root and add change font size to story to test font adjust. (#409) 2024-11-12 11:17:16 +08:00
Jason Lee
2c979c32c5
linux: Fix #104 Linux platform crash with BorrowMutError. (#367)
![Screenshot from 2024-10-19
01-20-24](https://github.com/user-attachments/assets/cc0d2250-38ae-4381-a06c-c64ec309ee4c)
2024-10-19 01:21:31 +08:00
Jason Lee
8eff75d357
accordion: Add Accordion. (#355)
<img width="920" alt="image"
src="https://github.com/user-attachments/assets/3269aa05-7531-43a1-84a9-469959a68d06">
2024-10-17 17:31:59 +08:00
Jason Lee
1fdcff3b51
theme: Add apply_color to theme to support merge a new color into theme color. (#353)
- Fix #334 to keep selected theme color.

## Example

<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/3a05f58c-2720-436c-8df9-c582871d87d5">
<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/5b8db494-1402-4785-8d98-a87173b15284">
<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/0305c05b-c2fb-4fea-9a50-5aa00de504fe">
<img width="1472" alt="image"
src="https://github.com/user-attachments/assets/91fbb7b6-7494-440d-95bf-2de37d6bbb44">
2024-10-16 18:38:21 +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
2f4ee70f46
story: Fix story caes (#345)
- Remove WebView story.
- Fix dropdown size.
2024-10-15 14:21:47 +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
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
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
cf88a48bec
dock: Fix toggle dock button display when have nested panels. (#309) 2024-10-04 14:22:24 +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
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
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
Floyd Wang
c5b4505560
feat(button): Remove track_focus (#282) 2024-09-27 14:39:48 +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
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
Floyd Wang
9388b88f59
theme: Simplify init (#237) 2024-09-12 16:14:41 +08:00
Jason Lee
a0d3d35be4
modal: Add to support open multiple Modals. (#232)
- Add `Esc` to close modal.
2024-09-10 16:58:22 +08:00
Jason Lee
840a54850a
Update register_panel to use trait object Fn. (#229) 2024-09-09 19:19:27 +08:00
Jason Lee
33f0291f6d Improve layout save details for example app. 2024-09-09 14:03:51 +08:00
Sunli
ac83fad692
windows: Set the default stack size to 8M on Windows. (#228) 2024-09-09 13:51:10 +08:00
Jason Lee
16396d3583 Revert "Set the stack size of the main thread to 8M (#227)" is not work on macOS.
This reverts commit 2f80ba408a.
2024-09-09 13:34:31 +08:00
Jason Lee
bf134b2ff9
Add to support dump/load Dock layout. (#226) 2024-09-09 13:30:22 +08:00
Sunli
2f80ba408a
Set the stack size of the main thread to 8M (#227)
For fix stack overflow issue on Windows.
2024-09-09 10:24:41 +08:00
Jason Lee
b6374313b2 Fix DockItem::tabs, the items should use trait object to support difference type. 2024-09-06 18:04:26 +08:00
Jason Lee
9baada4fb4
dock: Reduce dock item member (#223) 2024-09-06 17:51:21 +08:00
Jason Lee
adf6f70185
dock: Define a better way to init Dock layout. (#218) 2024-09-05 19:33:32 +08:00
Floyd Wang
d6015f636c
panel: Support custom style for the panel title (#220) 2024-09-05 11:36:59 +08:00
Jason Lee
f2d75f7abd
dock: Fix split_panel to use async. (#214) 2024-09-04 17:30:55 +08:00
Jason Lee
f6b4e5a591
dock: Fix add_panel with placement to split size. (#212)
https://github.com/user-attachments/assets/7177bd8f-5b19-4959-8d60-cae583173e73
2024-09-04 00:35:51 +08:00
Jason Lee
5e86c9cfa0
dock: Revert first argument for TabPanel::new (#207) 2024-09-03 14:04:00 +08:00
Jason Lee
73e82c785a
dock: Improve set_parent in StackPanel insert_panel to use defer instead of spawn (#205) 2024-09-03 11:18:57 +08:00
Jason Lee
8ece86cd0c
dock: Add id to DockArea and improve DockArea init. (#204)
- Export add_panel_at method for TabPanel to split_panel.
- Fix resizeable_panel init size support.
- Fix panel resize to let panel that have initial size will not auto resize on window resize.
- Fix resize_handle sometimes will invisibly bug.
- Update TabPanel new to support give parent StackPanel.
2024-09-02 21:27:19 +08:00
Jason Lee
af09525c1e
dock: Add popup_menu delegate to custom panel menu. (#202) 2024-09-02 14:55:37 +08:00
Jason Lee
f5cae46e42
Improve ColorPicker to support input hex color. (#201)
https://github.com/user-attachments/assets/be5fc290-0464-4356-9f97-c35720e3e11d
2024-09-02 13:56:19 +08:00
Jason Lee
6564c502c9
Add close menu to Panel. (#196) 2024-09-01 21:33:50 +08:00
Jason Lee
9c4411ff2b
date_picker: Reduce DatePicker popup position. (#195) 2024-09-01 00:36:51 +08:00
Jason Lee
9768755eab
Fix panel resize when window resized. (#181)
Co-authored-by: Floyd Wang <gassnake999@gmail.com>
2024-08-28 19:40:35 +08:00
Jason Lee
c5c8e46ac7
New Dock (#172)
https://github.com/user-attachments/assets/c8c55faa-8f17-4fa2-9f62-5fdd598087ef

- [x] Move to insert panel to tabs middle.
- [x] Zoom panel
- [x] Tab popup menu (Close Panel, Split, Zoom in/Zoom out)
- [x] TabBar scrollable
- [ ] TabBar nav history
2024-08-23 18:01:29 +08:00