]> git.proxmox.com Git - pve-installer.git/commitdiff
tui: drop unneeded parameter from InstallerBackgroundView::new()
authorChristoph Heiss <c.heiss@proxmox.com>
Wed, 21 Jun 2023 06:09:29 +0000 (08:09 +0200)
committerChristoph Heiss <c.heiss@proxmox.com>
Wed, 21 Jun 2023 06:09:29 +0000 (08:09 +0200)
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
proxmox-tui-installer/src/main.rs

index af44fa74e37ee40a611c73b3ea21c391a27be8f2..6113bd15247f9f5da28d6aa328cf0741667d9147 100644 (file)
@@ -103,8 +103,7 @@ struct InstallerBackgroundView {
 }
 
 impl InstallerBackgroundView {
-    pub fn new(_state: &InstallerState) -> Self {
-        let logo = format!("{PROXMOX_LOGO}");
+    pub fn new() -> Self {
         let style = Style {
             effects: Effect::Bold.into(),
             color: ColorStyle::back(PaletteColor::View),
@@ -114,7 +113,7 @@ impl InstallerBackgroundView {
         view.add_fullscreen_layer(Layer::with_color(
             DummyView
                 .full_width()
-                .fixed_height(logo.lines().count() + 1),
+                .fixed_height(PROXMOX_LOGO.lines().count() + 1),
             ColorStyle::back(PaletteColor::View),
         ));
         view.add_transparent_layer_at(
@@ -122,7 +121,7 @@ impl InstallerBackgroundView {
                 x: Offset::Center,
                 y: Offset::Absolute(0),
             },
-            TextView::new(logo).style(style),
+            TextView::new(PROXMOX_LOGO).style(style),
         );
 
         Self { view }
@@ -262,15 +261,13 @@ fn switch_to_next_screen(
     let screen = siv.add_active_screen();
     siv.with_user_data(|state: &mut InstallerState| state.steps.insert(step, screen));
 
-    if let Some(state) = siv.user_data::<InstallerState>().cloned() {
-        siv.screen_mut().add_transparent_layer_at(
-            XY {
-                x: Offset::Parent(0),
-                y: Offset::Parent(0),
-            },
-            InstallerBackgroundView::new(&state),
-        );
-    }
+    siv.screen_mut().add_transparent_layer_at(
+        XY {
+            x: Offset::Parent(0),
+            y: Offset::Parent(0),
+        },
+        InstallerBackgroundView::new(),
+    );
 
     siv.screen_mut().add_layer(v);
 }