Peeks start where the part is: no dip when the bar hides
Switching from a workspace with the bar shown to a fullscreen one slid the bar away while the workspace peek slid in from hidden, so the pill dipped and came back. A peek now starts from the part's current position, so a shown pill stays still for the peek and then leaves. The tray, which peeks don't show, slides away on its own. Tested on DP-2 (2 -> 3 and back), frame by frame.
This commit is contained in:
+7
-6
@@ -46,11 +46,12 @@ pub fn view(monitor: &Monitor) -> LayerWindow {
|
||||
let workspaces = Workspaces::read();
|
||||
let hover = Hover::read();
|
||||
|
||||
// hidden on a fullscreen monitor until wanted, or for a moment on a workspace change (edge.rs)
|
||||
let (slide, switched, peeking) = {
|
||||
// hidden on a fullscreen monitor until wanted, or for a moment on a workspace change (edge.rs); the tray only goes with the whole bar
|
||||
let (slide, tray_slide, switched, peeking) = {
|
||||
let edge = Edge::read();
|
||||
let shown = edge.shown(&monitor.name);
|
||||
|
||||
(edge::hidden_by(edge.part(Part::Workspaces, &monitor.name), 0.0, HIDE_H), edge.switched(&monitor.name), edge.shown(&monitor.name) == 0.0)
|
||||
(edge::hidden_by(edge.part(Part::Workspaces, &monitor.name), 0.0, HIDE_H), edge::hidden_by(shown, 0.0, HIDE_H), edge.switched(&monitor.name), shown == 0.0)
|
||||
};
|
||||
|
||||
// special workspaces (scratchpads) aren't places to switch to
|
||||
@@ -180,11 +181,12 @@ pub fn view(monitor: &Monitor) -> LayerWindow {
|
||||
// clicks next to the pills reach the windows underneath
|
||||
let mut regions = vec![InputArea { x: LEFT as i32, y: TOP_GAP as i32, width: width.ceil() as i32, height: COMPACT_H as i32 }];
|
||||
|
||||
let mut pills: Vec<Box<dyn Widget>> = vec![Box::new(pill)];
|
||||
let mut pills: Vec<Box<dyn Widget>> = vec![Box::new(pill.translate(0.0, slide))];
|
||||
|
||||
// a peek keeps the workspaces in while the bar leaves: the tray slides away on its own
|
||||
if let Some((tray, tray_pill_w)) = tray {
|
||||
regions.push(InputArea { x: (LEFT + width + TRAY_GAP) as i32, y: TOP_GAP as i32, width: tray_pill_w.ceil() as i32, height: COMPACT_H as i32 });
|
||||
pills.push(Box::new(tray));
|
||||
pills.push(Box::new(tray.translate(0.0, tray_slide)));
|
||||
}
|
||||
|
||||
window.input_region(regions).child(
|
||||
@@ -193,7 +195,6 @@ pub fn view(monitor: &Monitor) -> LayerWindow {
|
||||
.height(Parent)
|
||||
.padding(Padding { top: TOP_GAP, right: 0.0, bottom: 0.0, left: LEFT })
|
||||
.align_child(Start, Start)
|
||||
.translate(0.0, slide)
|
||||
.child(Row::new(pills).gap(TRAY_GAP).align(Start)),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user