Replies: 2 comments
-
Ended up using a layout with right-to-left alignment. Not really what I want but it works I suppose. egui::TopBottomPanel::bottom("bottom_panel").show(ctx, |ui| {
ui.horizontal(|ui| {
ui.horizontal(|ui| {
ui.spacing_mut().item_spacing.x = 0.0;
ui.label("Version: ");
ui.hyperlink_to(VERSION_STR, format!("{}/{}", VERSION_BASE_URL, VERSION_STR));
ui.add_space(6.0);
ui.separator();
ui.add_space(6.0);
ui.label("Author: ");
ui.hyperlink_to(AUTHOR_NAME, AUTHOR_URL);
ui.add_space(6.0);
ui.separator();
});
ui.with_layout(egui::Layout::right_to_left(), |ui| {
if ui.button("Documentation").on_hover_text(DOCS_URL).clicked() {
let modifiers = ui.ctx().input().modifiers;
ui.ctx().output().open_url = Some(egui::output::OpenUrl {
url: DOCS_URL.to_owned(),
new_tab: modifiers.any(),
});
}
if ui.button("Repository").on_hover_text(REPO_URL).clicked() {
let modifiers = ui.ctx().input().modifiers;
ui.ctx().output().open_url = Some(egui::output::OpenUrl {
url: REPO_URL.to_owned(),
new_tab: modifiers.any(),
});
}
});
});
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
I was looking for a way to right-align controls in a vertical layout.
I wonder if there is a better way. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here is the relevant snippet. I want the second layout to be aligned on the right, and I can't figure out how to do this.
Beta Was this translation helpful? Give feedback.
All reactions