ui/note: fix indented actionbar in non-wide mode
Some checks failed
CI / Rustfmt + Clippy (push) Has been cancelled
CI / Check (android) (push) Has been cancelled
CI / Test (Linux) (push) Has been cancelled
CI / Test (macOS) (push) Has been cancelled
CI / Test (Windows) (push) Has been cancelled
CI / rpm/deb (aarch64) (push) Has been cancelled
CI / rpm/deb (x86_64) (push) Has been cancelled
CI / macOS dmg (aarch64) (push) Has been cancelled
CI / macOS dmg (x86_64) (push) Has been cancelled
CI / Windows Installer (aarch64) (push) Has been cancelled
CI / Windows Installer (x86_64) (push) Has been cancelled
CI / Upload Artifacts to Server (push) Has been cancelled

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-07-29 13:58:17 -07:00
parent 2de6851fbd
commit 0fc8e70180

View File

@@ -454,7 +454,14 @@ impl<'a, 'd> NoteView<'a, 'd> {
note_action = contents.action.or(note_action);
if self.options().contains(NoteOptions::ActionBar) {
note_action = render_note_actionbar(
note_action = ui
.horizontal_wrapped(|ui| {
// NOTE(jb55): without this we get a weird artifact where
// there subsequent lines start sinking leftward off the screen.
// question: WTF? question 2: WHY?
ui.allocate_space(egui::vec2(0.0, 0.0));
render_note_actionbar(
ui,
get_zapper(
self.note_context.accounts,
@@ -466,6 +473,7 @@ impl<'a, 'd> NoteView<'a, 'd> {
note_key,
self.note_context.i18n,
)
})
.inner
.or(note_action);
}
@@ -531,7 +539,9 @@ impl<'a, 'd> NoteView<'a, 'd> {
note_action = contents.action.or(note_action);
if self.options().contains(NoteOptions::ActionBar) {
note_action = render_note_actionbar(
note_action = ui
.horizontal_wrapped(|ui| {
render_note_actionbar(
ui,
get_zapper(
self.note_context.accounts,
@@ -543,6 +553,7 @@ impl<'a, 'd> NoteView<'a, 'd> {
note_key,
self.note_context.i18n,
)
})
.inner
.or(note_action);
}
@@ -781,13 +792,7 @@ fn render_note_actionbar(
note_pubkey: &[u8; 32],
note_key: NoteKey,
i18n: &mut Localization,
) -> egui::InnerResponse<Option<NoteAction>> {
ui.horizontal(|ui| {
// NOTE(jb55): without this we get a weird artifact where
// there subsequent lines start sinking leftward off the screen.
// question: WTF? question 2: WHY?
ui.allocate_space(egui::vec2(0.0, 0.0));
) -> Option<NoteAction> {
ui.set_min_height(26.0);
ui.spacing_mut().item_spacing.x = 24.0;
@@ -830,8 +835,7 @@ fn render_note_actionbar(
match zap_state {
Ok(any_zap_state) => ui.add(zap_button(i18n, any_zap_state, note_id)),
Err(err) => {
let (rect, _) =
ui.allocate_at_least(egui::vec2(10.0, 10.0), egui::Sense::click());
let (rect, _) = ui.allocate_at_least(egui::vec2(10.0, 10.0), egui::Sense::click());
ui.add(x_button(rect)).on_hover_text(err.to_string())
}
}
@@ -850,7 +854,6 @@ fn render_note_actionbar(
target,
specified_msats: None,
})))
})
}
#[profiling::function]