Fix step indicator layout warnings on narrow windows
This commit is contained in:
@@ -508,7 +508,13 @@ fn build_ui(app: &adw::Application) {
|
||||
|
||||
// Main content layout
|
||||
let content_box = gtk::Box::new(gtk::Orientation::Vertical, 0);
|
||||
content_box.append(step_indicator.widget());
|
||||
let indicator_scroll = gtk::ScrolledWindow::builder()
|
||||
.hscrollbar_policy(gtk::PolicyType::Automatic)
|
||||
.vscrollbar_policy(gtk::PolicyType::Never)
|
||||
.child(step_indicator.widget())
|
||||
.build();
|
||||
indicator_scroll.set_size_request(-1, 52);
|
||||
content_box.append(&indicator_scroll);
|
||||
content_box.append(&nav_view);
|
||||
content_box.append(&watch_revealer);
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ impl StepIndicator {
|
||||
.margin_end(12)
|
||||
.build();
|
||||
|
||||
// Prevent negative allocation warnings when window is narrow
|
||||
container.set_overflow(gtk::Overflow::Hidden);
|
||||
|
||||
container.update_property(&[
|
||||
gtk::accessible::Property::Label("Wizard step indicator"),
|
||||
]);
|
||||
@@ -41,7 +44,7 @@ impl StepIndicator {
|
||||
.hexpand(false)
|
||||
.valign(gtk::Align::Center)
|
||||
.build();
|
||||
line.set_size_request(24, -1);
|
||||
line.set_size_request(12, -1);
|
||||
container.append(&line);
|
||||
}
|
||||
|
||||
@@ -69,6 +72,8 @@ impl StepIndicator {
|
||||
let label = gtk::Label::builder()
|
||||
.label(name)
|
||||
.css_classes(["caption"])
|
||||
.ellipsize(gtk::pango::EllipsizeMode::End)
|
||||
.max_width_chars(8)
|
||||
.build();
|
||||
|
||||
dot_box.append(&button);
|
||||
|
||||
Reference in New Issue
Block a user