customization via wayvr_ipc

This commit is contained in:
galister
2025-12-23 13:29:01 +09:00
parent 8f9f057c97
commit 5287b659e8
13 changed files with 247 additions and 11 deletions

View File

@@ -1,8 +1,8 @@
use std::{
f32,
sync::{
Arc,
atomic::{AtomicUsize, Ordering},
Arc,
},
};

View File

@@ -2,8 +2,9 @@ use slotmap::Key;
use crate::{
drawing::{self, GradientMode, PrimitiveExtent},
event::CallbackDataCommon,
layout::WidgetID,
widget::{WidgetStateFlags, util::WLength},
widget::{util::WLength, WidgetStateFlags},
};
use super::{WidgetObj, WidgetState};
@@ -35,6 +36,10 @@ impl WidgetRectangle {
}),
)
}
pub fn set_color(&mut self, common: &mut CallbackDataCommon, color: drawing::Color) {
self.params.color = color;
common.mark_widget_dirty(self.id);
}
}
impl WidgetObj for WidgetRectangle {

View File

@@ -5,11 +5,12 @@ use slotmap::Key;
use crate::{
drawing::{self, PrimitiveExtent},
event::CallbackDataCommon,
globals::Globals,
layout::WidgetID,
renderer_vk::text::{
DEFAULT_METRICS,
custom_glyph::{CustomGlyph, CustomGlyphData},
DEFAULT_METRICS,
},
widget::WidgetStateFlags,
};
@@ -39,16 +40,18 @@ impl WidgetSprite {
)
}
pub fn set_color(&mut self, color: drawing::Color) {
pub fn set_color(&mut self, common: &mut CallbackDataCommon, color: drawing::Color) {
self.params.color = Some(color);
common.mark_widget_dirty(self.id);
}
pub fn get_color(&self) -> Option<drawing::Color> {
self.params.color
}
pub fn set_content(&mut self, content: Option<CustomGlyphData>) {
pub fn set_content(&mut self, common: &mut CallbackDataCommon, content: Option<CustomGlyphData>) {
self.params.glyph_data = content;
common.mark_widget_dirty(self.id);
}
pub fn get_content(&self) -> Option<CustomGlyphData> {