[maemo-commits] [maemo-commits] r9086 - in projects/haf/branches/gtk+/maemo-gtk-2-10: . gtk
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Fri Jan 12 17:04:10 EET 2007
- Previous message: [maemo-commits] r9085 - in projects/haf/branches/gtk+/maemo-gtk-2-10: . gtk
- Next message: [maemo-commits] r9087 - in projects/haf/branches/gtk+/maemo-gtk-2-10: . gtk
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: mitch Date: 2007-01-12 17:04:08 +0200 (Fri, 12 Jan 2007) New Revision: 9086 Modified: projects/haf/branches/gtk+/maemo-gtk-2-10/ChangeLog projects/haf/branches/gtk+/maemo-gtk-2-10/gtk/gtkentry.c Log: 2007-01-12 Michael Natterer <mitch at imendio.com> * gtk/gtkentry.c: port over "icon-width" style property. Modified: projects/haf/branches/gtk+/maemo-gtk-2-10/ChangeLog =================================================================== --- projects/haf/branches/gtk+/maemo-gtk-2-10/ChangeLog 2007-01-12 14:58:08 UTC (rev 9085) +++ projects/haf/branches/gtk+/maemo-gtk-2-10/ChangeLog 2007-01-12 15:04:08 UTC (rev 9086) @@ -1,3 +1,7 @@ +2007-01-12 Michael Natterer <mitch at imendio.com> + + * gtk/gtkentry.c: port over "icon-width" style property. + 2007-01-12 Kristian Rietveld <kris at imendio.com> * gtk/gtktreeview.c (gtk_tree_view_class_init), Modified: projects/haf/branches/gtk+/maemo-gtk-2-10/gtk/gtkentry.c =================================================================== --- projects/haf/branches/gtk+/maemo-gtk-2-10/gtk/gtkentry.c 2007-01-12 14:58:08 UTC (rev 9085) +++ projects/haf/branches/gtk+/maemo-gtk-2-10/gtk/gtkentry.c 2007-01-12 15:04:08 UTC (rev 9086) @@ -865,6 +865,24 @@ TRUE, GTK_PARAM_READWRITE)); + /* MAEMO START */ + /** + * GtkEntry:icon-width: + * + * Size of the purpose icon. + * + * Since: maemo 1.0 + */ + gtk_widget_class_install_style_property (widget_class, + g_param_spec_int ("icon-width", + P_("Icon Width"), + P_("Size of the purpose icon."), + 0, + G_MAXINT, + 0, + GTK_PARAM_READWRITE)); + /* MAEMO_END */ + /** * GtkSettings:gtk-entry-password-hint-timeout: * @@ -1289,6 +1307,11 @@ gint xborder, yborder; GtkBorder inner_border; PangoContext *context; + /* MAEMO START */ + gint icon_width; + + gtk_widget_style_get (widget, "icon-width", &icon_width, NULL); + /* MAEMO_END */ gtk_widget_ensure_style (widget); context = gtk_widget_get_pango_context (widget); @@ -1313,6 +1336,9 @@ requisition->width = char_pixels * entry->width_chars + xborder * 2 + inner_border.left + inner_border.right; } + /* MAEMO START */ + requisition->width += icon_width; + /* MAEMO_END */ requisition->height = PANGO_PIXELS (entry->ascent + entry->descent) + yborder * 2 + inner_border.top + inner_border.bottom; pango_font_metrics_unref (metrics); @@ -1328,19 +1354,24 @@ gint xborder, yborder; GtkRequisition requisition; GtkWidget *widget = GTK_WIDGET (entry); + /* MAEMO START */ + gint icon_width; + gtk_widget_style_get (widget, "icon-width", &icon_width, NULL); + /* MAEMO END */ + gtk_widget_get_child_requisition (widget, &requisition); _gtk_entry_get_borders (entry, &xborder, &yborder); if (x) - *x = xborder; + *x = xborder /* MAEMO START */ + icon_width /* MAEMO END */; if (y) *y = yborder; if (width) - *width = GTK_WIDGET (entry)->allocation.width - xborder * 2; + *width = GTK_WIDGET (entry)->allocation.width - xborder * 2 /* MAEMO START */ - icon_width /* MAEMO END */; if (height) *height = requisition.height - yborder * 2;
- Previous message: [maemo-commits] r9085 - in projects/haf/branches/gtk+/maemo-gtk-2-10: . gtk
- Next message: [maemo-commits] r9087 - in projects/haf/branches/gtk+/maemo-gtk-2-10: . gtk
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]