Add side panel and refactor title helpers

Introduce a `side_panel` flag throughout the skirmish state, board
creation,
and cell area calculation to enable a detachable side panel. Refactor
the
title helper to own its strings and use a static separator, updating the
single‑title helper accordingly. Add a new `SidePanelWidget` and expose
the
`skirmish_main_area_layout` helper. Extend keybindings with `Tab` and
`ShiftTab` actions under a new `Opener` group. Update structures and
units
to implement a `get_name` method and adjust related traits and imports.
This commit is contained in:
GarandPLG committed 2026-04-24 11:41:09 +02:00
1 parent 06a439ff88
commit cf843057c3
23 files changed
+302 -123

No files matched your search

+5 -3
View File
@@ -1,13 +1,15 @@
use crate::app::views::skirmish_layout;
use crate::app::views::{skirmish_layout, skirmish_main_area_layout};
use ratatui::{
layout::{Margin, Rect},
widgets::{Block, Borders},
};
pub fn cells_area_helper(area: &Rect) -> Rect {
pub fn cells_area_helper(area: &Rect, side_panel: bool) -> Rect {
let board_area: Rect = skirmish_main_area_layout(skirmish_layout(*area)[1], side_panel)[0];
Block::new()
.borders(Borders::LEFT | Borders::TOP | Borders::RIGHT)
.inner(skirmish_layout(*area)[1])
.inner(board_area)
.inner(Margin {
horizontal: 1,
vertical: 1,