Commit graph

681 commits

Author SHA1 Message Date
Jason Lee
1aa43b1bfe
tab: Add Pill, Segmented, Underline style Tab and complete the Tab API. (#676)
<img width="985" alt="image"
src="https://github.com/user-attachments/assets/3d3860ff-ac7c-459a-bb6e-d0ea09b8eac8"
/>

<img width="936" alt="image"
src="https://github.com/user-attachments/assets/abb39b8f-4139-4f41-9c12-2a22f767bec0"
/>

<img width="985" alt="image"
src="https://github.com/user-attachments/assets/9fccce5f-8da5-4c78-8679-1a85dcfc56f0"
/>


Run example:

```
cargo run --example tabs
```
2025-03-03 17:09:52 +08:00
Jason Lee
76efa2715b
tiles: Fix panels get item out of bound error when removed some panel. (#675) 2025-02-28 18:53:25 +08:00
Jason Lee
9732c3b7e8
tiles: To support close panel. (#674)
- Add `remove_panel` method to DockArea.
2025-02-28 18:36:58 +08:00
Jason Lee
5cf11ffe1b
tiles: Remove cursor style on Tile's title. (#673) 2025-02-28 16:57:01 +08:00
Jason Lee
7eaac7b171
chore: Update TabPanel closable doc. (#672) 2025-02-28 15:40:33 +08:00
Jason Lee
42c82bfc31
story: Rename closeable to closable. (#671) 2025-02-28 14:33:30 +08:00
Jason Lee
7582ad3fb3
text_view: Add heading_base_font_size to TextViewStyle and fix text wrap for list item. (#670)
- Fix list item to wrap text.

<img width="797" alt="image"
src="https://github.com/user-attachments/assets/9e8156ad-bf58-4d7a-a850-69dfcb56c850"
/>
2025-02-28 11:43:08 +08:00
Jason Lee
e443a219be
panel: Add title_suffix to panel and write a custom container panel example. (#669)
- Add to support `xsmall` size for TextInput.
- Add `global`, `global_mut`, `build_panel` static method to
`PanelRegistry`.

<img width="1011" alt="image"
src="https://github.com/user-attachments/assets/1a6e61c4-502a-4d1c-a4ea-2644777fd4d8"
/>
2025-02-27 14:52:28 +08:00
Floyd Wang
e61f6204cc
calendar: Differentiate text color of disabled and non-current month (#668)
| Before | After |
| - | - |
| <img width="341" alt="image"
src="https://github.com/user-attachments/assets/452d57b1-5ec6-4ad3-bc30-ed8a966d12e5"
/> | <img width="350" alt="image"
src="https://github.com/user-attachments/assets/9f664cea-aa55-479a-8d5b-61570101a66f"
/> |
2025-02-27 11:14:28 +08:00
Jason Lee
3ba63915ce
text_view: Fix some case may lose spaces, <br> in HTML and Markdown render. (#667) 2025-02-26 17:52:18 +08:00
Jason Lee
ffa848fb26
text_view: Fix markdown table alignment. (#666) 2025-02-26 15:49:13 +08:00
Jason Lee
6a125b391e
chore: Update example images in Markdown and HTML examples. (#664) 2025-02-26 15:26:22 +08:00
Jason Lee
98625edf01
tiles: Fix active_panel method to returns actually Panel view, avoid return TabPanel. (#665)
- Limit `add_item` only allows TabPanel type.
- Export `items` method in DockArea.
2025-02-26 11:33:58 +08:00
Jason Lee
00e5385878
input: Add h, h_full to Input for multi-line mode. (#642)
Close #641
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/9cbe090c-a5d7-4929-98db-5f71349fe559"
/>
2025-02-25 16:17:39 +08:00
Jason Lee
c74791aac8
description_list: Add DescriptionList. (#658)
<img width="1089" alt="image"
src="https://github.com/user-attachments/assets/15069422-14aa-4fa3-b661-65fcf7417323"
/>
<img width="1089" alt="image"
src="https://github.com/user-attachments/assets/df4a4b90-b304-40d3-a9ce-1be73eaaa9f4"
/>
<img width="1089" alt="image"
src="https://github.com/user-attachments/assets/1deaf1e8-4b30-4afd-90af-1bd0eecf53e2"
/>
2025-02-25 15:32:59 +08:00
Floyd Wang
e5371c3209
ci: Temporarily skip machete (#663)
https://github.com/actions/runner-images/pull/11661

`cargo-machete` needs edition 2024, reopen after this PR is merged.
2025-02-25 15:13:54 +08:00
Floyd Wang
dc4d7e614c dock: Panel trait set_zoomed with mutable window and cx (#661)
Need Update panel functions to mutable `self`, `window` and `cx`.
2025-02-25 14:34:49 +08:00
Jason Lee
9f429592ce
text_view: Remove last paragraph bottom margin. (#660)
Now, we can be easy to use TextView for 1 line text.

## Break Changes

- Removed `inline` method by previous #649 added, this is not needed.
2025-02-25 14:27:59 +08:00
Floyd Wang
f75f96f135
dock: Panel trait set_active with mutable window and cx (#659) 2025-02-25 14:15:42 +08:00
Jason Lee
8edd80d5ee
modal: Do not occlude when overlay is not enable. (#657) 2025-02-25 12:25:46 +08:00
Jason Lee
806c6dffe8
tiles: Add active_panel method to Tiles. (#656) 2025-02-25 12:00:43 +08:00
Ylin
6d7f20cd4f
webview: Update visible state when hide or show (#654) 2025-02-25 11:49:29 +08:00
Floyd Wang
9739493bce
dock: Add mutable reference for set_active (#655) 2025-02-25 11:46:54 +08:00
Jason Lee
3b4065ce4e
text_view: Stop propagation on click link in TextView. (#650)
To avoid trigger parent element, for example as a Label for checkbox.
2025-02-24 18:07:53 +08:00
Jason Lee
6bcc34c7f0
checkbox, switch: Improve Checkbox, Switch to use wrap text and TextView. (#651)
This change to revert #233 to let label to wrap.


<img width="1279" alt="image"
src="https://github.com/user-attachments/assets/8081216f-0ea0-4ba2-9095-6fd84102e03b"
/>
2025-02-24 18:04:06 +08:00
Jason Lee
8fa210bc21
text_view: Update Switch, Checkbox, Radio to let label method support TextView. (#649)
- Add `style` method to TextView.
- Add `inline` method to TextView to use default inline style.
2025-02-24 15:49:54 +08:00
Jason Lee
9dade704fb
webview: Let webview as a feature and not default enable. (#648)
Close #646
2025-02-24 14:24:22 +08:00
Jason Lee
d54dcdf417
text_view: Refactor TextView to RenderOnce to easy usage. (#647) 2025-02-24 14:13:50 +08:00
ihavecoke
c303b84303
dock: Add item to tiles layout should use default TabPanel view (#645) 2025-02-23 22:22:27 +08:00
ihavecoke
03d5f83a83
dock: Implement core panel addition logic for tiling layout (#644) 2025-02-20 21:20:59 +08:00
Jason Lee
06f9178ec4
text: Add TextView with Markdown and Simple HTML support. (#639) 2025-02-20 20:08:59 +08:00
ihavecoke
6c39078e8a
dock: Add drag drop event for tiles (#640) 2025-02-19 22:20:48 +08:00
Jason Lee
75212c3aba
chore: Fix focusd_border typo in #635 (#637) 2025-02-17 17:29:40 +08:00
Jason Lee
fa1a7a85ba
Update year of LICENSE-APACHE 2025-02-17 14:48:49 +08:00
Jason Lee
c62be93da6
panel: Reduce tool buttons gap from 8px to 4px. (#636)
<img width="314" alt="image"
src="https://github.com/user-attachments/assets/eab5f4f8-b604-4c5c-bfd4-2535340b1d1e"
/>

And use `selected` style for zoom button when zoomed:

<img width="114" alt="image"
src="https://github.com/user-attachments/assets/fa11ec81-a4db-42ea-8edc-39ed8ad40ba1"
/>
2025-02-17 14:46:44 +08:00
Jason Lee
4c554580c9
chore: Rename outline styled method to focused_border. (#635)
This change to avoid conflict with `outline` method in Button.

## Break changes:

- The `outline` method in `StyledExt` now renamed to `focused_border`.
2025-02-17 14:34:54 +08:00
Jason Lee
d96b4b44d2
number_input: Fix button margin. (#634) 2025-02-17 14:29:33 +08:00
Jason Lee
231772ee4e
modal: Remove opacity animation for improve Modal appear. (#633) 2025-02-17 13:32:17 +08:00
Jason Lee
2c377985bb
tiles: Limit panel x to out of bounds, but keep retaining 64px. (#632)
- Adjust `tile_grid_size` default to `8px`.
- Fix unexpected scroll size by `-1px` design.
2025-02-17 11:51:10 +08:00
Jason Lee
d446c0e7b3
tile: Add to support setup tiles background color, tile_shadow, tile_grid_size. (#631) 2025-02-17 10:49:26 +08:00
Jason Lee
e4c31f1ce4
tiles: Limit tile panel move to avoid out of the container. (#630) 2025-02-17 10:24:06 +08:00
Jason Lee
b18dd47ce0
panel: Only highlight resize handle when dragging. (#629) 2025-02-14 18:42:56 +08:00
Jason Lee
851099f890
sidebar: Refactor Sidebar API to avoid map call will segmentation fault on release. (#628)
Close #471

```
    Finished `release` profile [optimized] target(s) in 9.99s
     Running `target/release/examples/sidebar`
[1]    30606 segmentation fault  cargo run --example sidebar --release
```

This may cause by used `map` break by maybe Rust compiler bug, I
detected that if I remove a `map`, then the crash will gone.

So, this changes to refactor the Sidebar API to avoid use `map`.
2025-02-14 17:18:39 +08:00
Jason Lee
0ebedbe79f
chrome: Refactor state fields to remove is_ prefix. (#627) 2025-02-14 15:20:18 +08:00
Jason Lee
bf300a2880
sidebar: Fix sidebar example and add right side example. (#626) 2025-02-14 15:06:37 +08:00
Jason Lee
cca6277ea5
example: Add modal example. (#625)
```
cargo run --example modal
```
2025-02-14 14:44:26 +08:00
Jason Lee
6e2bb3fb58
scrollbar: Update scrollbar hitbox to it bounds, not fill the full of parent view. (#624)
And revert some #621 wrong changes for hover to show scrollbar.
2025-02-14 13:54:02 +08:00
Floyd Wang
c7257d36cf
calendar: Add Matcher for disabled dates (#623)
| Day Of Week | Interval | Range |
|--------------|---------|-------|
| <img width="420" alt="image"
src="https://github.com/user-attachments/assets/e23f69b8-3191-4370-8adf-266362680e5c"
/> | <img width="264" alt="image"
src="https://github.com/user-attachments/assets/c211d7c3-9878-402e-a6cc-e3ac1b50e588"
/> | <img width="337" alt="image"
src="https://github.com/user-attachments/assets/2b894ef1-14d0-4fc3-89e5-4e38b5e8572c"
/> |
2025-02-13 17:43:19 +08:00
Jason Lee
83375147fe
panel: Improve resize handle to show highlight color on dragging. (#622)
https://github.com/user-attachments/assets/aabbd73b-3c11-43e2-a4f2-121d46fba1d7
2025-02-13 16:07:00 +08:00
Jason Lee
437f1b2098
theme: Add to support always show scrollbar mode and default to match with system style. (#621)
Close #573

- Fix theme settings to keeping when switch theme mode.
2025-02-12 15:15:33 +08:00