T16 Finance: market charts with kinds, volume, profile, studies, drawings, compare, alerts and sync (T16a–b); quotes, book, tape and DOM (T16c); order entry, blotter, risk, options and payoff (T16d); markets, calendars, portfolio and wallet (T16e); typography::Ellipsis ends lines that gpui's truncate clipped; chart notes stack and ticks label round values

This commit is contained in:
ZacharyZhang-NY committed 2026-09-25 23:30:04 -04:00
1 parent efde9d64b0
commit 8d43b7a880
76 files changed
+10311 -173

No files matched your search

+3 -7
View File
@@ -6,7 +6,7 @@ use crate::{
data_display::{Avatar, Badge, Sparkline, Tone},
motion::ProgressBar,
theme::{ActiveTheme, AvatarSize},
typography::{ExternalLink, format, tabular},
typography::{Ellipsis, ExternalLink, format, tabular},
};
/// What a cell holds; its column says how numbers read.
@@ -211,11 +211,7 @@ pub(crate) fn draw(cell: &Cell, column: &Column, id: ElementId, cx: &App) -> Any
let colors = &cx.theme().colors;
match cell {
Cell::Empty => div().into_any_element(),
Cell::Text(text) => div()
.min_w_0()
.truncate()
.child(text.clone())
.into_any_element(),
Cell::Text(text) => Ellipsis::new(text.clone()).into_any_element(),
Cell::Number(value) => tabular(div())
.child(column.reads(*value))
.into_any_element(),
@@ -243,7 +239,7 @@ pub(crate) fn draw(cell: &Cell, column: &Column, id: ElementId, cx: &App) -> Any
.gap_2()
.min_w_0()
.child(Avatar::new(id, name.clone()).size(AvatarSize::Xs))
.child(div().min_w_0().truncate().child(name.clone()))
.child(Ellipsis::new(name.clone()))
.into_any_element(),
Cell::Link(label, url) => {
ExternalLink::new(id, label.clone(), url.clone()).into_any_element()
+2 -1
View File
@@ -11,6 +11,7 @@ use crate::{
forms::{Editing, Input},
primitives::{FocusNext, FocusPrev},
theme::{ActiveTheme, ControlSize, TextSize},
typography::Ellipsis,
};
pub(crate) type OnCells = Rc<dyn Fn(&[(usize, usize, SharedString)], &mut Window, &mut App)>;
@@ -151,7 +152,7 @@ pub(crate) fn grid(face: Face, base: Div, window: &mut Window, cx: &mut App) ->
.child(Input::new(field).size(ControlSize::Sm))
.into_any_element()
}
_ => div().min_w_0().truncate().child(text).into_any_element(),
_ => Ellipsis::new(text).into_any_element(),
};
Some(
div()
+2 -3
View File
@@ -6,7 +6,7 @@ use gpui::{
use super::{Aggregate, Cell, model::combine};
use crate::{
theme::{ActiveTheme, TextSize},
typography::{format, tabular},
typography::{Ellipsis, format, tabular},
};
/// A cross-tab: labels down the side and across the top, a figure where they meet, and totals.
@@ -151,8 +151,7 @@ impl RenderOnce for PivotTable {
.w(theme.label_width() * 0.8)
.flex_none()
.px_3()
.truncate()
.child(text)
.child(Ellipsis::new(text))
};
let number = |text: String, strong: bool| {
tabular(div())
+12 -13
View File
@@ -94,19 +94,18 @@ impl RenderOnce for TreeTable {
theme.tree_indent(),
);
let columns = Rc::new(self.columns);
let head =
div()
.flex()
.items_center()
.h(height)
.border_b_1()
.border_color(colors.border)
.text_size(theme.text_size(TextSize::Xs))
.font_weight(FontWeight::MEDIUM)
.text_color(colors.fg_muted)
.children(columns.iter().map(|column| {
sized(div().px_3(), column, narrowest).child(column.title.clone())
}));
let head = div()
.flex()
.items_center()
.h(height)
.border_b_1()
.border_color(colors.border)
.text_size(theme.text_size(TextSize::Xs))
.font_weight(FontWeight::MEDIUM)
.text_color(colors.fg_muted)
.children(columns.iter().map(|column| {
sized(div().px_3().flex(), column, narrowest).child(column.title.clone())
}));
let rows = shown.into_iter().map(|(row, depth)| {
assert_eq!(
row.cells.len(),