Pass application context to GUI. (#11)

This commit was merged in pull request #11.
This commit is contained in:
2026-01-31 04:25:14 +00:00
parent 00f9075d0f
commit 2340fd7652
21 changed files with 937 additions and 311 deletions

View File

@@ -111,7 +111,7 @@ impl FocusState for ComponentState {
fn with_focus(self, focus: Focus) -> Self {
Self {
focus,
vis: Visibility::Visible,
vis: self.vis,
help_text: self.help_text,
}
}
@@ -142,7 +142,7 @@ pub enum Visibility {
pub trait VisibleState {
fn with_visible(self, vis: Visibility) -> Self;
fn set_visible(&mut self, vis: Visibility);
fn togget_visible(&mut self);
fn toggle_visible(&mut self);
}
impl VisibleState for ComponentState {
@@ -158,7 +158,7 @@ impl VisibleState for ComponentState {
self.vis = vis;
}
fn togget_visible(&mut self) {
fn toggle_visible(&mut self) {
match self.vis {
Visibility::Visible => self.set_visible(Visibility::Hidden),
Visibility::Hidden => self.set_visible(Visibility::Visible),