~alextee/zrythm-devel

Popover menu position fix on bottom bar v1 SUPERSEDED

Robert Panovics: 1
 Popover menu position fix on bottom bar

 1 files changed, 30 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~alextee/zrythm-devel/patches/31084/mbox | git am -3
Learn more about email & git

[PATCH] Popover menu position fix on bottom bar Export this patch

Reparenting of popover menu for transport playhead and
BPM for positioning

Fixes https://todo.sr.ht/~alextee/zrythm-bug/860

Signed-off-by: Robert Panovics <robert.panovics@gmail.com>
---
 src/gui/widgets/bot_bar.c | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/src/gui/widgets/bot_bar.c b/src/gui/widgets/bot_bar.c
index dc3cec839..fd41fd89b 100644
--- a/src/gui/widgets/bot_bar.c
+++ b/src/gui/widgets/bot_bar.c
@@ -125,6 +125,18 @@ activate_jack_mode (
}
#endif

static void
popover_menu_set_parent (
  GtkWidget *      parent,
  GtkPopoverMenu * self)
{
  GtkWidget * ref =
    g_object_ref (GTK_WIDGET (self));
  gtk_widget_unparent (ref);
  gtk_widget_set_parent (GTK_WIDGET (ref), parent);
  g_object_unref (ref);
}

static void
on_bpm_right_click (
  GtkGestureClick * gesture,
@@ -147,8 +159,16 @@ on_bpm_right_click (
    _ ("Tap"), NULL, "app.tap-bpm");
  g_menu_append_item (menu, menuitem);

  popover_menu_set_parent (
    GTK_WIDGET (self->digital_bpm),
    self->popover_menu);

  z_gtk_show_context_menu_from_g_menu (
    self->popover_menu, x, y, menu);
    self->popover_menu,
    gtk_widget_get_allocated_width (
      GTK_WIDGET (self->digital_bpm))
      / 2.0,
    0.0, menu);
}

static void
@@ -217,8 +237,16 @@ on_transport_playhead_right_click (
    GTK_WIDGET (self), "bot-bar",
    G_ACTION_GROUP (action_group));

  popover_menu_set_parent (
    GTK_WIDGET (self->digital_transport),
    self->popover_menu);

  z_gtk_show_context_menu_from_g_menu (
    self->popover_menu, x, y, menu);
    self->popover_menu,
    gtk_widget_get_allocated_width (
      GTK_WIDGET (self->digital_transport))
      / 2.0,
    0.0, menu);
}

void
-- 
2.35.1
Thanks! I think this needs changes/refactoring.

2022-04-13 (水) の 21:00 +0200 に Robert Panovics さんは書きました: