layout/monitor: Make between-workspace insert hint narrower
Browse files at this commite5d4e7c1b1a0b61770b6711a53fe41920d56452dParent: e420bb51 changed file +7 -3
- src/layout/monitor.rs +7 -3
src/layout/monitor.rsmodified+7 -3
| @@ -1152,11 +1152,15 @@ impl<W: LayoutElement> Monitor<W> { | |||
| 1152 | let hint_height = gap - hint_gap * 2.; | 1152 | let hint_height = gap - hint_gap * 2.; |
| 1153 | 1153 | ||
| 1154 | let next_ws_geo = self.workspaces_render_geo().nth(ws_idx).unwrap(); | 1154 | let next_ws_geo = self.workspaces_render_geo().nth(ws_idx).unwrap(); |
| 1155 | - let hint_loc_diff = Point::from((0., hint_height + hint_gap)); | 1155 | + let hint_width = round_logical_in_physical(scale, next_ws_geo.size.w * 0.75); |
| 1156 | + let hint_x = | ||
| 1157 | + round_logical_in_physical(scale, (next_ws_geo.size.w - hint_width) / 2.); | ||
| 1158 | + | ||
| 1159 | + let hint_loc_diff = Point::from((-hint_x, hint_height + hint_gap)); | ||
| 1156 | let hint_loc = next_ws_geo.loc - hint_loc_diff; | 1160 | let hint_loc = next_ws_geo.loc - hint_loc_diff; |
| 1157 | - let hint_size = Size::from((next_ws_geo.size.w, hint_height)); | 1161 | + let hint_size = Size::from((hint_width, hint_height)); |
| 1158 | 1162 | ||
| 1159 | - // FIXME: sometimes the hint ends up 1 px wider than necessary and/or 1 px | 1163 | + // Sometimes the hint ends up 1 px wider than necessary and/or 1 px |
| 1160 | // narrower than necessary. The values here seem correct. Might have to do with | 1164 | // narrower than necessary. The values here seem correct. Might have to do with |
| 1161 | // how zooming out currently doesn't round to output scale properly. | 1165 | // how zooming out currently doesn't round to output scale properly. |
| 1162 | 1166 | ||