diff options
author | Michael Lauer <mickey@vanille-media.de> | 2007-08-23 12:00:56 +0000 |
---|---|---|
committer | Michael Lauer <mickey@vanille-media.de> | 2007-08-23 12:00:56 +0000 |
commit | 5514dd4b36332c42cd1c988abf8be2be3420cb91 (patch) | |
tree | 03759795a9a949b2bfbd7e870cf811647bb9d16c /packages | |
parent | 6bdbaa08e091bcd74a1ceab5a188dd90917c6d32 (diff) |
gtk+ 2.10.14: add updated versions of cell-renderer and treeview-checkbox patches
Diffstat (limited to 'packages')
-rw-r--r-- | packages/gtk+/gtk+-2.10.14/cell-renderer-edit-focus.patch | 30 | ||||
-rw-r--r-- | packages/gtk+/gtk+-2.10.14/treeview-checkbox-size.patch | 100 | ||||
-rw-r--r-- | packages/gtk+/gtk+_2.10.14.bb | 8 |
3 files changed, 135 insertions, 3 deletions
diff --git a/packages/gtk+/gtk+-2.10.14/cell-renderer-edit-focus.patch b/packages/gtk+/gtk+-2.10.14/cell-renderer-edit-focus.patch new file mode 100644 index 0000000000..aa7e276bec --- /dev/null +++ b/packages/gtk+/gtk+-2.10.14/cell-renderer-edit-focus.patch @@ -0,0 +1,30 @@ +Index: gtk/gtkcellrenderertext.c +=================================================================== +--- gtk/gtkcellrenderertext.c (revision 18557) ++++ gtk/gtkcellrenderertext.c (working copy) +@@ -1794,13 +1794,24 @@ gtk_cell_renderer_text_focus_out_event ( + gpointer data) + { + GtkCellRendererTextPrivate *priv; ++ GtkSettings *settings; ++ gboolean in_touchscreen_mode = FALSE; + + priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (data); + + if (priv->in_entry_menu) + return FALSE; + +- GTK_ENTRY (entry)->editing_canceled = TRUE; ++ if (gtk_widget_has_screen (entry)) ++ settings = gtk_settings_get_for_screen (gtk_widget_get_screen (entry)); ++ else ++ settings = gtk_settings_get_default (); ++ ++ g_object_get (G_OBJECT (settings), ++ "gtk-touchscreen-mode", &in_touchscreen_mode, ++ NULL); ++ ++ GTK_ENTRY (entry)->editing_canceled = !in_touchscreen_mode; + gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (entry)); + gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (entry)); + diff --git a/packages/gtk+/gtk+-2.10.14/treeview-checkbox-size.patch b/packages/gtk+/gtk+-2.10.14/treeview-checkbox-size.patch new file mode 100644 index 0000000000..ab3c208ee5 --- /dev/null +++ b/packages/gtk+/gtk+-2.10.14/treeview-checkbox-size.patch @@ -0,0 +1,100 @@ +Index: gtk/gtkcellrenderertoggle.c +=================================================================== +--- gtk/gtkcellrenderertoggle.c (revision 18523) ++++ gtk/gtkcellrenderertoggle.c (working copy) +@@ -71,6 +71,8 @@ + PROP_INDICATOR_SIZE + }; + ++/* This is a hard-coded default which promptly gets overridden by a size ++ calculated from the font size. */ + #define TOGGLE_WIDTH 12 + + static guint toggle_cell_signals[LAST_SIGNAL] = { 0 }; +@@ -80,8 +82,9 @@ + typedef struct _GtkCellRendererTogglePrivate GtkCellRendererTogglePrivate; + struct _GtkCellRendererTogglePrivate + { +- gint indicator_size; +- ++ gint indicator_size; /* This is the real size */ ++ gint override_size; /* This is the size set from the indicator-size property */ ++ GtkWidget *cached_widget; + guint inconsistent : 1; + }; + +@@ -104,6 +107,7 @@ + GTK_CELL_RENDERER (celltoggle)->ypad = 2; + + priv->indicator_size = TOGGLE_WIDTH; ++ priv->override_size = 0; + priv->inconsistent = FALSE; + } + +@@ -210,7 +214,7 @@ + g_value_set_boolean (value, celltoggle->radio); + break; + case PROP_INDICATOR_SIZE: +- g_value_set_int (value, priv->indicator_size); ++ g_value_set_int (value, priv->override_size ? priv->override_size : priv->indicator_size); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); +@@ -245,7 +249,7 @@ + celltoggle->radio = g_value_get_boolean (value); + break; + case PROP_INDICATOR_SIZE: +- priv->indicator_size = g_value_get_int (value); ++ priv->override_size = g_value_get_int (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); +@@ -273,6 +277,27 @@ + } + + static void ++on_widget_style_set (GtkWidget *widget, GtkStyle *previous, gpointer user_data) ++{ ++ GtkCellRendererTogglePrivate *priv = user_data; ++ PangoContext *context; ++ PangoFontMetrics *metrics; ++ int height; ++ ++ context = gtk_widget_get_pango_context (widget); ++ metrics = pango_context_get_metrics (context, ++ widget->style->font_desc, ++ pango_context_get_language (context)); ++ ++ height = pango_font_metrics_get_ascent (metrics) + ++ pango_font_metrics_get_descent (metrics); ++ ++ pango_font_metrics_unref (metrics); ++ ++ priv->indicator_size = PANGO_PIXELS (height * 0.85); ++} ++ ++static void + gtk_cell_renderer_toggle_get_size (GtkCellRenderer *cell, + GtkWidget *widget, + GdkRectangle *cell_area, +@@ -287,6 +312,20 @@ + + priv = GTK_CELL_RENDERER_TOGGLE_GET_PRIVATE (cell); + ++ if (priv->override_size) { ++ priv->indicator_size = priv->override_size; ++ } else if (priv->cached_widget != widget) { ++ if (priv->cached_widget) { ++ g_object_remove_weak_pointer (G_OBJECT (widget), (gpointer*)&priv->cached_widget); ++ g_signal_handlers_disconnect_by_func (priv->cached_widget, on_widget_style_set, priv); ++ } ++ priv->cached_widget = widget; ++ g_object_add_weak_pointer (G_OBJECT (widget), (gpointer*)&priv->cached_widget); ++ g_signal_connect (widget, "style-set", G_CALLBACK (on_widget_style_set), priv); ++ ++ on_widget_style_set (widget, NULL, priv); ++ } ++ + calc_width = (gint) cell->xpad * 2 + priv->indicator_size; + calc_height = (gint) cell->ypad * 2 + priv->indicator_size; + diff --git a/packages/gtk+/gtk+_2.10.14.bb b/packages/gtk+/gtk+_2.10.14.bb index ecee0bf91a..947cf19077 100644 --- a/packages/gtk+/gtk+_2.10.14.bb +++ b/packages/gtk+/gtk+_2.10.14.bb @@ -1,6 +1,6 @@ require gtk-2.10.inc -PR = "r5" +PR = "r6" SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.10/gtk+-${PV}.tar.bz2 \ file://no-xwc.patch;patch=1 \ @@ -19,19 +19,21 @@ SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.10/gtk+-${PV}.tar.bz2 \ file://spinbutton.patch;patch=1 \ file://gtk+-handhelds.patch;patch=1 \ file://filesel-fix-segfault.patch;patch=1 \ - file://toggle-font.diff;patch=1;pnum=0 \ file://combo-arrow-size.patch;patch=1;pnum=0 \ file://range-no-redraw.patch;patch=1;pnum=0 \ file://scrolled-placement.patch;patch=1;pnum=0 \ + file://treeview-checkbox-size.patch;patch=1;pnum=0 \ + file://cell-renderer-edit-focus.patch;patch=1;pnum=0 \ " -#check for TARGET_FPU=soft and inform configure of the result so it can disable some floating points +# check for TARGET_FPU=soft and inform configure of the result so it can disable some floating points require gtk-fpu.inc EXTRA_OECONF += "${@get_gtk_fpu_setting(bb, d)}" # try to squeeze some more performance out of it SRC_URI_append_fic-gta01 = " file://lower-quality-scaling-in-pixbuf-engine.patch;patch=1" SRC_URI_append_fic-gta02 = " file://lower-quality-scaling-in-pixbuf-engine.patch;patch=1" + # this doesn't seem to work SRC_URI_OVERRIDES_PACKAGE_ARCH = "1" # let's do it manually then |