Derive Copy for Theme

This commit is contained in:
Héctor Ramón Jiménez 2022-11-03 03:22:55 +01:00
parent 9966c6f883
commit 708be32e3d
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
3 changed files with 4 additions and 4 deletions

View file

@ -80,7 +80,7 @@ impl<Message> canvas::Program<Message> for Arc {
_cursor: Cursor, _cursor: Cursor,
) -> Vec<Geometry> { ) -> Vec<Geometry> {
let geometry = self.cache.draw(bounds.size(), |frame| { let geometry = self.cache.draw(bounds.size(), |frame| {
let palette = theme.clone().palette(); let palette = theme.palette();
let center = frame.center(); let center = frame.center();
let radius = frame.width().min(frame.height()) / 5.0; let radius = frame.width().min(frame.height()) / 5.0;

View file

@ -159,6 +159,6 @@ impl Sandbox for Styling {
} }
fn theme(&self) -> Theme { fn theme(&self) -> Theme {
self.theme.clone() self.theme
} }
} }

View file

@ -21,7 +21,7 @@ use crate::toggler;
use iced_core::{Background, Color}; use iced_core::{Background, Color};
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, Copy, PartialEq)]
pub enum Theme { pub enum Theme {
Light, Light,
Dark, Dark,
@ -56,7 +56,7 @@ impl Default for Theme {
} }
} }
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, Copy, PartialEq)]
pub struct Custom { pub struct Custom {
palette: Palette, palette: Palette,
extended: Extended, extended: Extended,