mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
tab indicator: Add position setting
This commit is contained in:
@@ -691,6 +691,8 @@ pub struct TabIndicator {
|
||||
pub width: FloatOrInt<0, 65535>,
|
||||
#[knuffel(child, default = Self::default().length)]
|
||||
pub length: TabIndicatorLength,
|
||||
#[knuffel(child, unwrap(argument), default = Self::default().position)]
|
||||
pub position: TabIndicatorPosition,
|
||||
#[knuffel(child)]
|
||||
pub active_color: Option<Color>,
|
||||
#[knuffel(child)]
|
||||
@@ -711,6 +713,7 @@ impl Default for TabIndicator {
|
||||
length: TabIndicatorLength {
|
||||
total_proportion: Some(0.5),
|
||||
},
|
||||
position: TabIndicatorPosition::Left,
|
||||
active_color: None,
|
||||
inactive_color: None,
|
||||
active_gradient: None,
|
||||
@@ -725,6 +728,14 @@ pub struct TabIndicatorLength {
|
||||
pub total_proportion: Option<f64>,
|
||||
}
|
||||
|
||||
#[derive(knuffel::DecodeScalar, Debug, Clone, Copy, PartialEq)]
|
||||
pub enum TabIndicatorPosition {
|
||||
Left,
|
||||
Right,
|
||||
Top,
|
||||
Bottom,
|
||||
}
|
||||
|
||||
#[derive(knuffel::Decode, Debug, Clone, Copy, PartialEq)]
|
||||
pub struct InsertHint {
|
||||
#[knuffel(child)]
|
||||
@@ -3555,6 +3566,7 @@ mod tests {
|
||||
|
||||
tab-indicator {
|
||||
width 10
|
||||
position "top"
|
||||
}
|
||||
|
||||
preset-column-widths {
|
||||
@@ -3819,6 +3831,7 @@ mod tests {
|
||||
},
|
||||
tab_indicator: TabIndicator {
|
||||
width: FloatOrInt(10.),
|
||||
position: TabIndicatorPosition::Top,
|
||||
..Default::default()
|
||||
},
|
||||
insert_hint: InsertHint {
|
||||
|
||||
Reference in New Issue
Block a user