╭ changed ───────────╮ │src/ui/Repo/Undo.zig│ ╰────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │395 │ │396 // the sub header carries the tab's only action │ │397 { │ │398 - var header = try wgt.Box(ui.Widget).init(allocator, .{ .border = null, .direction = .horiz }); │ │399 - errdefer header.deinit(allocator); │ │398 + var header_scroll = try ui.widget.HeaderScroll.init(allocator, session); │ │399 + errdefer header_scroll.deinit(allocator); │ │400 + const header = header_scroll.row(); │ │401 const route = ui.RoutablePage.repoUndoClearRoute(data.identity) orelse return error.RouteTooLong; │ │402 const link = try session.page_arena.allocator().print("a:{s}", .{try route.toUrl(session.page_arena)}); │ │402 - try addText(allocator, &header, "clear undo history", link, .single); │ │403 + const clear_label = "clear undo history"; │ │404 + try addText(allocator, header, clear_label, link, .single); │ │405 + // one line wide, so a narrow window scrolls the row instead of wrapping it │ │406 + header.children.values()[0].min_size = .{ .width = clear_label.len + 2, .height = null }; │ │407 header.getFocus().child_id = header.children.keys()[0]; │ │408 // a row taller than the header, leaving a blank line beneath it │ │405 - try outer.children.put(allocator, header.getFocus().id, .{ .widget = .{ .box = header }, .rect = null, .min_size = .{ .width = null, .height = 4 } }); │ │409 + try outer.children.put(allocator, header_scroll.getFocus().id, .{ .widget = .{ .header_scroll = header_scroll }, .rect = null, .min_size = .{ .width = null, .height = 4 } });│ │410 } │ │411 │ │412 // the clear form, or the empty message when there is no history or failure to show │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────╮ │513 } │ │514 │ │515 fn headerBox(self: *View) *wgt.Box(ui.Widget) { │ │512 - return &self.box.children.values()[header_index].widget.box; │ │516 + return self.box.children.values()[header_index].widget.header_scroll.row(); │ │517 } │ │518 fn headerActive(self: *View) bool { │ │515 - return self.box.getFocus().child_id == self.headerBox().getFocus().id; │ │519 + return self.box.getFocus().child_id == self.box.children.keys()[header_index];│ │520 } │ │521 fn contentBox(self: *View) *wgt.Box(ui.Widget) { │ │522 return &self.box.children.values()[content_index].widget.box; │ ╰───────────────────────────────────────────────────────────────────────────────────────────╯