mirror of
https://github.com/YaLTeR/niri.git
synced 2025-10-06 00:23:14 +02:00
feat: support color picker functionality
chore: format code refactor: improve quality feat: implement gnomes PickColor method refactor: minor code extraction misc: fix reviews fixes
This commit is contained in:
committed by
Ivan Molodetskikh
parent
ed20822ce9
commit
7210045b2a
@@ -65,6 +65,8 @@ pub enum Request {
|
||||
FocusedWindow,
|
||||
/// Request picking a window and get its information.
|
||||
PickWindow,
|
||||
/// Request picking a color from the screen.
|
||||
PickColor,
|
||||
/// Perform an action.
|
||||
Action(Action),
|
||||
/// Change output configuration temporarily.
|
||||
@@ -133,10 +135,20 @@ pub enum Response {
|
||||
FocusedWindow(Option<Window>),
|
||||
/// Information about the picked window.
|
||||
PickedWindow(Option<Window>),
|
||||
/// Information about the picked color.
|
||||
PickedColor(Option<PickedColor>),
|
||||
/// Output configuration change result.
|
||||
OutputConfigChanged(OutputConfigChanged),
|
||||
}
|
||||
|
||||
/// Color picked from the screen.
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
|
||||
pub struct PickedColor {
|
||||
/// Color values as red, green, blue, each ranging from 0.0 to 1.0.
|
||||
pub rgb: [f64; 3],
|
||||
}
|
||||
|
||||
/// Actions that niri can perform.
|
||||
// Variants in this enum should match the spelling of the ones in niri-config. Most, but not all,
|
||||
// variants from niri-config should be present here.
|
||||
|
Reference in New Issue
Block a user