Jason Lee
21dbaffcf4
input: Add Cursor and Selection type and export line number, cursor. ( #1012 )
2025-06-27 20:48:26 +08:00
Jason Lee
5b17281374
text_view: Fix li > strong render not in same line. ( #1016 )
...
## Before
<img width="1294" alt="image"
src="https://github.com/user-attachments/assets/0620f33a-914e-4d2a-8832-16c037351352 "
/>
## After
<img width="1131" alt="image"
src="https://github.com/user-attachments/assets/a31b9b5a-6d41-4c04-a415-ff97e7cd1f31 "
/>
2025-06-27 18:41:28 +08:00
Jason Lee
67f0ffbc9c
chore: Upgrade GPUI and fix action API changes. ( #1008 )
...
Ref https://github.com/zed-industries/zed/pull/33263
2025-06-25 11:06:12 +08:00
Michael Angerman
eb9a0ed881
chore: Fix button example so that it scrolls in the y direction ( #999 )
...
The button example was not scrolling in the y direction and therefore
you were *NOT* able to see the entire ButtonStory.
This minor fix now enables one to see the entire ButtonStory.
The only code that needed to be added was
```rust
.id("button_example")
.overflow_y_scroll()
```
2025-06-24 11:54:51 +08:00
Jason Lee
89c210c4ca
highlighter: Avoid crash when language not registered. ( #954 )
...
Close #952
Fallback to use plain text to display.
2025-06-12 19:45:29 +08:00
Jason Lee
d61b0d2510
highlighter: Fix highlight offset and reset highlight when replace all text. ( #950 )
...
- Improve JSON highlights.
<img width="839" alt="image"
src="https://github.com/user-attachments/assets/3f28ae1c-9f07-4df4-a477-f875a26d4c7d "
/>
2025-06-12 14:11:01 +08:00
Jason Lee
6ea427549a
input: Add focus_bordered method to toggle Input focus border. ( #946 )
2025-06-11 21:34:37 +08:00
Jason Lee
79ff6ba9cc
highlighter: Fix injection language highlight. ( #931 )
...
Still have a bit bug for highlight:
<img width="1012" alt="image"
src="https://github.com/user-attachments/assets/7ec39c85-c20c-4231-8752-b2a7a80f5570 "
/>
2025-06-11 15:26:27 +08:00
Jason Lee
6aab9d3345
code-editor: Show hover popover for diagnostics. ( #924 )
...
<img width="719" alt="image"
src="https://github.com/user-attachments/assets/75fa9737-09e1-4baa-b7ac-304e847005c8 "
/>
2025-06-09 16:16:15 +08:00
Jason Lee
c3ec1deb97
code-editor: Update CodeEditor to support external language. ( #928 )
...
Add [Navi](https://navi-lang.org ) language for example to external
language for CodeEditor.
<img width="864" alt="image"
src="https://github.com/user-attachments/assets/73afa56d-31bd-4867-a9f2-0a8cf790af0f "
/>
2025-06-09 14:27:33 +08:00
Jason Lee
a8f5ced4e6
code-editor: Add markers for display diagnostics to CodeEditor. ( #920 )
...
Ref:
https://microsoft.github.io/monaco-editor/typedoc/functions/editor.setModelMarkers.html


2025-06-05 23:04:01 +08:00
Duane Bester
4477cca969
highlighter: Adding tree-sitter-sequel for SQL support. ( #917 )
...
📦 Adding dependency:
[tree-sitter-sequel](https://github.com/derekstride/tree-sitter-sql )
### Previews
<img width="1398" alt="Screenshot 2025-06-04 at 9 27 08 PM"
src="https://github.com/user-attachments/assets/4aee67be-6fb3-4c57-95be-20792639851a "
/>
<img width="1398" alt="Screenshot 2025-06-04 at 9 34 02 PM"
src="https://github.com/user-attachments/assets/730e148f-2bc9-481d-8eea-8110f7884e69 "
/>
2025-06-05 11:54:52 +08:00
Jason Lee
2b796c94e9
highlighter: Improve performance for large file. ( #911 )
...
Still need to improve.
This version can work smooth when the file lines are less than 5000
lines.
> cargo run --release on MacBook Pro, Apple M3 CPU
- Editing at 110 FPS+
- Display at 120 FPS.
<img width="977" alt="image"
src="https://github.com/user-attachments/assets/37958bcb-20d8-486b-8c50-2728d16f971b "
/>
2025-06-03 23:20:33 +08:00
Jason Lee
a4aff404ce
highlighter: Use tree-sitter to highlight code. ( #904 )
...
<img width="1318" alt="image"
src="https://github.com/user-attachments/assets/4a8e7b93-a7e7-4648-b8da-c5a6e7ede4f9 "
/>
<img width="1318" alt="image"
src="https://github.com/user-attachments/assets/bfc35845-719f-4c97-bf50-087feb0f6775 "
/>
2025-05-29 19:54:52 +08:00
Jason Lee
1cbbf6ef18
code-editor: Improve CodeEditor to has default themes. ( #900 )
2025-05-26 18:17:15 +08:00
Jason Lee
1c11b5fb55
inspector: Add Inspector. ( #897 )
...
<img width="1434" alt="image"
src="https://github.com/user-attachments/assets/f6ec2e1d-ff1c-4798-90fe-d29bef20fa9d "
/>
2025-05-26 16:44:11 +08:00
Jason Lee
c99e696cb1
code-editor: Update code highlight theme colors. ( #888 )
2025-05-25 10:21:37 +08:00
Jason Lee
e68419bc95
example: Add resizable feature to HTML, Markdown example. ( #872 )
2025-05-20 18:25:14 +08:00
Jason Lee
5658db42c7
input: Add CodeEditor mode. ( #863 )
...
## TODO
- [x] Cache highlight result.
- [x] Add a `code-editor` example with more languages test.
- [x] Support setup font to Input (Base on window scope text style).
- [x] Line number
- [x] Change font size and font family.
- [x] Enter newline to keep indent.
- [x] Height with flex_1
- [x] Add to support press `up`, `down` to move cursor to start or end
of the selection, if there is selected.
- [x] Add `Tab`, `Shift-Tab` to indent or outdent for cursor and
selection.
- [x] Double click to select at least 1 char.
https://github.com/user-attachments/assets/af74862d-15a9-4802-b4b4-2aeb606227ec
2025-05-20 15:51:00 +08:00
Jason Lee
1e2cc8315a
dock: Show keybinding for ToggleZoom menu and button. ( #861 )
...
And binding `Shift-Esc` for example to toggle zoom panel, `Ctrl-W` for
close panel.

2025-05-17 22:23:45 +08:00
Jason Lee
bc398adbf3
input: Refactor Input, Picker as stateless mode. ( #858 )
2025-05-16 23:41:26 +08:00
Jason Lee
d288a51e06
dock: Revert panel radio size to back to use Pixels type for panel size. ( #842 )
...
This PR to revert previous dock changes to back to use `Pixels` type for
panel size.
- #833
- #839
- #840
2025-05-09 16:47:24 +08:00
Jason Lee
f8e30c6f5d
dock: Revert dock to use absolute size. ( #840 )
...
This change to revert `Dock` to use `Pixels` for size, not use ratio,
because in most case we need to keep dock size, not wants it change when
window resize, we just only want center dock to change.
The `Panel` will keep the relative size changes.
2025-05-08 16:29:55 +08:00
Jason Lee
a26311dc0e
dock: Improve dock, panel to support absolute or fraction size. ( #839 )
2025-05-08 12:01:16 +08:00
Jason Lee
6514aec22a
dock: Refactor to use ratio for dock, panel size. ( #833 )
2025-05-07 01:32:31 +08:00
Jens Krause
f7be6a245a
input: Add Esc to clean. ( #803 )
2025-04-20 10:24:47 +08:00
Jason Lee
5b508d7219
gallery: Redesign the gallery. ( #797 )
...
Close #773
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/e27a28ca-cdd7-4970-8518-4fd0104bb3f8 "
/>
2025-04-17 17:12:48 +08:00
Jason Lee
d0a73011de
tooltip: Add KeyBinding to tooltip and Button. ( #783 )
...
- Improve `Kbd::format` method.
- Add `tooltip_with_action` method to Button for display key binding in
tooltip.
-
## Break change
- The `Tooltip::new` has been changed it argument and return type.
```diff
- pub fn new(text: impl Into<Text>, _: &mut Window, cx: &mut App) ->
AnyView
+ pub fn new(text: impl Into<Text>) -> Self
```
2025-04-14 16:40:40 +08:00
Jason Lee
aadcf4e1df
accordion: Fix toggle accordion item. ( #749 )
...
Close #740

2025-03-27 14:22:00 +08:00
Jason Lee
17926cea16
button: Add warning, success, info variant to Button. ( #745 )
...
<img width="1342" alt="SCR-20250327-jfzq"
src="https://github.com/user-attachments/assets/7c44458a-9467-4095-9cd6-1dcb35cc351b "
/>
<img width="1342" alt="SCR-20250327-jgak"
src="https://github.com/user-attachments/assets/07d33d60-f581-46d4-9a54-174e56ab82ca "
/>
2025-03-27 10:15:53 +08:00
Jason Lee
22d9394266
alert: Add Alert. ( #735 )
...


<img width="821" alt="image"
src="https://github.com/user-attachments/assets/6350f48b-6ced-4063-b115-06422d49b92c "
/>
<img width="821" alt="image"
src="https://github.com/user-attachments/assets/3d71688a-b0ca-4223-a097-858388a47f6d "
/>
<img width="821" alt="image"
src="https://github.com/user-attachments/assets/ec3af860-0f8f-420b-9da7-f390c4742492 "
/>
<img width="821" alt="image"
src="https://github.com/user-attachments/assets/d9a85c06-209a-4ef9-ac9a-8456491fedc6 "
/>
2025-03-25 14:10:24 +08:00
Floyd Wang
760c0597eb
description_list: Fix incorrect align items for horizontal layout ( #730 )
...
| Before | After |
| - | - |
| <img width="539" alt="image"
src="https://github.com/user-attachments/assets/ecd997b5-1f59-4c41-83a3-dfdee6b1be8a "
/> | <img width="556" alt="image"
src="https://github.com/user-attachments/assets/1088d466-1635-45c3-b578-9ada1c960d66 "
/> |
2025-03-24 17:15:46 +08:00
Jason Lee
a89f971108
chore: Update GPUI 2025/03/20 and fix spawn method. ( #725 )
...
- Update `resvg`, `usvg` to 0.45.0
2025-03-20 21:23:50 +08:00
Jason Lee
6a00cfcc4a
text_view: Fix HTML render to support blockquote. ( #703 )
...
<img width="850" alt="image"
src="https://github.com/user-attachments/assets/4d8f662f-aebe-4c40-bc56-828627f16064 "
/>
2025-03-10 22:53:53 +08:00
Jason Lee
3e4a3ed046
tag: Add color to Tag to support more colors. ( #698 )
...
- Add `ColorName` enum.
<img width="588" alt="image"
src="https://github.com/user-attachments/assets/20670946-1a4f-45ff-b5ac-81e7eb760242 "
/>
<img width="586" alt="image"
src="https://github.com/user-attachments/assets/7ce4a87f-fa6b-4794-83c5-3f18e6d09dcb "
/>
2025-03-07 21:41:04 +08:00
Jason Lee
4c9c7980ee
chore: Upgrade GPUI 2025/03/07 ( #697 )
2025-03-07 20:22:58 +08:00
Jason Lee
c5416c4774
menu: Fix sub-menu render position. ( #694 )
...
<img width="385" alt="image"
src="https://github.com/user-attachments/assets/2e8527af-08af-4176-b4cf-931f79b6d45c "
/>
2025-03-07 11:47:27 +08:00
Jason Lee
c9c6449d24
toggle: Add Toggle and ToggleGroup. ( #691 )
...
- Improve `Icon` to inherit parent element font size by default.
<img width="777" alt="image"
src="https://github.com/user-attachments/assets/1a0ee94e-46ef-4b02-9538-09880586d3f2 "
/>
<img width="777" alt="image"
src="https://github.com/user-attachments/assets/4ecb016f-2e7c-4266-9a25-eae2566b2844 "
/>
2025-03-06 19:10:28 +08:00
Jason Lee
c3f08d52b9
text_view: Add syntax highlight to CodeBlock. ( #684 )
...
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/e7539df4-20db-431b-9bbc-52e08e9de062 "
/>
<img width="1712" alt="image"
src="https://github.com/user-attachments/assets/85d52319-1029-4306-8629-ec0321d0571b "
/>
2025-03-04 21:50:50 +08:00
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
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
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
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
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