View ribbon: lay out the Show group's checkboxes in two columns

The Show group stacked Ruler, Formula Bar, Gridlines and Headings in
one column, but the ribbon body fits only three rows, so Headings was
cut off at the bottom and could not be reached. The four checkboxes now
sit in two columns of two (Ruler/Gridlines, Formula Bar/Headings), as in
Excel's Show group. Checked in English and German, which has the
longest labels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bmh129
2026-10-12 16:03:47 -05:00
co-authored by Claude Opus 5.5
parent fc45b7f6d8
commit 0153457580
+10 -6
View File
@@ -2106,6 +2106,7 @@ fn view(app: &mut SheetApp, ui: &mut Ui) {
let lang = app.ui.language;
let page_layout =
app.session.active().and_then(|d| d.wb.active().map(|s| s.view == gridcraft_engine::model::SheetViewMode::PageLayout)).unwrap_or(false);
// Two columns of two, as in Excel's Show group: four stacked rows overflow the ribbon body.
ui.vertical(|ui| {
// Rulers exist only in Page Layout view.
let mut ruler = !app.session.hide_ruler;
@@ -2114,18 +2115,21 @@ fn view(app: &mut SheetApp, ui: &mut Ui) {
if ruler_resp.changed() {
act(app, "view.ruler", json!({"on": ruler}));
}
let mut fb = app.session.prefs.formula_bar;
let resp = ui.checkbox(&mut fb, lang.tr("Formula Bar"));
control_keytip(app, ui, &resp, "view.formulaBar");
if resp.changed() || invoke(app, "view.formulaBar") {
act(app, "view.formulaBar", json!({"on": !fb}));
}
let mut g = s.0;
let resp = ui.checkbox(&mut g, lang.tr("Gridlines"));
control_keytip(app, ui, &resp, "view.gridlines");
if resp.changed() {
act(app, "view.gridlines", json!({"on": g}));
}
});
ui.add_space(6.0);
ui.vertical(|ui| {
let mut fb = app.session.prefs.formula_bar;
let resp = ui.checkbox(&mut fb, lang.tr("Formula Bar"));
control_keytip(app, ui, &resp, "view.formulaBar");
if resp.changed() || invoke(app, "view.formulaBar") {
act(app, "view.formulaBar", json!({"on": !fb}));
}
let mut h = s.1;
let resp = ui.checkbox(&mut h, lang.tr("Headings"));
control_keytip(app, ui, &resp, "view.headings");