Show name of current Theme in clock example

This commit is contained in:
Héctor Ramón Jiménez 2024-03-16 16:52:21 +01:00
parent 348e00e11c
commit bad3b1ac47
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
5 changed files with 67 additions and 14 deletions

View file

@ -7,6 +7,18 @@ use std::ops::{Add, AddAssign, Div, Mul, RangeInclusive, Sub, SubAssign};
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
pub struct Degrees(pub f32);
impl PartialEq<f32> for Degrees {
fn eq(&self, other: &f32) -> bool {
self.0.eq(other)
}
}
impl PartialOrd<f32> for Degrees {
fn partial_cmp(&self, other: &f32) -> Option<std::cmp::Ordering> {
self.0.partial_cmp(other)
}
}
/// Radians
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
pub struct Radians(pub f32);
@ -140,3 +152,15 @@ impl Div for Radians {
Self(self.0 / rhs.0)
}
}
impl PartialEq<f32> for Radians {
fn eq(&self, other: &f32) -> bool {
self.0.eq(other)
}
}
impl PartialOrd<f32> for Radians {
fn partial_cmp(&self, other: &f32) -> Option<std::cmp::Ordering> {
self.0.partial_cmp(other)
}
}