Revision: 6792
Author: ek.kato
Date: Fri Nov  5 06:33:12 2010
Log: * helper/toolbar-standalone-gtk.c
  - (button_press_event_cb) : Support GTK+-2.16 again.
  - (handle_expose_event_cb) : Ditto.
* helper/toolbar-common-gtk.c
  - (calc_menu_position) : Ditto.
* helper/eggtrayicon.c
  - (egg_tray_icon_expose) : Ditto.

http://code.google.com/p/uim/source/detail?r=6792

Modified:
 /trunk/helper/eggtrayicon.c
 /trunk/helper/toolbar-common-gtk.c
 /trunk/helper/toolbar-standalone-gtk.c

=======================================
--- /trunk/helper/eggtrayicon.c Sun Sep 12 20:28:15 2010
+++ /trunk/helper/eggtrayicon.c Fri Nov  5 06:33:12 2010
@@ -274,6 +274,7 @@
     retval = GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);

   focus_child = gtk_container_get_focus_child(GTK_CONTAINER (widget));
+#if GTK_CHECK_VERSION(2, 18, 0)
   if (focus_child && gtk_widget_has_focus (focus_child))
     {
       GtkAllocation allocation;
@@ -293,6 +294,23 @@
                        &event->area, widget, "tray_icon",
                        x, y, width, height);
     }
+#else
+  if (focus_child && GTK_WIDGET_HAS_FOCUS (focus_child))
+    {
+      border_width = GTK_CONTAINER (widget)->border_width;
+
+      x = widget->allocation.x + border_width;
+      y = widget->allocation.y + border_width;
+
+      width  = widget->allocation.width  - 2 * border_width;
+      height = widget->allocation.height - 2 * border_width;
+
+      gtk_paint_focus (widget->style, widget->window,
+                       GTK_WIDGET_STATE (widget),
+                       &event->area, widget, "tray_icon",
+                       x, y, width, height);
+    }
+#endif
   return retval;
 }

=======================================
--- /trunk/helper/toolbar-common-gtk.c  Sat Sep 11 17:42:28 2010
+++ /trunk/helper/toolbar-common-gtk.c  Fri Nov  5 06:33:12 2010
@@ -199,11 +199,16 @@
   gdk_window_get_origin(gtk_widget_get_window(button), x, y);
gdk_drawable_get_size(gtk_widget_get_window(button), NULL, &button_height);

+#if GTK_CHECK_VERSION(2, 18, 0)
   if (!gtk_widget_get_has_window(button)) {
     GtkAllocation allocation;
     gtk_widget_get_allocation(button, &allocation);
     *x += allocation.x;
   }
+#else
+  if (GTK_WIDGET_NO_WINDOW(button))
+    *x += button->allocation.x;
+#endif

   sc_height = gdk_screen_get_height(gdk_screen_get_default());
   sc_width = gdk_screen_get_width(gdk_screen_get_default());
=======================================
--- /trunk/helper/toolbar-standalone-gtk.c      Sun Sep 12 20:28:15 2010
+++ /trunk/helper/toolbar-standalone-gtk.c      Fri Nov  5 06:33:12 2010
@@ -90,7 +90,11 @@
     break;
   case GDK_2BUTTON_PRESS:
     toolbar = GTK_WIDGET(data);
+#if GTK_CHECK_VERSION(2, 18, 0)
     if (gtk_widget_get_visible(toolbar)) {
+#else
+    if (GTK_WIDGET_VISIBLE(toolbar)) {
+#endif
       gtk_window_get_size(GTK_WINDOW(widget), &width, &height);
       gtk_widget_hide(toolbar);
     } else {
@@ -172,6 +176,7 @@
 {
   GdkRectangle *rect = &event->area;

+#if GTK_CHECK_VERSION(2, 18, 0)
   GtkAllocation allocation;
   gtk_widget_get_allocation(widget, &allocation);
gtk_paint_handle(gtk_widget_get_style(widget), gtk_widget_get_window(widget),
@@ -180,6 +185,14 @@
                   allocation.x, allocation.y,
                   allocation.width, allocation.height,
                   GTK_ORIENTATION_VERTICAL);
+#else
+  gtk_paint_handle(widget->style, widget->window,
+                   GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+                   rect, widget, "handlebox",
+                   widget->allocation.x, widget->allocation.y,
+                   widget->allocation.width, widget->allocation.height,
+                   GTK_ORIENTATION_VERTICAL);
+#endif

   return FALSE;
 }

Reply via email to