~ubuntu-branches/ubuntu/quantal/gnumeric/quantal

« back to all changes in this revision

Viewing changes to src/item-bar.c

  • Committer: Bazaar Package Importer
  • Author(s): Gauvain Pocentek
  • Date: 2009-06-07 11:10:47 UTC
  • mfrom: (1.1.19 upstream) (2.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090607111047-l3rtbzfjxvmi1kx0
Tags: 1.9.8-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Promoted gnumeric-doc to Recommends in gnumeric package for help to be
    installed automatically
  - gnumeric-gtk is a transitional package
  - gnumeric conflicts with gnumeric-gtk << 1.8.3-3ubuntu1
  - call initltool-update in po*
  - remove psiconv support (psiconv is in universe):
    o debian/control: remove B-D on libpsiconv-dev
    o debian/rules: don't pass --with-psiconv to ./configure

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "sheet-control-gui-priv.h"
20
20
#include "application.h"
21
21
#include "selection.h"
22
 
#include "wbc-gtk.h"
 
22
#include "wbc-gtk-impl.h"
23
23
#include "gui-util.h"
24
24
#include "parse-util.h"
25
25
#include "commands.h"
26
26
 
27
27
#include <gsf/gsf-impl-utils.h>
28
 
#include <gtk/gtklabel.h>
 
28
#include <gtk/gtk.h>
29
29
#define GNUMERIC_ITEM "BAR"
30
30
#include "item-debug.h"
31
31
 
147
147
 
148
148
        /* 5 pixels left and right plus the width of the widest string I can think of */
149
149
        if (char_label)
150
 
                pango_layout_set_text (layout, "WWWWWWWWWW", strlen (col_name (gnm_sheet_get_max_cols (sheet) - 1)));
 
150
                pango_layout_set_text (layout, "WWWWWWWWWW", strlen (col_name (gnm_sheet_get_last_col (sheet))));
151
151
        else
152
 
                pango_layout_set_text (layout, "8888888888", strlen (row_name (gnm_sheet_get_max_rows (sheet) - 1)));
 
152
                pango_layout_set_text (layout, "8888888888", strlen (row_name (gnm_sheet_get_last_row (sheet))));
153
153
        pango_layout_get_extents (layout, NULL, &logical_rect);
154
154
        ib->cell_width = 5 + 5 + PANGO_PIXELS (logical_rect.width);
155
155
 
298
298
 
299
299
        gdk_draw_rectangle (drawable, gc, TRUE,
300
300
                rect->x + 1, rect->y + 1, rect->width - 1, rect->height - 1);
 
301
 
 
302
        /* The widget parameters could be NULL, but if so some themes would emit a warning.
 
303
         * (Murrine is known to do this: http://bugzilla.gnome.org/show_bug.cgi?id=564410). */
301
304
        gtk_paint_shadow (canvas->style, drawable, GTK_STATE_NORMAL, shadow,
302
 
                          NULL, NULL, "GnmItemBarCell",
 
305
                          NULL, canvas, "GnmItemBarCell",
303
306
                          rect->x, rect->y, rect->width + 1, rect->height + 1);
304
307
 
305
308
        g_return_if_fail (font != NULL);
338
341
        int prev_level;
339
342
        GdkRectangle rect;
340
343
        GdkPoint points[3];
341
 
        gboolean const has_object = scg->new_object != NULL || scg->selected_objects != NULL;
 
344
        gboolean const has_object = scg->wbcg->new_object != NULL || scg->selected_objects != NULL;
342
345
        gboolean const rtl = sheet->text_is_rtl != FALSE;
343
346
        int shadow;
344
347
        int first_line_offset = 1;
961
964
                        ib->colrow_resize_size = cri->size_pixels;
962
965
 
963
966
                        if (ib->tip == NULL) {
964
 
                                ib->tip = gnumeric_create_tooltip ();
 
967
                                GtkWidget *cw = GTK_WIDGET (canvas);
 
968
                                GdkWindow *cbw = GTK_LAYOUT (canvas)->bin_window;
 
969
                                int wx, wy;
 
970
                                gdk_window_get_origin (cbw, &wx, &wy);
 
971
                                ib->tip = gnumeric_create_tooltip (cw);
965
972
                                colrow_tip_setlabel (ib, is_cols, ib->colrow_resize_size);
966
973
                                /* Position above the current point for both
967
974
                                 * col and row headers.  trying to put it
969
976
                                 * the tip under the cursor which can have odd
970
977
                                 * effects on the event stream.  win32 was
971
978
                                 * different from X. */
972
 
                                gnumeric_position_tooltip (ib->tip, TRUE);
 
979
                                gnumeric_position_tooltip (ib->tip,
 
980
                                                           wx + e->button.x,
 
981
                                                           wy + e->button.y,
 
982
                                                           TRUE);
973
983
                                gtk_widget_show_all (gtk_widget_get_toplevel (ib->tip));
974
984
                        }
975
985
                } else {
1133
1143
 
1134
1144
GSF_CLASS (ItemBar, item_bar,
1135
1145
           item_bar_class_init, item_bar_init,
1136
 
           FOO_TYPE_CANVAS_ITEM);
 
1146
           FOO_TYPE_CANVAS_ITEM)