mirror of
https://codeberg.org/waydeer/layer-shika.git
synced 2025-11-17 23:14:23 +00:00
refactor: minor changes
This commit is contained in:
parent
69b56d59ae
commit
bc7d13be55
6 changed files with 12 additions and 24 deletions
|
|
@ -72,8 +72,8 @@ impl EventContext {
|
|||
.publish(&WindowStateEvent::PopupConfigurationChanged);
|
||||
}
|
||||
|
||||
pub const fn popup_manager(&self) -> &Option<Rc<PopupManager>> {
|
||||
&self.popup_manager
|
||||
pub const fn popup_manager(&self) -> Option<&Rc<PopupManager>> {
|
||||
self.popup_manager.as_ref()
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ impl<W: RenderableWindow> RenderingState<W> {
|
|||
self.renderer.layer_surface()
|
||||
}
|
||||
|
||||
pub const fn fractional_scale(&self) -> &Option<ManagedWpFractionalScaleV1> {
|
||||
pub fn fractional_scale(&self) -> Option<&ManagedWpFractionalScaleV1> {
|
||||
self.renderer.fractional_scale()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ impl WindowState {
|
|||
.update_scale_for_fractional_scale_object(fractional_scale_proxy, scale_120ths);
|
||||
}
|
||||
|
||||
pub fn popup_manager(&self) -> &Option<Rc<PopupManager>> {
|
||||
pub fn popup_manager(&self) -> Option<&Rc<PopupManager>> {
|
||||
self.event_context.popup_manager()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,23 +3,13 @@ use slint::PhysicalSize;
|
|||
#[allow(dead_code)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum WindowStateEvent {
|
||||
ScaleFactorChanged {
|
||||
new_scale: f32,
|
||||
source: ScaleSource,
|
||||
},
|
||||
ScaleFactorChanged { new_scale: f32, source: ScaleSource },
|
||||
|
||||
OutputSizeChanged {
|
||||
output_size: PhysicalSize,
|
||||
},
|
||||
OutputSizeChanged { output_size: PhysicalSize },
|
||||
|
||||
PointerPositionChanged {
|
||||
physical_x: f64,
|
||||
physical_y: f64,
|
||||
},
|
||||
PointerPositionChanged { physical_x: f64, physical_y: f64 },
|
||||
|
||||
PointerSerialUpdated {
|
||||
serial: u32,
|
||||
},
|
||||
PointerSerialUpdated { serial: u32 },
|
||||
|
||||
PopupConfigurationChanged,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ impl<W: RenderableWindow> WindowRenderer<W> {
|
|||
self.logical_size
|
||||
}
|
||||
|
||||
pub const fn fractional_scale(&self) -> &Option<ManagedWpFractionalScaleV1> {
|
||||
&self.fractional_scale
|
||||
pub const fn fractional_scale(&self) -> Option<&ManagedWpFractionalScaleV1> {
|
||||
self.fractional_scale.as_ref()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,13 +164,12 @@ impl RuntimeState<'_> {
|
|||
let popup_manager = self
|
||||
.window_state
|
||||
.popup_manager()
|
||||
.as_ref()
|
||||
.ok_or_else(|| {
|
||||
Error::Domain(DomainError::Configuration {
|
||||
message: "No popup manager available".to_string(),
|
||||
})
|
||||
})
|
||||
.map(Rc::clone)?;
|
||||
.cloned()?;
|
||||
|
||||
let initial_dimensions = match req.size {
|
||||
PopupSize::Fixed { w, h } => {
|
||||
|
|
@ -242,13 +241,12 @@ impl RuntimeState<'_> {
|
|||
let popup_manager = self
|
||||
.window_state
|
||||
.popup_manager()
|
||||
.as_ref()
|
||||
.ok_or_else(|| {
|
||||
Error::Domain(DomainError::Configuration {
|
||||
message: "No popup manager available".to_string(),
|
||||
})
|
||||
})
|
||||
.map(Rc::clone)?;
|
||||
.cloned()?;
|
||||
|
||||
let Some((request, _serial)) = popup_manager.get_popup_info(key) else {
|
||||
log::debug!(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue