## Problem When scrolling quickly, a distracting background color was appearing in the scrollbar area, as shown below: <img src="https://github.com/user-attachments/assets/c9ebe200-a6b2-47ca-992d-ceaa5ed3db04"> ## Root Cause Several theme files had scrollbar background colors configured with partial transparency (alpha values like `33`, `44`, `80`, etc.) instead of full transparency (`00`). This caused a semi-transparent background to become visible during fast scrolling, creating an unwanted visual artifact. ## Solution Updated all `scrollbar.background` color values to use full transparency by setting the alpha channel to `00`. This ensures the scrollbar background is completely invisible across all themes, with only the scrollbar thumb (the draggable indicator) remaining visible. ## Changes Modified 7 theme files with non-transparent scrollbar backgrounds: - **alduin.json**: `#28282833` → `#28282800` - **hybrid.json**: `#E0E0E044` → `#E0E0E000`, `#1D1F2144` → `#1D1F2100` - **jellybeans.json**: `#26262633` → `#26262600` - **mellifluous.json**: `#fafafa33` → `#fafafa00` - **molokai.json**: `#FEFAF933` → `#FEFAF900` - **solarized.json**: `#EEE8D533` → `#EEE8D500`, `#002b3633` → `#002b3600` - **default-theme.json**: `#fafafa80` → `#fafafa00`, `#17171780` → `#17171700` All other themes already had transparent scrollbar backgrounds and remain unchanged. ## Impact - Eliminates the visual glitch where a background color appears during fast scrolling - Provides a consistent, clean scrollbar appearance across all 20 themes plus the default theme - No functional changes to scrollbar behavior - only visual appearance - Total of 37 scrollbar.background entries now fully transparent Fixes the issue reported by @huacnlee in the comments. <issue_title>A different background color appears when the scroll bar scrolls quickly</issue_title> ><issue_description>A different background color appears when the scroll bar scrolls quickly > ><img src="https://github.com/user-attachments/assets/c9ebe200-a6b2-47ca-992d-ceaa5ed3db04"></issue_description> > ><agent_instructions>Make change to update scrollbar background color to transparent for all themes.</agent_instructions> > > ## Comments on the Issue (you are @copilot in this section) > ><comments> ><comment_new><author>@huacnlee</author> > That is the scrollbar background color. I am still on to consider removing that color.</comment_new> ></comments> > Fixes longbridge/gpui-component#1402 <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>A different background color appears when the scroll bar scrolls quickly</issue_title> > <issue_description>A different background color appears when the scroll bar scrolls quickly > > <img width="1338" height="387" alt="Image" src="https://github.com/user-attachments/assets/c9ebe200-a6b2-47ca-992d-ceaa5ed3db04" /></issue_description> > > <agent_instructions>Make change to update scrollbar background color to transparent for all themes.</agent_instructions> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > <comment_new><author>@huacnlee</author><body> > That is the scrollbar background color. I am still on to consider removing that color.</body></comment_new> > </comments> > </details> Fixes longbridge/gpui-component#1402 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: huacnlee <5518+huacnlee@users.noreply.github.com> |
||
|---|---|---|
| .cargo | ||
| .github | ||
| assets | ||
| crates | ||
| docs | ||
| examples | ||
| script | ||
| themes | ||
| .gitignore | ||
| .theme-schema.json | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE-APACHE | ||
| README.md | ||
GPUI Component
UI components for building fantastic desktop applications using GPUI.
Features
- Richness: 40+ cross-platform desktop UI components.
- Native: Inspired by macOS and Windows controls, combined with shadcn/ui design for a modern experience.
- Ease of Use: Stateless
RenderOncecomponents, simple and user-friendly. - Customizable: Built-in
ThemeandThemeColor, supporting multi-theme and variable-based configurations. - Versatile: Supports sizes like
xs,sm,md, andlg. - Flexible Layout: Dock layout for panel arrangements, resizing, and freeform (Tiles) layouts.
- High Performance: Virtualized Table and List components for smooth large-data rendering.
- Content Rendering: Native support for Markdown and simple HTML.
- Charting: Built-in charts for visualization your data.
- Editor: High performance code editor (support up to 200K lines) with LSP (diagnostics, completion, hover, etc).
- Syntax Highlighting: Syntax highlighting for editor and markdown components using Tree Sitter.
Showcase
Here is the first application: Longbridge Pro, built using GPUI Component.
We built multi-theme support in the application. This feature is not included in GPUI Component itself, but is based on the Theme feature, so it's easy to implement.
Usage
GPUI and GPUI Component are still in development, so you need to add dependencies by git.
gpui = "0.2.0"
gpui-component = "0.2.0"
Basic Example
use gpui::*;
use gpui_component::{button::*, *};
pub struct HelloWorld;
impl Render for HelloWorld {
fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
div()
.v_flex()
.gap_2()
.size_full()
.items_center()
.justify_center()
.child("Hello, World!")
.child(
Button::new("ok")
.primary()
.label("Let's Go!")
.on_click(|_, _, _| println!("Clicked!")),
)
}
}
fn main() {
let app = Application::new();
app.run(move |cx| {
// This must be called before using any GPUI Component features.
gpui_component::init(cx);
cx.spawn(async move |cx| {
cx.open_window(WindowOptions::default(), |window, cx| {
let view = cx.new(|_| HelloWorld);
// This first level on the window, should be a Root.
cx.new(|cx| Root::new(view.into(), window, cx))
})?;
Ok::<_, anyhow::Error>(())
})
.detach();
});
}
WebView
Still early and experimental; there are a lot of limitations.
GPUI Component has a WebView element based on Wry. This is an optional feature, which you can enable with a feature flag.
gpui-component = { version = "0.2.0", features = ["webview"] }
wry = { version = "0.53.3, package = "lb-wry" }
More usage examples can be found in the story directory.
Icons
GPUI Component has an Icon element, but it does not include SVG files by default.
The example uses Lucide icons, but you can use any icons you like. Just name the SVG files as defined in IconName. You can add any icons you need to your project.
Development
We have a gallery of applications built with GPUI Component.
cargo run
More examples can be found in the examples directory. You can run them with cargo run --example <example_name>.
Check out CONTRIBUTING.md for more details.
Compare to others
| Features | GPUI Component | Iced | egui | QT 6 |
|---|---|---|---|---|
| Language | Rust | Rust | Rust | C++/QML |
| Core Render | GPUI | wgpu | wgpu | QT |
| License | Apache 2.0 | MIT | MIT/Apache 2.0 | Commercial |
| Min Binary Size 1 | 12MB | 11MB | 5M | 20MB 2 |
| Cross-Platform | Yes | Yes | Yes | Yes |
| Documentation | No | Simple | Simple | Good |
| Web | No | Yes | Yes | Yes |
| UI Style | Modern | Basic | Basic | Basic |
| CJK Support | Yes | Yes | Bad | Yes |
| Chart | Yes | No | No | Yes |
| Table (Large dataset) | Yes (Virtual Rows, Columns) |
No | Yes (Virtual Rows) |
Yes (Virtual Rows, Columns) |
| Table Column Resize | Yes | No | Yes | Yes |
| Text base | Rope | COSMIC Text 3 | trait TextBuffer 4 | QTextDocument |
| CodeEditor | Simple | Simple | Simple | Basic API |
| Dock Layout | Yes | Yes | Yes | Yes |
| Syntax Highlight | Tree Sitter | Syntect | Syntect | QSyntaxHighlighter |
| Markdown Rendering | Yes | Yes | Basic | No |
| Markdown mix HTML | Yes | No | No | No |
| HTML Rendering | Basic | No | No | Basic |
| Text Selection | TextView | No | Any Label | No |
| Themes | Yes | No | No | No |
| I18n | Yes | Yes | Yes | Yes |
Please submit an issue or PR if any mistakes or outdated are found.
License
Apache-2.0
-
Release builds by use simple hello world example. ↩︎
-
Iced Editor:
db5a1f6353/graphics/src/text/editor.rs (L65-L68)↩︎ -
egui TextBuffer:
0a81372cfd/crates/egui/src/widgets/text_edit/text_buffer.rs (L20)↩︎