var name ellipsis

This commit is contained in:
Martin Kavík 2024-06-18 17:24:46 +02:00
parent 96a6a68ceb
commit fb64c8b3d1
2 changed files with 22 additions and 9 deletions

View file

@ -393,7 +393,8 @@ impl ControlsPanel {
.s(Align::new().top()) .s(Align::new().top())
.s(Gap::new().y(20)) .s(Gap::new().y(20))
.s(Height::fill().min(150)) .s(Height::fill().min(150))
.s(Scrollbars::y_and_clip_x()) .s(Width::fill())
.s(Scrollbars::both())
.item_signal( .item_signal(
self.layout self.layout
.signal() .signal()
@ -448,17 +449,18 @@ impl ControlsPanel {
} }
})); }));
let layout = self.layout.clone();
Column::new() Column::new()
.s(Width::with_signal_self( .s(Width::with_signal_self(layout.signal().map(
self.layout move |layout| match layout {
.signal() Layout::Tree => Width::fill(),
.map(|layout| matches!(layout, Layout::Columns)) Layout::Columns => Width::default().min(MILLER_COLUMN_SCOPE_VAR_ROW_MIN_WIDTH),
.map_true(|| Width::default().min(MILLER_COLUMN_SCOPE_VAR_ROW_MIN_WIDTH)), },
)) )))
.s(Align::new().left()) .s(Align::new().left())
.s(Gap::new().y(10)) .s(Gap::new().y(10))
.s(Height::fill()) .s(Height::fill())
.s(Scrollbars::y_and_clip_x()) .s(Scrollbars::both())
.items_signal_vec( .items_signal_vec(
vars_for_ui_mutable_vec vars_for_ui_mutable_vec
.signal_vec_cloned() .signal_vec_cloned()
@ -470,12 +472,13 @@ impl ControlsPanel {
fn var_row(&self, var_for_ui: VarForUI) -> impl Element { fn var_row(&self, var_for_ui: VarForUI) -> impl Element {
Row::new() Row::new()
.s(Gap::new().x(10)) .s(Gap::new().x(10))
.s(Padding::new().right(15))
.item(self.var_button(var_for_ui.clone())) .item(self.var_button(var_for_ui.clone()))
.item(self.var_tag_type(var_for_ui.clone())) .item(self.var_tag_type(var_for_ui.clone()))
.item(self.var_tag_index(var_for_ui.clone())) .item(self.var_tag_index(var_for_ui.clone()))
.item(self.var_tag_bit(var_for_ui.clone())) .item(self.var_tag_bit(var_for_ui.clone()))
.item(self.var_tag_direction(var_for_ui)) .item(self.var_tag_direction(var_for_ui))
// Note: Padding or 0 height don't work for some reasons here
.item(El::new().s(Width::exact(10)).s(Height::exact(1)))
} }
fn var_button(&self, var_for_ui: VarForUI) -> impl Element { fn var_button(&self, var_for_ui: VarForUI) -> impl Element {

View file

@ -220,6 +220,16 @@ impl WaveformPanel {
.s(RoundedCorners::new().left(15).right(5)) .s(RoundedCorners::new().left(15).right(5))
.label( .label(
El::new() El::new()
.update_raw_el(|raw_el| {
raw_el
// @TODO move `title` to MZ API? (as `native_tooltip`?)
.attr("title", name)
// Note: `text-overflow` / ellipsis` doesn't work with flex and dynamic sizes
.style("text-overflow", "ellipsis")
.style("display", "inline-block")
})
.s(Scrollbars::both().visible(false))
.s(Width::default().max(400))
.s(Align::new().left()) .s(Align::new().left())
.s(Padding::new().left(20).right(17).y(10)) .s(Padding::new().left(20).right(17).y(10))
.child(name), .child(name),