tiling: Never render pill indicators in keyboard mode
This commit is contained in:
parent
86c3e00dfd
commit
bd276a2f23
1 changed files with 113 additions and 105 deletions
|
|
@ -3127,66 +3127,68 @@ where
|
||||||
|
|
||||||
geometries.insert(node_id.clone(), geo);
|
geometries.insert(node_id.clone(), geo);
|
||||||
|
|
||||||
if let Some(PillIndicator::Outer(direction)) = pill_indicator {
|
if mouse_tiling.is_some() {
|
||||||
let (pill_geo, remaining_geo) = match direction {
|
if let Some(PillIndicator::Outer(direction)) = pill_indicator {
|
||||||
Direction::Left => (
|
let (pill_geo, remaining_geo) = match direction {
|
||||||
Rectangle::from_loc_and_size(
|
Direction::Left => (
|
||||||
(geo.loc.x + 32, geo.loc.y + 32),
|
Rectangle::from_loc_and_size(
|
||||||
(16, geo.size.h - 64),
|
(geo.loc.x + 32, geo.loc.y + 32),
|
||||||
|
(16, geo.size.h - 64),
|
||||||
|
),
|
||||||
|
Rectangle::from_loc_and_size(
|
||||||
|
(geo.loc.x + 48, geo.loc.y),
|
||||||
|
(geo.size.w - 48, geo.size.h),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Rectangle::from_loc_and_size(
|
Direction::Up => (
|
||||||
(geo.loc.x + 48, geo.loc.y),
|
Rectangle::from_loc_and_size(
|
||||||
(geo.size.w - 48, geo.size.h),
|
(geo.loc.x + 32, geo.loc.y + 32),
|
||||||
|
(geo.size.w - 64, 16),
|
||||||
|
),
|
||||||
|
Rectangle::from_loc_and_size(
|
||||||
|
(geo.loc.x, geo.loc.y + 48),
|
||||||
|
(geo.size.w, geo.size.h - 48),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Direction::Right => (
|
||||||
Direction::Up => (
|
Rectangle::from_loc_and_size(
|
||||||
Rectangle::from_loc_and_size(
|
(geo.loc.x + geo.size.w - 48, geo.loc.y + 32),
|
||||||
(geo.loc.x + 32, geo.loc.y + 32),
|
(16, geo.size.h - 64),
|
||||||
(geo.size.w - 64, 16),
|
),
|
||||||
|
Rectangle::from_loc_and_size(
|
||||||
|
geo.loc,
|
||||||
|
(geo.size.w - 48, geo.size.h),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Rectangle::from_loc_and_size(
|
Direction::Down => (
|
||||||
(geo.loc.x, geo.loc.y + 48),
|
Rectangle::from_loc_and_size(
|
||||||
(geo.size.w, geo.size.h - 48),
|
(geo.loc.x + 32, geo.loc.y + geo.size.h - 48),
|
||||||
|
(geo.size.w - 64, 16),
|
||||||
|
),
|
||||||
|
Rectangle::from_loc_and_size(
|
||||||
|
geo.loc,
|
||||||
|
(geo.size.w, geo.size.h - 48),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
};
|
||||||
Direction::Right => (
|
|
||||||
Rectangle::from_loc_and_size(
|
if let Some(renderer) = renderer.as_mut() {
|
||||||
(geo.loc.x + geo.size.w - 48, geo.loc.y + 32),
|
elements.push(
|
||||||
(16, geo.size.h - 64),
|
BackdropShader::element(
|
||||||
),
|
*renderer,
|
||||||
Rectangle::from_loc_and_size(
|
placeholder_id.clone(),
|
||||||
geo.loc,
|
pill_geo,
|
||||||
(geo.size.w - 48, geo.size.h),
|
8.,
|
||||||
),
|
alpha * 0.4,
|
||||||
),
|
GROUP_COLOR,
|
||||||
Direction::Down => (
|
)
|
||||||
Rectangle::from_loc_and_size(
|
.into(),
|
||||||
(geo.loc.x + 32, geo.loc.y + geo.size.h - 48),
|
);
|
||||||
(geo.size.w - 64, 16),
|
}
|
||||||
),
|
|
||||||
Rectangle::from_loc_and_size(
|
geo = remaining_geo;
|
||||||
geo.loc,
|
|
||||||
(geo.size.w, geo.size.h - 48),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
|
}
|
||||||
if let Some(renderer) = renderer.as_mut() {
|
|
||||||
elements.push(
|
|
||||||
BackdropShader::element(
|
|
||||||
*renderer,
|
|
||||||
placeholder_id.clone(),
|
|
||||||
pill_geo,
|
|
||||||
8.,
|
|
||||||
alpha * 0.4,
|
|
||||||
GROUP_COLOR,
|
|
||||||
)
|
|
||||||
.into(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
geo = remaining_geo;
|
|
||||||
};
|
|
||||||
|
|
||||||
if !is_placeholder_group {
|
if !is_placeholder_group {
|
||||||
geo.loc += (outer_gap, outer_gap).into();
|
geo.loc += (outer_gap, outer_gap).into();
|
||||||
|
|
@ -3223,33 +3225,36 @@ where
|
||||||
(geo.loc.x, geo.loc.y + previous),
|
(geo.loc.x, geo.loc.y + previous),
|
||||||
(geo.size.w, *size),
|
(geo.size.w, *size),
|
||||||
);
|
);
|
||||||
if let Some(PillIndicator::Inner(pill_idx)) = pill_indicator {
|
if mouse_tiling.is_some() {
|
||||||
if *pill_idx == idx {
|
if let Some(PillIndicator::Inner(pill_idx)) = pill_indicator
|
||||||
geo.size.h -= 16;
|
|
||||||
}
|
|
||||||
if idx
|
|
||||||
.checked_sub(1)
|
|
||||||
.map(|idx| idx == *pill_idx)
|
|
||||||
.unwrap_or(false)
|
|
||||||
{
|
{
|
||||||
if let Some(renderer) = renderer.as_mut() {
|
if *pill_idx == idx {
|
||||||
elements.push(
|
geo.size.h -= 16;
|
||||||
BackdropShader::element(
|
}
|
||||||
*renderer,
|
if idx
|
||||||
placeholder_id.clone(),
|
.checked_sub(1)
|
||||||
Rectangle::from_loc_and_size(
|
.map(|idx| idx == *pill_idx)
|
||||||
(geo.loc.x + 32, geo.loc.y - 8),
|
.unwrap_or(false)
|
||||||
(geo.size.w - 64, 16),
|
{
|
||||||
),
|
if let Some(renderer) = renderer.as_mut() {
|
||||||
8.,
|
elements.push(
|
||||||
alpha * 0.4,
|
BackdropShader::element(
|
||||||
GROUP_COLOR,
|
*renderer,
|
||||||
)
|
placeholder_id.clone(),
|
||||||
.into(),
|
Rectangle::from_loc_and_size(
|
||||||
);
|
(geo.loc.x + 32, geo.loc.y - 8),
|
||||||
|
(geo.size.w - 64, 16),
|
||||||
|
),
|
||||||
|
8.,
|
||||||
|
alpha * 0.4,
|
||||||
|
GROUP_COLOR,
|
||||||
|
)
|
||||||
|
.into(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
geo.loc.y += 16;
|
||||||
|
geo.size.h -= 16;
|
||||||
}
|
}
|
||||||
geo.loc.y += 16;
|
|
||||||
geo.size.h -= 16;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stack.push(geo);
|
stack.push(geo);
|
||||||
|
|
@ -3263,33 +3268,36 @@ where
|
||||||
(geo.loc.x + previous, geo.loc.y),
|
(geo.loc.x + previous, geo.loc.y),
|
||||||
(*size, geo.size.h),
|
(*size, geo.size.h),
|
||||||
);
|
);
|
||||||
if let Some(PillIndicator::Inner(pill_idx)) = pill_indicator {
|
if mouse_tiling.is_some() {
|
||||||
if *pill_idx == idx {
|
if let Some(PillIndicator::Inner(pill_idx)) = pill_indicator
|
||||||
geo.size.w -= 16;
|
|
||||||
}
|
|
||||||
if idx
|
|
||||||
.checked_sub(1)
|
|
||||||
.map(|idx| idx == *pill_idx)
|
|
||||||
.unwrap_or(false)
|
|
||||||
{
|
{
|
||||||
if let Some(renderer) = renderer.as_mut() {
|
if *pill_idx == idx {
|
||||||
elements.push(
|
geo.size.w -= 16;
|
||||||
BackdropShader::element(
|
}
|
||||||
*renderer,
|
if idx
|
||||||
placeholder_id.clone(),
|
.checked_sub(1)
|
||||||
Rectangle::from_loc_and_size(
|
.map(|idx| idx == *pill_idx)
|
||||||
(geo.loc.x - 8, geo.loc.y + 32),
|
.unwrap_or(false)
|
||||||
(16, geo.size.h - 64),
|
{
|
||||||
),
|
if let Some(renderer) = renderer.as_mut() {
|
||||||
8.,
|
elements.push(
|
||||||
alpha * 0.4,
|
BackdropShader::element(
|
||||||
GROUP_COLOR,
|
*renderer,
|
||||||
)
|
placeholder_id.clone(),
|
||||||
.into(),
|
Rectangle::from_loc_and_size(
|
||||||
);
|
(geo.loc.x - 8, geo.loc.y + 32),
|
||||||
|
(16, geo.size.h - 64),
|
||||||
|
),
|
||||||
|
8.,
|
||||||
|
alpha * 0.4,
|
||||||
|
GROUP_COLOR,
|
||||||
|
)
|
||||||
|
.into(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
geo.loc.x += 16;
|
||||||
|
geo.size.w -= 16;
|
||||||
}
|
}
|
||||||
geo.loc.x += 16;
|
|
||||||
geo.size.w -= 16;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stack.push(geo);
|
stack.push(geo);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue