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