From f4a766ea9dc2cfa3a21a1729a9532e22fbcb4ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Mon, 22 Apr 2024 21:14:10 +0200 Subject: [PATCH] clapper-gtk: seek-bar: Fix marker popover position on RTL On RTL we need to subtract position from upper scale value to end up at correct coordinates --- src/lib/clapper-gtk/clapper-gtk-seek-bar.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/clapper-gtk/clapper-gtk-seek-bar.c b/src/lib/clapper-gtk/clapper-gtk-seek-bar.c index 6afdbf99..8c14e16a 100644 --- a/src/lib/clapper-gtk/clapper-gtk-seek-bar.c +++ b/src/lib/clapper-gtk/clapper-gtk-seek-bar.c @@ -248,6 +248,9 @@ scale_value_changed_cb (GtkRange *range, ClapperGtkSeekBar *self) x = min_pointing_val + (value / scaling); + if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) + x = max_pointing_val + min_pointing_val - x; + if (_prepare_popover (self, x, value, upper)) gtk_popover_popup (self->popover); else @@ -346,6 +349,10 @@ motion_cb (GtkEventControllerMotion *motion, scaling = (upper / (max_pointing_val - min_pointing_val)); pointing_val = (x - min_pointing_val) * scaling; + + if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) + pointing_val = upper - pointing_val; + GST_LOG ("Cursor pointing to: %lf", pointing_val); if (_prepare_popover (self, x, pointing_val, upper))