From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 530741FF142 for ; Tue, 07 Apr 2026 10:54:29 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 771B41101E; Tue, 7 Apr 2026 10:55:03 +0200 (CEST) Message-ID: <970e19d3-593d-415b-b0de-6565eccd4942@proxmox.com> Date: Tue, 7 Apr 2026 10:54:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH yew-widget-toolkit 1/3] widget: button: add 'icon_style' property To: Dominik Csapak , yew-devel@lists.proxmox.com References: <20260320160816.4113364-1-d.csapak@proxmox.com> <20260320160816.4113364-2-d.csapak@proxmox.com> Content-Language: en-US From: Dietmar Maurer In-Reply-To: <20260320160816.4113364-2-d.csapak@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1775552005101 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.336 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: XLPJFNAVGHTRTK733MBAUITCQNQLRMZE X-Message-ID-Hash: XLPJFNAVGHTRTK733MBAUITCQNQLRMZE X-MailFrom: dietmar@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: Yew framework devel list at Proxmox List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: I don't really like this, because style is normally a HashMap. Maybe you can find another way and do it with icon_class? On 3/20/26 5:08 PM, Dominik Csapak wrote: > so one can override the style of the icon, e.g. giving an explicit color > without having to create a CSS class for that. > > Signed-off-by: Dominik Csapak > --- > src/widget/button.rs | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/src/widget/button.rs b/src/widget/button.rs > index 584f923..85b9e9d 100644 > --- a/src/widget/button.rs > +++ b/src/widget/button.rs > @@ -64,6 +64,11 @@ pub struct Button { > #[prop_or_default] > pub icon_class: Option, > > + /// Icon CSS style. > + #[prop_or_default] > + #[builder(IntoPropValue, into_prop_value)] > + pub icon_style: Option, > + > /// Html tabindex attribute. > #[prop_or_default] > #[builder(IntoPropValue, into_prop_value)] > @@ -236,10 +241,11 @@ impl Component for PwtButton { > }; > > if let Some(icon_class) = &props.icon_class { > + let style = props.icon_style.clone(); > if !icon_class.is_empty() { > // Chromium fires onclick from nested elements, so we need to suppress that manually here > children.push(html!{ > - > + > }); > } > }