From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 7E6471FF0AF for ; Fri, 06 Nov 2026 13:04:40 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id C11D821606; Fri, 06 Nov 2026 13:04:36 +0100 (CET) From: Christoph Heiss To: pve-devel@lists.proxmox.com Subject: [PATCH installer] tui: network: toggle form labels too in advanced options dialog Date: Fri, 6 Nov 2026 13:02:59 +0100 Message-ID: <20261106120419.392497-1-c.heiss@proxmox.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261102124539.1008075-1-c.heiss@proxmox.com> References: <20261102124539.1008075-1-c.heiss@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793966670184 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.120 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) PROLO_LEO2 0.1 Meta Catches all Leo drug variations so far RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: LQC2W74HSTWALXAXR7A7QVDWWHBT5M4R X-Message-ID-Hash: LQC2W74HSTWALXAXR7A7QVDWWHBT5M4R X-MailFrom: c.heiss@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This follows the GUI more closely by also changing the style of the labels to make them the same coloring as disabled interactive form elements. Suggested-by: Lukas Sichert Signed-off-by: Christoph Heiss --- Just a small follow-up patch for the series, w/o the need to re-spin it all. Can also rebase & resend to whole series with this patch properly integrated, if wanted so. proxmox-tui-installer/src/views/mod.rs | 45 +++++++++++++++++++++- proxmox-tui-installer/src/views/network.rs | 20 +++++++--- 2 files changed, 58 insertions(+), 7 deletions(-) diff --git a/proxmox-tui-installer/src/views/mod.rs b/proxmox-tui-installer/src/views/mod.rs index 9349a9c..760b467 100644 --- a/proxmox-tui-installer/src/views/mod.rs +++ b/proxmox-tui-installer/src/views/mod.rs @@ -3,7 +3,7 @@ use std::{collections::HashMap, net::IpAddr, str::FromStr, sync::Arc}; use cursive::{ Printer, Rect, Vec2, View, event::{Event, EventResult}, - theme::BaseColor, + theme::{BaseColor, StyleType}, view::{Resizable, ViewWrapper}, views::{ Checkbox, DummyView, EditView, LinearLayout, NamedView, ResizedView, SelectView, TextView, @@ -543,6 +543,33 @@ impl FormView { } } + pub fn set_labels_enabled(&mut self, enabled: bool) { + let style = if enabled { + StyleType::primary() + } else { + StyleType::secondary() + }; + + let len = self.len(); + let view = self + .view + .get_child_mut(0) + .and_then(|v| v.downcast_mut::>()) + .map(|v| v.get_inner_mut()); + + if let Some(view) = view { + for i in 0..len { + let label = view + .get_child_mut(i) + .and_then(|v| v.downcast_mut::()); + + if let Some(label) = label { + label.set_style(style); + } + } + } + } + pub fn len(&self) -> usize { self.view .get_child(1) @@ -685,7 +712,23 @@ impl CheckboxGroup { } pub fn set_enabled(&mut self, enabled: bool) { + let label_style = if enabled { + StyleType::primary() + } else { + StyleType::secondary() + }; + for i in 0..self.view.len() { + if let Some(label) = self + .view + .get_child_mut(i) + .and_then(|v| v.downcast_mut::()) + .and_then(|v| v.get_child_mut(2)) + .and_then(|v| v.downcast_mut::()) + { + label.set_style(label_style); + } + if let Some(checkbox) = self .view .get_child_mut(i) diff --git a/proxmox-tui-installer/src/views/network.rs b/proxmox-tui-installer/src/views/network.rs index 15b078f..877d343 100644 --- a/proxmox-tui-installer/src/views/network.rs +++ b/proxmox-tui-installer/src/views/network.rs @@ -1,6 +1,7 @@ use anyhow::{Result, anyhow, bail}; use cursive::{ Cursive, View, + theme::StyleType, view::{Nameable, Resizable, ViewWrapper}, views::{ Button, Checkbox, Dialog, DummyView, EditView, LinearLayout, NamedView, PaddedView, @@ -497,6 +498,7 @@ impl InterfacePinningOptionsView { fn toggle_all(siv: &mut Cursive, enabled: bool) { siv.call_on_name(Self::FORM_NAME, |v: &mut FormView| { + v.set_labels_enabled(enabled); v.call_on_childs(&|v: &mut LinearLayout| { if let Some(v) = v .get_child_mut(1) @@ -675,6 +677,8 @@ impl BondOptionsView { fn toggle_all(siv: &mut Cursive, enabled: bool) { siv.call_on_name(Self::FORM_NAME, |form: &mut FormView| { + form.set_labels_enabled(enabled); + if let Some(v) = form.get_child_mut::>(0) { v.set_enabled(enabled); } @@ -839,12 +843,7 @@ impl VlanOptionsView { move |siv, enabled| { options_ref.lock().expect("unpoisoned lock").vlan_enabled = enabled; - - siv.call_on_name(Self::FORM_NAME, |form: &mut FormView| { - if let Some(v) = form.get_child_mut::(0) { - v.set_enabled(enabled); - } - }); + Self::toggle_all(siv, enabled); } }), ) @@ -867,6 +866,15 @@ impl VlanOptionsView { Self { view } } + fn toggle_all(siv: &mut Cursive, enabled: bool) { + siv.call_on_name(Self::FORM_NAME, |form: &mut FormView| { + form.set_labels_enabled(enabled); + if let Some(v) = form.get_child_mut::(0) { + v.set_enabled(enabled); + } + }); + } + fn get_values(&mut self) -> Result { let form = self .view -- 2.56.0