From aed06ac208d1e80b13c5952adbff78dd7d02c025 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 21 Aug 2023 13:32:44 -0400 Subject: Support automatic style type casting for Buttons. Changes the signature of Button::style to use `impl Into<...>` instead of taking the style sheet itself. (Matches other widgets). --- widget/src/button.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'widget/src/button.rs') diff --git a/widget/src/button.rs b/widget/src/button.rs index 5727c631..18a95c9e 100644 --- a/widget/src/button.rs +++ b/widget/src/button.rs @@ -119,9 +119,9 @@ where /// Sets the style variant of this [`Button`]. pub fn style( mut self, - style: ::Style, + style: impl Into<::Style>, ) -> Self { - self.style = style; + self.style = style.into(); self } } -- cgit