gpui-component/crates/ui/src/lib.rs
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

104 lines
1.9 KiB
Rust

mod colors;
mod event;
mod focusable;
mod icon;
mod root;
mod styled;
mod svg_img;
mod table_row;
mod time;
mod title_bar;
pub mod accordion;
pub mod animation;
pub mod badge;
pub mod breadcrumb;
pub mod button;
pub mod button_group;
pub mod checkbox;
pub mod clipboard;
pub mod color_picker;
pub mod context_menu;
pub mod divider;
pub mod dock;
pub mod drawer;
pub mod dropdown;
pub mod history;
pub mod indicator;
pub mod input;
pub mod label;
pub mod link;
pub mod list;
pub mod modal;
pub mod notification;
pub mod number_input;
pub mod popover;
pub mod popup_menu;
pub mod prelude;
pub mod progress;
pub mod radio;
pub mod resizable;
pub mod scroll;
pub mod sidebar;
pub mod skeleton;
pub mod slider;
pub mod switch;
pub mod tab;
pub mod table;
pub mod theme;
pub mod tooltip;
pub mod webview;
// re-export
pub use wry;
pub use crate::Disableable;
pub use event::InteractiveElementExt;
pub use focusable::FocusableCycle;
pub use root::{ContextModal, Root};
pub use styled::*;
pub use time::*;
pub use title_bar::*;
pub use colors::*;
pub use icon::*;
pub use svg_img::*;
use std::ops::Deref;
use rust_embed::RustEmbed;
rust_i18n::i18n!("locales", fallback = "en");
#[derive(RustEmbed)]
#[folder = "./assets"]
#[include = "fonts/**/*"]
#[exclude = "*.DS_Store"]
pub struct Assets;
/// Initialize the UI module.
///
/// This must be called before using any of the UI components.
/// You can initialize the UI module at your application's entry point.
pub fn init(cx: &mut gpui::AppContext) {
theme::init(cx);
date_picker::init(cx);
dock::init(cx);
drawer::init(cx);
dropdown::init(cx);
input::init(cx);
number_input::init(cx);
list::init(cx);
modal::init(cx);
popover::init(cx);
popup_menu::init(cx);
table::init(cx);
}
pub fn locale() -> impl Deref<Target = str> {
rust_i18n::locale()
}
pub fn set_locale(locale: &str) {
rust_i18n::set_locale(locale)
}