Skip to content

Commit

Permalink
content_insets fixup: consider menu height
Browse files Browse the repository at this point in the history
Signed-off-by: Dietmar Maurer <[email protected]>
  • Loading branch information
maurerdietmar committed Jan 17, 2022
1 parent c8bc5fe commit 401742c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion druid-shell/src/backend/gtk/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,13 +1021,14 @@ impl WindowHandle {
let scale = state.scale.get();
let (width_px, height_px) = state.window.size();
let alloc_px = state.drawing_area.allocation();
let menu_height_px = height_px - alloc_px.height;

if let Some(window) = state.window.window() {
let frame = window.frame_extents();
let (pos_x, pos_y) = window.position();
Insets::new(
(pos_x - frame.x) as f64,
(pos_y - frame.y) as f64,
(pos_y - frame.y + menu_height_px) as f64,
(frame.x + frame.width - (pos_x + width_px)) as f64,
(frame.y + frame.height - (pos_y + height_px)) as f64,
)
Expand Down

0 comments on commit 401742c

Please sign in to comment.