Commit graph

536 commits

Author SHA1 Message Date
Jason Lee
0327df323d
modal: Fix Model, Drawer overlay size on tiling mode. (#518) 2024-12-27 17:22:02 +08:00
Jason Lee
6851e53183
dock: Fix to active prev tab, when current tab is invisible. (#517) 2024-12-27 11:58:19 +08:00
Jason Lee
9eba97ddf6
modal: Fix modal, drawer overlay position on Linux. (#515)
- Update `overlay` for Modal, still handle click out to dismiss, even it
no overlay.
2024-12-24 14:43:37 +08:00
Jason Lee
6acbfb5298 root: Fix window border and add cx.theme().window_border 2024-12-24 13:48:28 +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
3601cb399b
table: Use deferred to render scrollbar to avoid some element overflow it. (#513) 2024-12-24 11:40:50 +08:00
Jason Lee
7d8166a05e linux: Fix window border on Linux. 2024-12-24 11:33:33 +08:00
Jason Lee
ea0954b425
drawer: Render notification at the side of drawer when drawer (top, right) it opened. (#512)
This change to make sure notification will display when WebView render
on the drawer.

![Screenshot from 2024-12-24
09-25-10](https://github.com/user-attachments/assets/01d9685c-7790-4fe7-ba0a-217a0fec7d34)
2024-12-24 09:46:40 +08:00
Jason Lee
d051ac6a8c
table: Update last empty column to 20px width. (#511) 2024-12-23 19:36:58 +08:00
Jason Lee
11dbdb125a
chore: Removed ScrollableAxis use Axis instead. (#509) 2024-12-23 15:30:36 +08:00
Jason Lee
500aa2d7c5 table: Fix to only handle one way scrolling at same time. (#507)
Closes #314
2024-12-20 22:07:01 +08:00
Jason Lee
28463d3a18
panel: Fix panel to unexpected size chagnes when moved some panel. (#506)
### Before 



https://github.com/user-attachments/assets/9174033b-d901-412f-9176-cdef6438822f
2024-12-20 19:15:31 +08:00
Jason Lee
57c1da2441
panel: To keep panel size when it going to hidden. (#505)
This change for make sure when Panel to hide and show, the original
panel size will keep.
2024-12-20 19:02:55 +08:00
Jason Lee
c8fae22684 story: Fix image story image size. 2024-12-20 18:29:11 +08:00
xda
6a310c618f
input: Up, Down to keep the same column if it possible (#500)
Fix #468
2024-12-20 18:21:22 +08:00
Jason Lee
2f4b7a3eca
virtual_list: Try to use second item to measure. (#504) 2024-12-20 18:15:33 +08:00
Jason Lee
1a4ee348f8
dock: Add visible method to Panel trait to control panel visible. (#503)
Closes #502 #499 

## Added

- Add `visible` method to `Panel` trait, if return false this panel will
disappear.

## Break changes

- Renamed `closeable` to `closable`.
- The `title_style`, `closable`, `zoomable` in `Panel` trait have been
change `cx: &WindowContext` to `cx: &AppContext`.
2024-12-20 10:21:21 +08:00
Jason Lee
4b211bfe21
panel: Add set_active, set_zoomed method to Panel trait. (#501)
It will called when the panel active, zoom state changed.
2024-12-19 10:29:58 +08:00
Jason Lee
4e3b988e24
theme: Fix secondary active color in light mode. (#498)
<img width="968" alt="image"
src="https://github.com/user-attachments/assets/e86a3772-227e-4223-adbd-fb0387f9d735"
/>
2024-12-18 18:13:46 +08:00
Jason Lee
d4819b34aa
chore: Update GPUI with AnchorCorner renamed to Corner. (#497)
Ref https://github.com/zed-industries/zed/pull/22119
2024-12-18 18:02:47 +08:00
Jason Lee
24982fb78c
scrollbar: Improve thumb bounds for avoid trigger scrollbar. (#496) 2024-12-18 17:21:57 +08:00
Jason Lee
4f7ca4bb9a
virtual_list: Add VirtualList (#495)
Vistual List for render a large number of differently sized
rows/columns.

> NOTE: This must ensure each column width or row height.

Unlike the `uniform_list`, the each item can have different size. This
is useful for more complex layout, for example, a table with different
row height.
2024-12-18 16:38:58 +08:00
reya
8260b5f6a0
fix: wrong size variant in sizable trait (#493) 2024-12-17 09:22:48 +08:00
xda
5874c6974f
tiles: Add Tiles (#435)
## Break Changes

- Renamed `DockItemState` to `PanelState`.
- Renamed `DockItemInfo` to `PanelInfo`.
- Update `cx` type from `WindowContext` to `AppContext` for Panel trait
`panel_name` method.

## TODO

- [ ] Support merge panels into TabPanel.
- [ ] Support split panels into Tile.

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-12-16 20:33:14 +08:00
Jason Lee
5a1b61b0b5 chore: Update LICENSE-APACHE file to add copyright info. 2024-12-13 11:46:00 +08:00
Jason Lee
a5a72fcb5a
panel: Avoid render panel when TabPanel is collapsed. (#492)
Close #488

- Fix `collapsed` sync to `TabPanel` when load state.
2024-12-13 11:23:00 +08:00
Jason Lee
5630154590 chore: Save layout.json to target/layout.json. 2024-12-13 10:20:30 +08:00
Jason Lee
d701baed28
dock: Do not active tab when drop to TabPanel right empty area. (#491) 2024-12-12 19:18:42 +08:00
Jason Lee
28c072d9c6
table: Fix incorrect column offset when have fixed columns. (#490) 2024-12-12 17:40:25 +08:00
Jason Lee
8558da4a7b
table: Improve Table to only render visible range columns for performance up to stable on 120 FPS (#489)
This change to make Table to only render visible range columns.

With the example table story case:

- 32 columns

## Before

- Normally fast scroll: 80~90 FPS
- Drag fast scroll: 60 FPS

## After

- Normally fast scroll: 120 FPS
- Drag fast scroll: 90~100 FPS

![CleanShot 2024-12-12 at 16 57
54](https://github.com/user-attachments/assets/1553d109-442c-4633-92f2-d3a9724668f3)
2024-12-12 17:09:26 +08:00
Jason Lee
64a3b4399b
chore: Update GPUI with gradient support. (#487) 2024-12-12 10:19:38 +08:00
Jason Lee
094611a2ae
input: Avoid handle up, down in Input single line mode. (#485) 2024-12-10 19:01:35 +08:00
Jason Lee
cf090923a7
theme: Fix lighten, darken method. (#483)
Close #332
2024-12-10 17:35:44 +08:00
Jason Lee
9f0f05af2d
scrollbar: Adjust scrollbar style and add scrollbar_thumb_hover to theme. (#482)
<img width="297" alt="image"
src="https://github.com/user-attachments/assets/1779bf6c-2d01-4a12-9052-2ba571bff68b">

<img width="301" alt="image"
src="https://github.com/user-attachments/assets/9971b248-9a48-47ff-847c-00eafff17fe1">
2024-12-10 17:08:09 +08:00
Jason Lee
2836540260
scrollbar: Improve scrollbar behaviour. (#481)
- Only show scroll when recent scrolled.
- Keep showing scrollbar when is visible and hovered on.
- Delay 3s to fade out.
- If not visible, do not handle mouse down event.
- Add `cx.theme().scrollbar_show` option to control scrollbar show
`[Hover, Scrolling]`, default: `Scrolling`.

Close #472

![CleanShot 2024-12-10 at 15 43
43](https://github.com/user-attachments/assets/17e5f46a-5602-4544-9a5c-82ec68a24dd4)
2024-12-10 16:18:38 +08:00
Jason Lee
26024ba2b5
scrollbar: Use default cursor style when hovered on scrollbar. (#480)
- Move prepare code to `prepaint` stage.

Close #474
2024-12-10 14:43:02 +08:00
Jason Lee
22f60c7299
story: Revert scrollable for StoryContainer for fix size_full. (#479)
Ref #478
2024-12-10 14:38:09 +08:00
Jason Lee
782cea35fc
chore: Rename longbridgeapp to longbridge. (#477) 2024-12-10 11:36:39 +08:00
Jason Lee
9288dc91c2
input: Add to support multi-line Input. (#463) 2024-12-09 20:17:05 +08:00
ihavecoke
39ec84b989
table: Add a theme color to fixed the drag column in dark mode text style (#476) 2024-12-09 20:00:48 +08:00
Jason Lee
62ce148c19
scrollbar: Fix position may out of container bounds when clicked scrollbar bg. (#475) 2024-12-09 17:21:48 +08:00
Floyd Wang
59d9341280 image_story: Fix the pie_chart size 2024-12-09 16:00:19 +08:00
ihavecoke
bf0e3a22de
table: Emit MoveCol when moved column. (#473) 2024-12-09 15:21:37 +08:00
Jason Lee
d8636a31bd
chore: Fix clippy warnings. (#465) 2024-12-05 12:03:29 +08:00
reya
07a8e70d1a
dock: Add DockItem::panel (#464)
**Description**:
Improve the flexibility of `DockArea`, sometime user won't need a
`TabPanel`, just display some message or UI elements. Curren implement
only allow use Tab or Split. So this PR will add `Plain` to `DockItem`,
user can put anything which implement `PanelView` trait.

**Usage**:
```rust
let left_panels = DockItem::panel(Arc::new(<- PanelView ->));

_ = dock_area.update(cx, |view, cx| {
    view.set_version(DOCK_AREA.version, cx);
    view.set_left_dock(left_panels, Some(px(260.)), true, cx);
    view.set_center(dock_item, cx);
    view.set_dock_collapsible(
        Edges {
            left: false,
            ..Default::default()
        },
        cx,
    );
});
```

**Screenshot**
<img width="1300" alt="image"
src="https://github.com/user-attachments/assets/a01e427c-50f1-4509-82d1-76cc016aa7b3">
2024-12-05 11:12:08 +08:00
Jason Lee
bc7dfb877b
badge: Add Badge. (#462)
<img width="824" alt="image"
src="https://github.com/user-attachments/assets/1aacdb99-a890-46fb-a0db-a94eb125598b">

<img width="824" alt="image"
src="https://github.com/user-attachments/assets/b9af9807-4994-4050-84d9-cf5d4d8d172a">
2024-12-03 23:07:39 +08:00
Jason Lee
cc23291d19
breadcrumb: Add Breadcrumb. (#461)
<img width="1187" alt="image"
src="https://github.com/user-attachments/assets/a64b88da-bc57-4d28-a440-b4b7b456612b">
2024-12-03 22:24:44 +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
Floyd Wang
7560542659
divider: Support custom colors (#459)
<img width="850" alt="image"
src="https://github.com/user-attachments/assets/0161b14d-88ae-4bdf-a515-34df9aefb845">
2024-12-03 19:06:10 +08:00
Jason Lee
bdcf552ecf
theme: Remove Theme::get_global, there have Theme::global method. (#458) 2024-12-03 18:55:50 +08:00