Skip to content

Commit b5e52e9

Browse files
pwsandovalcachebag
authored andcommitted
fix(gui): ellipsize header status label to avoid width inflation
1 parent 51c224f commit b5e52e9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nmrs-gui/src/ui/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ pub mod wired_page;
77

88
use gtk::prelude::*;
99
use gtk::{
10-
Application, ApplicationWindow, Box as GtkBox, Label, Orientation, ScrolledWindow, Spinner,
11-
Stack, STYLE_PROVIDER_PRIORITY_USER,
10+
pango::EllipsizeMode, Application, ApplicationWindow, Box as GtkBox, Label, Orientation,
11+
ScrolledWindow, Spinner, Stack, STYLE_PROVIDER_PRIORITY_USER,
1212
};
1313
use std::cell::Cell;
1414
use std::rc::Rc;
@@ -54,6 +54,9 @@ pub fn build_ui(app: &Application) {
5454

5555
let vbox = GtkBox::new(Orientation::Vertical, 0);
5656
let status = Label::new(None);
57+
status.set_xalign(0.0);
58+
status.set_ellipsize(EllipsizeMode::End);
59+
status.set_max_width_chars(36);
5760
let list_container = GtkBox::new(Orientation::Vertical, 0);
5861
let stack = Stack::new();
5962
let is_scanning = Rc::new(Cell::new(false));

0 commit comments

Comments
 (0)