gtk+-handhelds.patch 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. Index: gtk+-2.10.6/gtk/gtkarrow.c
  2. ===================================================================
  3. --- gtk+-2.10.6.orig/gtk/gtkarrow.c 2006-05-14 05:25:28.000000000 +0100
  4. +++ gtk+-2.10.6/gtk/gtkarrow.c 2006-11-14 12:03:45.000000000 +0000
  5. @@ -31,7 +31,7 @@
  6. #include "gtkintl.h"
  7. #include "gtkalias.h"
  8. -#define MIN_ARROW_SIZE 15
  9. +#define MIN_ARROW_SIZE 7
  10. enum {
  11. PROP_0,
  12. @@ -53,6 +53,8 @@
  13. guint prop_id,
  14. GValue *value,
  15. GParamSpec *pspec);
  16. +static void gtk_arrow_size_request (GtkWidget *arrow,
  17. + GtkRequisition *requisition);
  18. G_DEFINE_TYPE (GtkArrow, gtk_arrow, GTK_TYPE_MISC)
  19. @@ -88,6 +90,7 @@
  20. GTK_PARAM_READWRITE));
  21. widget_class->expose_event = gtk_arrow_expose;
  22. + widget_class->size_request = gtk_arrow_size_request;
  23. }
  24. static void
  25. @@ -143,13 +146,18 @@
  26. }
  27. static void
  28. +gtk_arrow_size_request (GtkWidget *arrow,
  29. + GtkRequisition *requisition)
  30. +{
  31. + requisition->width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
  32. + requisition->height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
  33. +}
  34. +
  35. +static void
  36. gtk_arrow_init (GtkArrow *arrow)
  37. {
  38. GTK_WIDGET_SET_FLAGS (arrow, GTK_NO_WINDOW);
  39. - GTK_WIDGET (arrow)->requisition.width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
  40. - GTK_WIDGET (arrow)->requisition.height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
  41. -
  42. arrow->arrow_type = GTK_ARROW_RIGHT;
  43. arrow->shadow_type = GTK_SHADOW_OUT;
  44. }
  45. Index: gtk+-2.10.6/gtk/gtkentry.c
  46. ===================================================================
  47. --- gtk+-2.10.6.orig/gtk/gtkentry.c 2006-11-14 12:03:45.000000000 +0000
  48. +++ gtk+-2.10.6/gtk/gtkentry.c 2006-11-14 12:07:02.000000000 +0000
  49. @@ -577,6 +577,18 @@
  50. 0.0,
  51. GTK_PARAM_READWRITE));
  52. + // Added by gtk+-handhelds.patch
  53. + gtk_widget_class_install_style_property (widget_class,
  54. + g_param_spec_int ("min_width",
  55. + P_("Minimum width"),
  56. + P_("Minimum width of the entry field"),
  57. + 0,
  58. + G_MAXINT,
  59. + MIN_ENTRY_WIDTH,
  60. + G_PARAM_READABLE));
  61. +
  62. +
  63. +
  64. /**
  65. * GtkEntry:truncate-multiline:
  66. *
  67. @@ -1286,7 +1298,7 @@
  68. {
  69. GtkEntry *entry = GTK_ENTRY (widget);
  70. PangoFontMetrics *metrics;
  71. - gint xborder, yborder;
  72. + gint xborder, yborder, min_width;
  73. GtkBorder inner_border;
  74. PangoContext *context;
  75. @@ -1302,8 +1314,10 @@
  76. _gtk_entry_get_borders (entry, &xborder, &yborder);
  77. _gtk_entry_effective_inner_border (entry, &inner_border);
  78. + gtk_widget_style_get (widget, "min_width", &min_width, NULL);
  79. +
  80. if (entry->width_chars < 0)
  81. - requisition->width = MIN_ENTRY_WIDTH + xborder * 2 + inner_border.left + inner_border.right;
  82. + requisition->width = min_width + xborder * 2 + inner_border.left + inner_border.right;
  83. else
  84. {
  85. gint char_width = pango_font_metrics_get_approximate_char_width (metrics);
  86. Index: gtk+-2.10.6/gtk/gtkrange.c
  87. ===================================================================
  88. --- gtk+-2.10.6.orig/gtk/gtkrange.c 2006-11-14 12:03:44.000000000 +0000
  89. +++ gtk+-2.10.6/gtk/gtkrange.c 2006-11-14 12:07:40.000000000 +0000
  90. @@ -197,6 +197,7 @@
  91. static gboolean gtk_range_key_press (GtkWidget *range,
  92. GdkEventKey *event);
  93. +static GdkAtom recognize_protocols_atom, atom_atom;
  94. static guint signals[LAST_SIGNAL];
  95. @@ -213,6 +214,9 @@
  96. object_class = (GtkObjectClass*) class;
  97. widget_class = (GtkWidgetClass*) class;
  98. + recognize_protocols_atom = gdk_atom_intern ("RECOGNIZE_PROTOCOLS", FALSE);
  99. + atom_atom = gdk_atom_intern ("ATOM", FALSE);
  100. +
  101. gobject_class->set_property = gtk_range_set_property;
  102. gobject_class->get_property = gtk_range_get_property;
  103. gobject_class->finalize = gtk_range_finalize;
  104. @@ -1020,6 +1024,12 @@
  105. &attributes, attributes_mask);
  106. gdk_window_set_user_data (range->event_window, range);
  107. + gdk_property_change (range->event_window,
  108. + recognize_protocols_atom,
  109. + atom_atom,
  110. + 32, GDK_PROP_MODE_REPLACE,
  111. + NULL, 0);
  112. +
  113. widget->style = gtk_style_attach (widget->style, widget->window);
  114. }
  115. @@ -1569,7 +1579,7 @@
  116. /* ignore presses when we're already doing something else. */
  117. if (range->layout->grab_location != MOUSE_OUTSIDE)
  118. - return FALSE;
  119. + return TRUE;
  120. range->layout->mouse_x = event->x;
  121. range->layout->mouse_y = event->y;
  122. @@ -1778,7 +1788,7 @@
  123. return TRUE;
  124. }
  125. - return FALSE;
  126. + return TRUE;
  127. }
  128. /**