Notify only Palette changes in iced_debug
This commit is contained in:
parent
c856d2b513
commit
26d49be1b2
1 changed files with 9 additions and 1 deletions
|
|
@ -57,7 +57,13 @@ mod internal {
|
||||||
use std::sync::{Mutex, MutexGuard};
|
use std::sync::{Mutex, MutexGuard};
|
||||||
|
|
||||||
pub fn theme_changed(palette: theme::Palette) {
|
pub fn theme_changed(palette: theme::Palette) {
|
||||||
lock().sentinel.report_theme_change(palette);
|
let mut debug = lock();
|
||||||
|
|
||||||
|
if debug.last_palette.as_ref() != Some(&palette) {
|
||||||
|
debug.sentinel.report_theme_change(palette);
|
||||||
|
|
||||||
|
debug.last_palette = Some(palette);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn boot_time() -> Timer {
|
pub fn boot_time() -> Timer {
|
||||||
|
|
@ -117,12 +123,14 @@ mod internal {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Debug {
|
struct Debug {
|
||||||
sentinel: Client,
|
sentinel: Client,
|
||||||
|
last_palette: Option<theme::Palette>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lock() -> MutexGuard<'static, Debug> {
|
fn lock() -> MutexGuard<'static, Debug> {
|
||||||
static DEBUG: Lazy<Mutex<Debug>> = Lazy::new(|| {
|
static DEBUG: Lazy<Mutex<Debug>> = Lazy::new(|| {
|
||||||
Mutex::new(Debug {
|
Mutex::new(Debug {
|
||||||
sentinel: client::connect(),
|
sentinel: client::connect(),
|
||||||
|
last_palette: None,
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue