Skip to content

Commit

Permalink
Make Orientation compatible with both org.freedesktop.StatusNotifie…
Browse files Browse the repository at this point in the history
…rItem and org.kde.StatusNotifierItem
  • Loading branch information
iovxw committed Dec 7, 2024
1 parent e5f2bb1 commit 47aa0ed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ use std::fmt;
use zbus::zvariant::{Type, Value};

/// Represent the horizontal or vertical orientation of the scroll request
// In org.freedesktop.StatusNotifierItem it's "horizontal" and "vertical"
// In org.kde.StatusNotifierItem it's "Horizontal" and "Vertical"
// GNOME:
// https://github.com/ubuntu/gnome-shell-extension-appindicator/blob/557dbddc8d469d1aaa302e6cf70600855dd767d1/appIndicator.js#L840-L861
// KDE:
// https://github.com/KDE/plasma-workspace/blob/4a98130f76bcae4211d3f9b10e4a7b760613ffc6/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml#L99-L115
#[derive(Copy, Clone, Debug, Eq, PartialEq, Type, Deserialize)]
#[zvariant(signature = "s")]
#[serde(rename_all = "lowercase")]
pub enum Orientation {
#[serde(alias = "horizontal")]
Horizontal,
#[serde(alias = "vertical")]
Vertical,
}

Expand Down

0 comments on commit 47aa0ed

Please sign in to comment.