state: Decide panel arrangement

Combines arrangement with layout to get panel contents as outcome.

Includes some path syntax changes for 2018 compatibility.
This commit is contained in:
Dorota Czaplejewicz
2022-06-03 17:27:47 +00:00
parent 590cd71f49
commit b634e2bfa4
3 changed files with 120 additions and 68 deletions

View File

@ -8,16 +8,26 @@ use std::time::Duration;
use crate::outputs::OutputId;
use crate::panel::PixelSize;
use crate::layout::ArrangementKind;
/// The keyboard should hide after this has elapsed to prevent flickering.
pub const HIDING_TIMEOUT: Duration = Duration::from_millis(200);
/// Panel contents
#[derive(PartialEq, Clone, Debug)]
pub struct Contents {
pub name: String,
pub kind: ArrangementKind,
pub overlay_name: Option<String>,
}
/// The outwardly visible state of visibility
#[derive(PartialEq, Debug, Clone)]
pub enum Outcome {
Visible {
output: OutputId,
height: PixelSize,
contents: Contents,
},
Hidden,
}