Commit graph

593 commits

Author SHA1 Message Date
Jason Lee
f41edfd318
list: Add ListEvent to List. (#552)
- Add `ListEvent` and emit event for List with `Select`, `Confirm`,
`Cancel` events.

## Break Changes

- Removed useless `ListDelegate::confirmed_index` method.
- Updated `ListDelegate::confirm` method, to change `ix: Option<usize>`
to `ix: usize`.
2025-01-17 16:00:28 +08:00
Floyd Wang
569a4e7262
dropdown_button: Add new component (#551)
## Regular
<img width="162" alt="image"
src="https://github.com/user-attachments/assets/4e597d0b-41d1-4b0e-9939-728cae71fe65"
/>

## Active
<img width="162" alt="image"
src="https://github.com/user-attachments/assets/0871ed6b-3188-44dd-93d4-5996f9213edc"
/>
<br />
<img width="162" alt="image"
src="https://github.com/user-attachments/assets/b05ccdc6-e405-47d0-97e7-470afadbbd38"
/>


## Break Change
Move `ButtonGroup` into the `button`.
2025-01-17 14:16:24 +08:00
Jason Lee
04d720f3a7
chore: Improve Table, List load more threshold, and avoid duplicate request. (#550)
- Default `threshold` changed to 20.
2025-01-17 11:25:41 +08:00
Floyd Wang
0312e47554
input: Move number input into input (#549) 2025-01-17 10:07:41 +08:00
Jason Lee
8dca96469e
chore: Update GPUI with MSAA and PathBuilder. (#548) 2025-01-15 16:52:03 +08:00
Jason Lee
a0f6b48eff
chore: Update GPUI 2025/01/14 (#547) 2025-01-14 19:21:04 +08:00
Jason Lee
7848311046
list, table: Add default loading animation to List and Table. (#546)
<img width="485" alt="image"
src="https://github.com/user-attachments/assets/568cbf3a-6e32-4b21-8816-5e3cb26acc82"
/>

<img width="755" alt="image"
src="https://github.com/user-attachments/assets/5e13d6b8-e6f4-4cc3-b1f6-9b378ff523a4"
/>
2025-01-14 11:36:33 +08:00
ihavecoke
1d18edef12
list: Allow disabling List selection. (#545)
## Break changes

- Renamed list `enable_scrollbar` to `scrollbar_visible` to match with
the table API.

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-01-14 10:05:49 +08:00
Jason Lee
1218ceb7dc
table: Add scrollbar_visible to Table for control the scrollbar visibility. (#544)
Ref #513 #542 

Add this to ability to render some custom view on top of the table, but
below of the scrollbar.

## Break changes

- table: Renamed `scrollbar_state` to `vertical_scrollbar_state`.
- table: Removed `scroll_handle` and `horizontal_scroll_handle` method,
there have a pub `vertical_scroll_handle` and `horizontal_scroll_handle`
prop.
2025-01-13 14:59:03 +08:00
Ylin
eb10186463
table: Add visible_rows_changed, visible_cols_changed method to table delegate. (#543)
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-01-13 13:51:20 +08:00
Jason Lee
205a499bc9
table: Revert deferred render scrollbr for table. (#542)
This will make scrollbar always stay on top, even there have other
element cover it.
2025-01-12 22:32:43 +08:00
Floyd Wang
464fceac96
theme: Rename destructive to danger (#541) 2025-01-10 15:16:19 +08:00
Floyd Wang
31736b0e21
badge: Add new component (#540)
<img width="137" alt="image"
src="https://github.com/user-attachments/assets/6d7008b2-fe0f-4c4e-bd16-1dd8ae883f11"
/>
<img width="118" alt="image"
src="https://github.com/user-attachments/assets/3137dd88-5038-4c59-90c1-cee2cdc542bd"
/>
2025-01-10 14:28:27 +08:00
Floyd Wang
2aad7e412a
tag: Rename badge to tag (#539) 2025-01-10 10:28:47 +08:00
Floyd Wang
ceba66c22d dock: Add PanelControl for pinning the toolbar button (#537)
<img width="387" alt="image"
src="https://github.com/user-attachments/assets/b3d3f2a8-dc4e-49e6-8e82-e7f551d70bc7"
/>
2025-01-09 19:18:59 +08:00
Jason Lee
de42cc46a7
panel: Update Panel toolbar_buttons method to use ViewContext<Self>. (#536)
## Break changes

The `toolbar_buttons` trait method in Panel has been changed:

```diff
- fn toolbar_buttons(&self, cx: &WindowContext) -> Vec<Button>
+ fn toolbar_buttons(&self, cx: &mut ViewContext<Self>) -> Option<Vec<Button>>
```
2025-01-09 16:49:35 +08:00
Jason Lee
bf82e3db13
list, table: Add scroll_to_item to List, scroll_to_row to Table. (#535) 2025-01-09 14:23:46 +08:00
Floyd Wang
8aac2f75e4
popup_menu: More compact checked style (#534)
## Before
<img width="360" alt="image"
src="https://github.com/user-attachments/assets/be388143-efed-4a47-b4f7-11018fe22f99"
/>

## After
<img width="336" alt="image"
src="https://github.com/user-attachments/assets/449b7dd3-c51f-4673-a068-34ac813d79fd"
/>
2025-01-08 18:37:14 +08:00
Floyd Wang
bf8eb3f459 ci: Fix lint 2025-01-08 16:25:35 +08:00
Floyd Wang
d48a6d4b43
table: Support clear selection (#533) 2025-01-08 16:18:49 +08:00
dependabot[bot]
804705a260
build(deps): bump wry from 0.47.2 to 0.48.0 (#530)
Bumps [wry](https://github.com/tauri-apps/wry) from 0.47.2 to 0.48.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tauri-apps/wry/releases">wry's
releases</a>.</em></p>
<blockquote>
<h2>wry v0.48.0</h2>
<!-- raw HTML omitted -->
<pre><code>Updating crates.io index
     Locking 404 packages to latest compatible versions
      Adding html5ever v0.26.0 (available: v0.29.0)
      Adding soup3 v0.5.0 (available: v0.7.0)
      Adding toml v0.8.2 (available: v0.8.19)
      Adding toml_datetime v0.6.3 (available: v0.6.8)
      Adding toml_edit v0.20.2 (available: v0.20.7)
Fetching advisory database from
`https://github.com/RustSec/advisory-db.git`
Loaded 722 security advisories (from /home/runner/.cargo/advisory-db)
    Updating crates.io index
    Scanning Cargo.lock for vulnerabilities (405 crate dependencies)
Crate:     atk
Version:   0.18.2
Warning:   unmaintained
Title:     gtk-rs GTK3 bindings - no longer maintained
Date:      2024-03-04
ID:        RUSTSEC-2024-0413
URL:       https://rustsec.org/advisories/RUSTSEC-2024-0413
Dependency tree:
atk 0.18.2
└── gtk 0.18.2
    ├── wry 0.48.0
    ├── webkit2gtk 2.0.1
    │   └── wry 0.48.0
    └── tao 0.31.0
        └── wry 0.48.0
<p>Crate:     atk-sys
Version:   0.18.2
Warning:   unmaintained
Title:     gtk-rs GTK3 bindings - no longer maintained
Date:      2024-03-04
ID:        RUSTSEC-2024-0416
URL: <a
href="https://rustsec.org/advisories/RUSTSEC-2024-0416">https://rustsec.org/advisories/RUSTSEC-2024-0416</a>
Dependency tree:
atk-sys 0.18.2
├── gtk-sys 0.18.2
│   ├── webkit2gtk-sys 2.0.1
│   │   ├── wry 0.48.0
│   │   └── webkit2gtk 2.0.1
│   │       └── wry 0.48.0
│   ├── webkit2gtk 2.0.1
│   └── gtk 0.18.2
│       ├── wry 0.48.0
│       ├── webkit2gtk 2.0.1
&lt;/tr&gt;&lt;/table&gt;
</code></pre></p>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tauri-apps/wry/blob/dev/CHANGELOG.md">wry's
changelog</a>.</em></p>
<blockquote>
<h2>[0.48.0]</h2>
<ul>
<li><a
href="eb0c8163f1"><code>eb0c816</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1423">#1423</a> by
<a
href="https://github.com/tauri-apps/wry/../../SpikeHD"><code>@​SpikeHD</code></a>)
Rename <code>{WebViewBuilderExtWindows,
WebViewBuilderExtUnix}::with_extension_path</code> to
<code>with_extensions_path</code>.</li>
<li><a
href="b4ba5b47f2"><code>b4ba5b4</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1426">#1426</a> by
<a
href="https://github.com/tauri-apps/wry/../../FabianLars"><code>@​FabianLars</code></a>)
On Windows, Wry will now log PostMessage errors instead of
panicking.</li>
<li><a
href="f0c6b947dd"><code>f0c6b94</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1441">#1441</a> by
<a
href="https://github.com/tauri-apps/wry/../../renovate"><code>@​renovate</code></a>)
Updated <code>webview2-com</code> to <code>0.34</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="2ffcd494af"><code>2ffcd49</code></a>
Apply Version Updates From Current Changes (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1424">#1424</a>)</li>
<li><a
href="6ad66d3880"><code>6ad66d3</code></a>
chore(deps): update rust crate pollster to 0.4.0 (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1405">#1405</a>)</li>
<li><a
href="f0c6b947dd"><code>f0c6b94</code></a>
fix(deps): update rust crate webview2-com to 0.34 (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1441">#1441</a>)</li>
<li><a
href="ca74176748"><code>ca74176</code></a>
chore(deps): update rust crate winit to 0.30 (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1235">#1235</a>)</li>
<li><a
href="72f386f1c5"><code>72f386f</code></a>
fix: tried to access uninitialized instance variable (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1425">#1425</a>)</li>
<li><a
href="413817c8ad"><code>413817c</code></a>
chore(deps): update rust crate tao to 0.31 (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1351">#1351</a>)</li>
<li><a
href="e3ef45f586"><code>e3ef45f</code></a>
fix(deps): update rust crate thiserror to v2 (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1411">#1411</a>)</li>
<li><a
href="b4ba5b47f2"><code>b4ba5b4</code></a>
fix: log postmessage errors (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1426">#1426</a>)</li>
<li><a
href="4740c0bf60"><code>4740c0b</code></a>
refactor: destruct tuples to enhance readability (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1438">#1438</a>)</li>
<li><a
href="eb0c8163f1"><code>eb0c816</code></a>
refactor!: Rename <code>with_extension_path</code> to
<code>with_extensions_path</code> (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1423">#1423</a>)</li>
<li>See full diff in <a
href="https://github.com/tauri-apps/wry/compare/wry-v0.47.2...wry-v0.48">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=wry&package-manager=cargo&previous-version=0.47.2&new-version=0.48.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-08 15:11:33 +08:00
Jason Lee
63a9e61fd1 Fix lint 2025-01-08 15:08:41 +08:00
Jason Lee
3773337e04
list: Add load_more. (#532) 2025-01-08 15:05:40 +08:00
xda
da4c188bc6
input: Support Cmd+Up, Cmd+Down, Cmd+Shift+Up, Cmd+Shift+Down (#531)
![2025-01-06 22 28
27](https://github.com/user-attachments/assets/16a20c24-b8d6-4d43-bfa0-6b2dd0d80ffc)
2025-01-06 23:02:40 +08:00
Jason Lee
e012eb6d07
history: Add unique mode to keep unique item in History. (#529) 2025-01-06 19:19:36 +08:00
Jason Lee
99e51288e0
table: Binding popup menu on the table not on row for avoid render it on each rows. (#528)
- Add `TableEvent::DoubleClickedRow` to emit double clicked row event to
table.
2025-01-03 18:10:07 +08:00
Jason Lee
5be03543dd
history: Export undos, redos methods, and add clear method. (#527) 2025-01-03 16:57:00 +08:00
xda
8b89b5ba7c
input: Fix TextInput cursor getting stuck on Down key press (#526)
## Before

![2025-01-03 13 55 08
before](https://github.com/user-attachments/assets/3714e316-289b-4426-b18a-23ac718c05e6)

## After

![2025-01-03 13 54 22
after](https://github.com/user-attachments/assets/5d82a864-6cda-4191-adee-26634ef93506)
2025-01-03 14:46:51 +08:00
xda
0cc6b90cde
input: Handle moving above the first line (#525) 2025-01-03 12:22:48 +08:00
Jason Lee
482a31fa19
input: Fix TextArea enter to newline not work and scroll to visible on move cursor. (#523)
Close #494

- Fix enter to newline.
- Fix to ensure scroll on move cursor or enter.
2024-12-31 19:19:14 +08:00
Jason Lee
a5427ae662
title_bar: Avoid zoom window on double clicked on title bar right area. (#522)
Close #516
2024-12-31 18:57:11 +08:00
xda
66d9a34844
tiles: Add History<I> to track changes with undo, redo methods. (#510)
![2024-12-27 10 45
47](https://github.com/user-attachments/assets/616feb99-bfb4-42b1-a4b7-9670503be4a5)
2024-12-31 18:47:21 +08:00
Jason Lee
ecce9f2633
number_input: Fix Number Input border to use cx.theme.input. (#521) 2024-12-27 19:03:24 +08:00
Jason Lee
d7cd0e54c2
list: Fix selected and confirmed list item detail. (#520)
Closes #519 to fix popup_menu attempt to subtract with overflow bug.
2024-12-27 18:41:27 +08:00
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
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
Ylin
ee38970d68 table: Make selected_{row,col} public (#456) 2024-12-03 16:21:36 +08:00
Ylin
dd1b767b8a
table: Make set_selected_row, set_selected_col public (#455)
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-12-03 12:00:15 +08:00
Jason Lee
97c01c75e8
theme: Fix menu item hover style. (#454)
<img width="470" alt="image"
src="https://github.com/user-attachments/assets/0255d03d-1e67-49c7-ad3f-5507777d82a3">
<img width="449" alt="image"
src="https://github.com/user-attachments/assets/ab7dd027-8e81-408b-8d02-69cc27fcb801">
<img width="255" alt="image"
src="https://github.com/user-attachments/assets/e789cceb-8aa6-432e-abb0-ba7a14b793bd">
2024-12-03 10:07:53 +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
Ylin
09455df61c
table: Fix disabled sort field change to default (#451)
Co-authored-by: linxin <xin.lin@longbridge-inc.com>
2024-12-02 11:28:16 +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
9d476f9517
scrollbar: Use paint_layer for scrollbar paint. (#448)
And increase scrollbar thumb color in normal mode.

But, it looks like no difference for performance.
2024-11-28 11:42:19 +08:00
Jason Lee
5468d034da
theme: Add color method for default color palette to get color by a scale number. (#447)
```rs
ui::red(50);
ui::blue(600);
```
2024-11-28 11:36:33 +08:00
Jason Lee
a941c7b32e
panel: Fix toggle button border overlap with first tab. (#446)
<img width="202" alt="image"
src="https://github.com/user-attachments/assets/ab7b9865-52be-4bdb-bade-9b0c47e83bb7">
2024-11-27 23:00:25 +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
7fe91e4e12
dock: Add panel_style to support always show TabBar. (#444)
Close #441 

```rs
DockArea::new(MAIN_DOCK_AREA.id, Some(MAIN_DOCK_AREA.version), cx).panel_style(PanelStyle::TabBar)
```

<img width="1433" alt="image"
src="https://github.com/user-attachments/assets/2013188e-990b-4709-ac7e-43c2de8bc895">
2024-11-27 21:34:27 +08:00
xda
53fe5823ef
dock: Fix panel should have a maximal width restriction when resizing (#443)
https://github.com/user-attachments/assets/617336d2-5392-4eba-a1b4-f1234c8d2eec
2024-11-27 20:36:05 +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
Jason Lee
0119c80120
input: Update GPUI and fix Input changes. (#437)
Ref https://github.com/zed-industries/zed/pull/20968
2024-11-26 21:41:34 +08:00
dependabot[bot]
931d762955
build(deps): bump wry from 0.47.0 to 0.47.2 (#434) 2024-11-26 13:29:03 +08:00
Floyd Wang
ea6ec8aa5d
ui: Add number_input (#433)
https://github.com/user-attachments/assets/ae6f4e48-b0fa-4f8c-bff5-809c70848b06
2024-11-25 19:32:56 +08:00
Jason Lee
ea011d11d6
dock: Hide toggle button when side dock is not exist. (#431) 2024-11-22 15:38:47 +08:00