[gnumeric] fix input message display for rtl sheets 2013-08-04 Andreas J. Guelzow <aguelzow pyrshep ca>



commit 0168c4c484cabc8becef0a118dfb9ea879090391
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Sun Aug 4 23:25:18 2013 -0600

    fix input message display for rtl sheets
    2013-08-04  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * src/sheet-control-gui.c (scg_show_im_tooltip): handle rtl sheets

 ChangeLog               |    4 ++++
 src/sheet-control-gui.c |    8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3dbc1bc..25915ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2013-08-04  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+       * src/sheet-control-gui.c (scg_show_im_tooltip): handle rtl sheets
+
+2013-08-04  Andreas J. Guelzow <aguelzow pyrshep ca>
+
        * src/sheet-control-gui-priv.h (_SheetControlGUI): add fields
        * src/sheet-control-gui.c (scg_init): init new fields
        (scg_im_destroy): new
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index d6aac39..5ae5328 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -3729,6 +3729,8 @@ scg_show_im_tooltip (SheetControl *sc, GnmInputMsg *im, GnmCellPos *pos)
                int len_text, len_title;
                int x, y, x_origin, y_origin;
                GtkAllocation allocation;
+               Sheet *sheet = scg_sheet (scg);
+               gboolean rtl = sheet->text_is_rtl;
        
                text = gnm_input_msg_get_msg   (im);
                title = gnm_input_msg_get_title (im);
@@ -3769,12 +3771,14 @@ scg_show_im_tooltip (SheetControl *sc, GnmInputMsg *im, GnmCellPos *pos)
                scg->im.item = gtk_widget_get_toplevel (box);
 
                x = sheet_col_get_distance_pixels
-                       (scg_sheet (scg), pane->first.col, pos->col + 1);
+                       (sheet, pane->first.col, pos->col + (rtl ? 1 : 0));
                
                y = sheet_row_get_distance_pixels
-                       (scg_sheet (scg), pane->first.row, pos->row + 1);
+                       (sheet, pane->first.row, pos->row + 1);
 
                gtk_widget_get_allocation (GTK_WIDGET (pane), &allocation);
+               if (rtl)
+                       x = allocation.width - x;
                x += allocation.x;
                y += allocation.y;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]