1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 22:00:03 -04:00

Add clock in top right corner using reverse layout in menu bar

This commit is contained in:
Emil Ernerfeldt
2020-05-13 22:56:37 +02:00
parent cd1bbddaca
commit 152e644fb2
4 changed files with 41 additions and 10 deletions

View File

@@ -31,7 +31,9 @@ pub fn bar(ui: &mut Ui, add_contents: impl FnOnce(&mut Ui)) -> InteractInfo {
ui.set_style(style);
// Take full width and fixed height:
ui.expand_to_size(vec2(ui.available().width(), ui.style().menu_bar.height));
let height = ui.style().menu_bar.height;
ui.set_desired_height(height);
ui.expand_to_size(vec2(ui.available().width(), height));
add_contents(ui)
})
})