Commit graph

498 commits

Author SHA1 Message Date
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
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
Jason Lee
c2678268b2 chore: Update background assign to use into. 2024-11-21 15:02:46 +08:00
Floyd Wang
8b23193f8f
dock: Make the panel dock open state controllable (#429) 2024-11-20 11:24:42 +08:00
Jason Lee
e6012fcc8f
table: Improve table render performance. (#421)
Before: ~85 - 100FPS
After:  ~110 - 115FPS
2024-11-18 14:43:22 +08:00
Jason Lee
fa6abe5a9e
chore: Upgrade GPUI and fix API changes. (#426)
Refs:

- https://github.com/zed-industries/zed/pull/20349
- https://github.com/zed-industries/zed/pull/20371
- https://github.com/zed-industries/zed/pull/20686
2024-11-18 11:35:49 +08:00
dependabot[bot]
a4abc164bb
build(deps): bump wry from 0.46.3 to 0.47.0 (#408)
Bumps [wry](https://github.com/tauri-apps/wry) from 0.46.3 to 0.47.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.47.0</h2>
<!-- raw HTML omitted -->
<pre><code>Updating crates.io index
     Locking 418 packages to latest compatible versions
      Adding android-activity v0.5.2 (latest: v0.6.0)
      Adding ash v0.37.3+1.3.251 (latest: v0.38.0+1.3.281)
      Adding bit-set v0.5.3 (latest: v0.8.0)
      Adding bit-vec v0.6.3 (latest: v0.8.0)
      Adding bitflags v1.3.2 (latest: v2.6.0)
      Adding block2 v0.3.0 (latest: v0.5.1)
      Adding cairo-rs v0.18.5 (latest: v0.20.5)
      Adding cairo-sys-rs v0.18.2 (latest: v0.20.0)
      Adding calloop v0.12.4 (latest: v0.14.1)
      Adding calloop-wayland-source v0.2.0 (latest: v0.4.0)
      Adding cfg-expr v0.15.8 (latest: v0.17.0)
      Adding cfg_aliases v0.1.1 (latest: v0.2.1)
      Adding convert_case v0.4.0 (latest: v0.6.0)
      Adding core-foundation v0.9.4 (latest: v0.10.0)
      Adding core-graphics v0.23.2 (latest: v0.24.0)
      Adding core-graphics-types v0.1.3 (latest: v0.2.0)
      Adding cssparser v0.27.2 (latest: v0.34.0)
      Adding d3d12 v0.19.0 (latest: v22.0.0)
      Adding derive_more v0.99.18 (latest: v1.0.0)
      Adding gdk-pixbuf v0.18.5 (latest: v0.20.4)
      Adding gdk-pixbuf-sys v0.18.0 (latest: v0.20.4)
      Adding generic-array v0.14.7 (latest: v1.1.0)
      Adding gethostname v0.4.3 (latest: v0.5.0)
      Adding getrandom v0.1.16 (latest: v0.2.15)
      Adding gio v0.18.4 (latest: v0.20.5)
      Adding gio-sys v0.18.1 (latest: v0.20.5)
      Adding glib v0.18.5 (latest: v0.20.5)
      Adding glib-macros v0.18.5 (latest: v0.20.5)
      Adding glib-sys v0.18.1 (latest: v0.20.5)
      Adding glow v0.13.1 (latest: v0.15.0)
      Adding glutin_wgl_sys v0.5.0 (latest: v0.6.0)
      Adding gobject-sys v0.18.0 (latest: v0.20.4)
      Adding gpu-allocator v0.25.0 (latest: v0.27.0)
      Adding gpu-descriptor v0.2.4 (latest: v0.3.0)
      Adding gpu-descriptor-types v0.1.2 (latest: v0.2.0)
      Adding hashbrown v0.12.3 (latest: v0.15.1)
      Adding hashbrown v0.14.5 (latest: v0.15.1)
      Adding heck v0.4.1 (latest: v0.5.0)
      Adding html5ever v0.26.0 (latest: v0.29.0)
      Adding icrate v0.0.4 (latest: v0.1.2)
      Adding indexmap v1.9.3 (latest: v2.6.0)
      Adding itoa v0.4.8 (latest: v1.0.11)
      Adding jni-sys v0.3.0 (latest: v0.4.0)
&lt;/tr&gt;&lt;/table&gt; 
</code></pre>
</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.47.0]</h2>
<ul>
<li><a
href="72212568cb"><code>7221256</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1365">#1365</a> by
<a
href="https://github.com/tauri-apps/wry/../../Norbiros"><code>@​Norbiros</code></a>)
Add
<code>WebViewBuilder::with_initialization_script_for_main_only</code> to
enable injecting JavaScript code into main frame only or all
subframes.</li>
<li><a
href="c1b26b9612"><code>c1b26b9</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1394">#1394</a> by
<a
href="https://github.com/tauri-apps/wry/../../amrbashir"><code>@​amrbashir</code></a>)
Add <code>WebView::cookies</code> and
<code>WebView::cookies_for_url</code> APIs.</li>
<li><a
href="c193e2a04c"><code>c193e2a</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1408">#1408</a> by
<a
href="https://github.com/tauri-apps/wry/../../amrbashir"><code>@​amrbashir</code></a>)
Fix <code>DragDropEvent::Drop</code> event never fired on Wayland (and
sometimes on X11).</li>
<li><a
href="1d63fa3253"><code>1d63fa3</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1403">#1403</a> by
<a
href="https://github.com/tauri-apps/wry/../../SpikeHD"><code>@​SpikeHD</code></a>)
Add <code>WebViewBuilder::with_extension_path</code> API to Windows and
Linux.</li>
<li><a
href="0c192f4fda"><code>0c192f4</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1414">#1414</a> by
<a
href="https://github.com/tauri-apps/wry/../../lucasfernog"><code>@​lucasfernog</code></a>)
Fix Android static handlers not being replaced when the application UI
is relaunched while still running in the foreground.</li>
<li><a
href="9a2a2d42b6"><code>9a2a2d4</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1412">#1412</a> by
<a
href="https://github.com/tauri-apps/wry/../../amrbashir"><code>@​amrbashir</code></a>)
Fix icons of dragged items getting stuck when using
<code>WebViewBuilder::with_drag_drop_handler</code> on some distros like
Gnome.</li>
<li><a
href="fa9875bb16"><code>fa9875b</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1409">#1409</a> by
<a
href="https://github.com/tauri-apps/wry/../../amrbashir"><code>@​amrbashir</code></a>)
On Windows, disable Webview2's file drop when using
<code>WebViewBuilder::with_drag_drop_handler</code> which fix drag
events for files from &quot;Recent files&quot; view.</li>
<li><a
href="6007608277"><code>6007608</code></a>
(<a
href="https://redirect.github.com/tauri-apps/wry/pull/1400">#1400</a> by
<a
href="https://github.com/tauri-apps/wry/../../amrbashir"><code>@​amrbashir</code></a>)
On Windows, fix webview slightly larger than the window inner size,
which resulted in a hidden 1px in the right and bottom borders of the
webview</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="08f3c68f56"><code>08f3c68</code></a>
Apply Version Updates From Current Changes (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1399">#1399</a>)</li>
<li><a
href="c193e2a04c"><code>c193e2a</code></a>
fix(linux): fix <code>DragDropEvent::Drop</code> never fired on wayland
(<a
href="https://redirect.github.com/tauri-apps/wry/issues/1408">#1408</a>)</li>
<li><a
href="6007608277"><code>6007608</code></a>
fix(windows): handle window borders when resizing to parent (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1400">#1400</a>)</li>
<li><a
href="58cc0824c2"><code>58cc082</code></a>
fix(android): drop MainPipe on activity destroy (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1415">#1415</a>)</li>
<li><a
href="0c192f4fda"><code>0c192f4</code></a>
fix(android): allow static handlers to be replaced (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1414">#1414</a>)</li>
<li><a
href="9a2a2d42b6"><code>9a2a2d4</code></a>
fix: call <code>ctx.drop_finish</code> in webkit2gtk drop handler (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1412">#1412</a>)</li>
<li><a
href="7c4f2b7299"><code>7c4f2b7</code></a>
chore: typo <code>se</code> -&gt; <code>set</code> (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1413">#1413</a>)</li>
<li><a
href="b1d4d830d4"><code>b1d4d83</code></a>
ci: remove macos-12, no longer supported (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1410">#1410</a>)</li>
<li><a
href="fa9875bb16"><code>fa9875b</code></a>
fix(windows): set WebView2 <code>AllowExternalDrop</code> to false (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1409">#1409</a>)</li>
<li><a
href="72212568cb"><code>7221256</code></a>
feat: Allow injecting JavaScript code into subframes (<a
href="https://redirect.github.com/tauri-apps/wry/issues/1365">#1365</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tauri-apps/wry/compare/wry-v0.46.3...wry-v0.47">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.46.3&new-version=0.47.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>
2024-11-15 14:26:03 +08:00
Jason Lee
cdee8c7ffd
dock: Keep the panel state when meet invalid panel. (#423)
Close #422
2024-11-15 10:31:20 +08:00
Jason Lee
3db84c1247
Revert "dock: Change bottom dock to floating on bottom of the center view." (#420)
Reverts longbridgeapp/gpui-component#419
2024-11-14 19:01:57 +08:00
Jason Lee
a2d6752557
dock: Change bottom dock to floating on bottom of the center view. (#419) 2024-11-14 18:57:37 +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
b29f4fb0e6
dock: Add set_locked to lock dock area to limit split, move panels. (#417)
But still allow to resize panels.
2024-11-14 15:47:26 +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
ihavecoke
d53b30ff9f
drawer: Set paddings to base to support override drawer body paddings. (#413)
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2024-11-13 14:38:47 +08:00
ihavecoke
40345f1e42
webview: Add bounds method to WebView to get container bounds. (#411)
<img width="1463" alt="image"
src="https://github.com/user-attachments/assets/f70c2d6b-cb26-4cf5-bd2e-9760ff54c524">
2024-11-12 19:31:48 +08:00
Floyd Wang
e77578a53f svg_img: Fix the conversion error of the SVG fill color with alpha (#410)
### Before
<img width="156" alt="image"
src="https://github.com/user-attachments/assets/c7177ac7-58aa-4865-81c9-4f7ddff9f145">

### After
<img width="176" alt="image"
src="https://github.com/user-attachments/assets/a010e78d-752e-4298-bf40-7a42b916e547">
2024-11-12 19:26:24 +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
ihavecoke
f96c21782d
skeleton: Fix the bug where the theme color of the skeleton does not display in light mode (#407) 2024-11-11 11:48:03 +08:00
Jason Lee
5149b8a714
panel: Add toolbar_buttons to extend button to panel. (#406)
<img width="635" alt="image"
src="https://github.com/user-attachments/assets/42dc1cb4-a1dd-43c6-8fc3-9d404e86cb85">
2024-11-10 23:17:34 +08:00
Floyd Wang
ab772c04f1
svg_img: Remove the svg_img method (#404)
Use `SvgImg::new()`.
2024-11-08 16:42:33 +08:00
Floyd Wang
df54c7b2fb
svg_img: Embed the font file (#401)
<img width="644" alt="image"
src="https://github.com/user-attachments/assets/7acaff6c-0913-402a-8759-2660d2977ce5">
2024-11-08 15:45:00 +08:00