mirror of
https://codeberg.org/waydeer/layer-shika.git
synced 2025-12-12 13:25:54 +00:00
fix: clippy
This commit is contained in:
parent
3eca2b483c
commit
2039684eb3
5 changed files with 10 additions and 35 deletions
|
|
@ -1,7 +1,8 @@
|
|||
/// Strategy for calculating popup position relative to an anchor rectangle
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
|
||||
pub enum AnchorStrategy {
|
||||
/// Center popup horizontally below the anchor
|
||||
#[default]
|
||||
CenterBottom,
|
||||
/// Center popup horizontally above the anchor
|
||||
CenterTop,
|
||||
|
|
@ -49,9 +50,3 @@ impl AnchorStrategy {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for AnchorStrategy {
|
||||
fn default() -> Self {
|
||||
Self::CenterBottom
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,11 @@
|
|||
/// Controls how a surface receives keyboard input
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
||||
pub enum KeyboardInteractivity {
|
||||
/// Surface does not receive keyboard events
|
||||
None,
|
||||
/// Surface always receives keyboard focus
|
||||
Exclusive,
|
||||
/// Surface receives focus when clicked (default)
|
||||
#[default]
|
||||
OnDemand,
|
||||
}
|
||||
|
||||
impl Default for KeyboardInteractivity {
|
||||
fn default() -> Self {
|
||||
Self::OnDemand
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,20 +2,15 @@
|
|||
///
|
||||
/// Determines which layer a surface appears in, affecting visibility and stacking order.
|
||||
/// Defaults to `Top` for typical panels and bars.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
||||
pub enum Layer {
|
||||
/// Lowest layer, typically for wallpapers
|
||||
Background,
|
||||
/// Below normal windows
|
||||
Bottom,
|
||||
/// Above normal windows, default for bars/panels
|
||||
#[default]
|
||||
Top,
|
||||
/// Highest layer, above all other content
|
||||
Overlay,
|
||||
}
|
||||
|
||||
impl Default for Layer {
|
||||
fn default() -> Self {
|
||||
Self::Top
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,10 @@ use std::rc::Rc;
|
|||
type OutputFilter = Rc<dyn Fn(&OutputInfo) -> bool>;
|
||||
|
||||
/// Determines which outputs (monitors) should display the surface
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Default)]
|
||||
pub enum OutputPolicy {
|
||||
/// Display surface on all connected outputs (default)
|
||||
#[default]
|
||||
AllOutputs,
|
||||
/// Display surface only on the primary output
|
||||
PrimaryOnly,
|
||||
|
|
@ -40,12 +41,6 @@ impl OutputPolicy {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for OutputPolicy {
|
||||
fn default() -> Self {
|
||||
Self::AllOutputs
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for OutputPolicy {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
/// Alignment mode for popup positioning
|
||||
///
|
||||
/// Determines how a popup is aligned relative to its placement point.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
|
||||
pub enum PopupPositioningMode {
|
||||
/// Align popup's top-left corner to placement point
|
||||
#[default]
|
||||
TopLeft,
|
||||
/// Center popup horizontally at placement point, top edge aligned
|
||||
TopCenter,
|
||||
|
|
@ -44,9 +45,3 @@ impl PopupPositioningMode {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for PopupPositioningMode {
|
||||
fn default() -> Self {
|
||||
Self::TopLeft
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue