Skip to content

Commit

Permalink
Derive Copy for Theme
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Nov 3, 2022
1 parent 20f17b6 commit 0ac7f83
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/arc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl<Message> canvas::Program<Message> for Arc {
_cursor: Cursor,
) -> Vec<Geometry> {
let geometry = self.cache.draw(bounds.size(), |frame| {
let palette = theme.clone().palette();
let palette = theme.palette();

let center = frame.center();
let radius = frame.width().min(frame.height()) / 5.0;
Expand Down
2 changes: 1 addition & 1 deletion examples/styling/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,6 @@ impl Sandbox for Styling {
}

fn theme(&self) -> Theme {
self.theme.clone()
self.theme
}
}
4 changes: 2 additions & 2 deletions style/src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::toggler;

use iced_core::{Background, Color};

#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Theme {
Light,
Dark,
Expand Down Expand Up @@ -56,7 +56,7 @@ impl Default for Theme {
}
}

#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Custom {
palette: Palette,
extended: Extended,
Expand Down

0 comments on commit 0ac7f83

Please sign in to comment.