summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkdisplaypanel.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-12-20 22:12:28 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-12-20 22:12:28 (GMT)
commitcffbe4839da452af215f05dfb7cc6c9304c1285e (patch)
treed2ea78b67592e868ed94ab189722670379cd2b67 /src/gtkext/gtkdisplaypanel.c
parent0f58e137ff493ab38d2a7e6e2d5e5bc85951be3d (diff)
Kept the current location when switching views.
Diffstat (limited to 'src/gtkext/gtkdisplaypanel.c')
-rw-r--r--src/gtkext/gtkdisplaypanel.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/gtkext/gtkdisplaypanel.c b/src/gtkext/gtkdisplaypanel.c
index 3623ced..93e47e7 100644
--- a/src/gtkext/gtkdisplaypanel.c
+++ b/src/gtkext/gtkdisplaypanel.c
@@ -887,6 +887,33 @@ const vmpa2t *gtk_display_panel_get_caret_location(const GtkDisplayPanel *panel)
/******************************************************************************
* *
+* Paramètres : panel = composant GTK à consulter. *
+* cursor = emplacement à présenter à l'écran. *
+* x = position horizontale au sein du composant. [OUT] *
+* y = position verticale au sein du composant. [OUT] *
+* tweak = adaptation finale à effectuer. *
+* *
+* Description : Indique la position d'affichage d'un emplacement donné. *
+* *
+* Retour : true si l'adresse fait partie du composant, false sinon. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool gtk_display_panel_get_cursor_coordinates(const GtkDisplayPanel *panel, const GLineCursor *cursor, gint *x, gint *y, ScrollPositionTweak tweak)
+{
+ bool result; /* Bilan à remonter */
+
+ result = GTK_DISPLAY_PANEL_GET_CLASS(panel)->get_coordinates(panel, cursor, x, y, tweak);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : panel = composant GTK à consulter. *
* *
* Description : Fournit l'élément actif lié à la position courante. *
@@ -1182,7 +1209,7 @@ static void gtk_display_panel_scroll_to_cursor(GtkDisplayPanel *panel, const GLi
GTK_DISPLAY_PANEL_GET_CLASS(panel)->define(panel, addr);
*/
- if (GTK_DISPLAY_PANEL_GET_CLASS(panel)->get_coordinates(panel, cursor, &x, &y, tweak))
+ if (gtk_display_panel_get_cursor_coordinates(panel, cursor, &x, &y, tweak))
{
viewport = gtk_widget_get_parent(GTK_WIDGET(panel));
@@ -1216,7 +1243,7 @@ static void gtk_display_panel_scroll_to_cursor(GtkDisplayPanel *panel, const GLi
/* Déplacement du curseur */
- if (move && GTK_DISPLAY_PANEL_GET_CLASS(panel)->get_coordinates(panel, cursor, &x, &y, SPT_RAW))
+ if (move && gtk_display_panel_get_cursor_coordinates(panel, cursor, &x, &y, SPT_RAW))
GTK_DISPLAY_PANEL_GET_CLASS(panel)->move_caret_to(panel, x, y);
}