Replace scrollbar state with simple offset struct

Introduce Offset type to track scroll positions and replace
ScrollbarState fields in SkirmishState
Update keybindings, App::draw, Widget impl, and BoardWidget::new
to use mutable references and the new Offset struct.
Adjust imports accordingly.
This commit is contained in:
2026-03-26 21:50:39 +01:00
parent cc179cee03
commit 5a40760151
8 changed files with 59 additions and 32 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ use ratatui::{
widgets::{Block, Borders, Padding, Paragraph, Widget},
};
pub fn skirmish_view(app: &App, area: Rect, buf: &mut Buffer) {
pub fn skirmish_view(app: &mut App, area: Rect, buf: &mut Buffer) {
let vertical_layout: Layout = Layout::vertical([
Constraint::Length(4),
Constraint::Fill(1),
@@ -70,7 +70,7 @@ pub fn skirmish_view(app: &App, area: Rect, buf: &mut Buffer) {
board_block.render(main_area, buf);
let cells_area: Rect = board_area.inner(Margin {
horizontal: 1,
horizontal: 3,
vertical: 1,
});