Merge branch 'master' into treeview-refactor

This commit is contained in:
Tristan Van Berkom 2010-12-05 13:14:39 +09:00
commit 7b61cd8257
13 changed files with 137 additions and 18 deletions

View File

@ -326,6 +326,18 @@ Used to change the appearance of an outline typically provided by a #GtkFrame.
@GTK_STATE_INCONSISTENT: @GTK_STATE_INCONSISTENT:
@GTK_STATE_FOCUSED: @GTK_STATE_FOCUSED:
<!-- ##### ENUM GtkStateFlags ##### -->
<para>
</para>
@GTK_STATE_FLAG_ACTIVE:
@GTK_STATE_FLAG_PRELIGHT:
@GTK_STATE_FLAG_SELECTED:
@GTK_STATE_FLAG_INSENSITIVE:
@GTK_STATE_FLAG_INCONSISTENT:
@GTK_STATE_FLAG_FOCUSED:
<!-- ##### ENUM GtkToolbarStyle ##### --> <!-- ##### ENUM GtkToolbarStyle ##### -->
<para> <para>
Used to customize the appearance of a #GtkToolbar. Note that Used to customize the appearance of a #GtkToolbar. Note that
@ -408,3 +420,39 @@ The value can by obtained by connecting to the
@GTK_DRAG_RESULT_ERROR: The drag operation failed due to some @GTK_DRAG_RESULT_ERROR: The drag operation failed due to some
unspecified error unspecified error
<!-- ##### ENUM GtkJunctionSides ##### -->
<para>
</para>
@GTK_JUNCTION_NONE:
@GTK_JUNCTION_CORNER_TOPLEFT:
@GTK_JUNCTION_CORNER_TOPRIGHT:
@GTK_JUNCTION_CORNER_BOTTOMLEFT:
@GTK_JUNCTION_CORNER_BOTTOMRIGHT:
@GTK_JUNCTION_TOP:
@GTK_JUNCTION_BOTTOM:
@GTK_JUNCTION_LEFT:
@GTK_JUNCTION_RIGHT:
<!-- ##### ENUM GtkBorderStyle ##### -->
<para>
</para>
@GTK_BORDER_STYLE_NONE:
@GTK_BORDER_STYLE_SOLID:
@GTK_BORDER_STYLE_INSET:
@GTK_BORDER_STYLE_OUTSET:
<!-- ##### ENUM GtkRegionFlags ##### -->
<para>
</para>
@GTK_REGION_EVEN:
@GTK_REGION_ODD:
@GTK_REGION_FIRST:
@GTK_REGION_LAST:
@GTK_REGION_SORTED:

View File

@ -279,6 +279,17 @@ This attribute is optional.</para>
@Returns: @Returns:
<!-- ##### FUNCTION gtk_icon_set_render_icon_pixbuf ##### -->
<para>
</para>
@icon_set:
@context:
@size:
@Returns:
<!-- ##### FUNCTION gtk_icon_set_unref ##### --> <!-- ##### FUNCTION gtk_icon_set_unref ##### -->
<para> <para>

View File

@ -449,6 +449,18 @@ The #GQuark used for #GtkIconThemeError errors.
@Returns: @Returns:
<!-- ##### FUNCTION gtk_icon_info_load_symbolic_for_context ##### -->
<para>
</para>
@icon_info:
@context:
@was_symbolic:
@error:
@Returns:
<!-- ##### FUNCTION gtk_icon_info_set_raw_coordinates ##### --> <!-- ##### FUNCTION gtk_icon_info_set_raw_coordinates ##### -->
<para> <para>

View File

@ -386,7 +386,7 @@ gdk_window_begin_move_drag
gdk_window_begin_paint_rect gdk_window_begin_paint_rect
gdk_window_begin_paint_region gdk_window_begin_paint_region
gdk_window_begin_resize_drag gdk_window_begin_resize_drag
gdk_window_class_class_get_type G_GNUC_CONST gdk_window_window_class_get_type G_GNUC_CONST
gdk_window_configure_finished gdk_window_configure_finished
gdk_window_constrain_size gdk_window_constrain_size
gdk_window_coords_from_parent gdk_window_coords_from_parent

View File

@ -8052,7 +8052,7 @@ gdk_window_beep (GdkWindow *window)
if (toplevel) if (toplevel)
{ {
if (GDK_WINDOW_IMPL_CLASS (toplevel)->beep (window)) if (GDK_WINDOW_IMPL_GET_CLASS (toplevel->impl)->beep (window))
return; return;
} }

View File

@ -50,6 +50,7 @@
#include "gtkmarshalers.h" #include "gtkmarshalers.h"
#include "gtkintl.h" #include "gtkintl.h"
#include "gtkentryprivate.h"
#include "gtktreeprivate.h" #include "gtktreeprivate.h"
@ -1495,6 +1496,10 @@ gtk_combo_box_add (GtkContainer *container,
if (priv->has_entry) if (priv->has_entry)
{ {
/* this flag is a hack to tell the entry to fill its allocation.
*/
_gtk_entry_set_is_cell_renderer (GTK_ENTRY (widget), TRUE);
g_signal_connect (widget, "changed", g_signal_connect (widget, "changed",
G_CALLBACK (gtk_combo_box_entry_contents_changed), G_CALLBACK (gtk_combo_box_entry_contents_changed),
combo_box); combo_box);
@ -1522,6 +1527,7 @@ gtk_combo_box_remove (GtkContainer *container,
g_signal_handlers_disconnect_by_func (widget, g_signal_handlers_disconnect_by_func (widget,
gtk_combo_box_entry_contents_changed, gtk_combo_box_entry_contents_changed,
container); container);
_gtk_entry_set_is_cell_renderer (GTK_ENTRY (widget), FALSE);
} }
} }

View File

@ -10216,3 +10216,21 @@ keymap_state_changed (GdkKeymap *keymap,
else else
remove_capslock_feedback (entry); remove_capslock_feedback (entry);
} }
/*
* _gtk_entry_set_is_cell_renderer:
* @entry: a #GtkEntry
* @is_cell_renderer: new value
*
* This is a helper function for GtkComboBox. A GtkEntry in a GtkComboBox
* is supposed to behave like a GtkCellEditable when placed in a combo box.
*
* I.e take up it's allocation and get GtkEntry->is_cell_renderer = TRUE.
*
*/
void
_gtk_entry_set_is_cell_renderer (GtkEntry *entry,
gboolean is_cell_renderer)
{
entry->priv->is_cell_renderer = is_cell_renderer;
}

View File

@ -86,6 +86,10 @@ void _gtk_entry_effective_inner_border (GtkEntry *entry,
GtkBorder *border); GtkBorder *border);
void _gtk_entry_reset_im_context (GtkEntry *entry); void _gtk_entry_reset_im_context (GtkEntry *entry);
GtkIMContext* _gtk_entry_get_im_context (GtkEntry *entry); GtkIMContext* _gtk_entry_get_im_context (GtkEntry *entry);
void _gtk_entry_set_is_cell_renderer (GtkEntry *entry,
gboolean is_cell_renderer);
G_END_DECLS G_END_DECLS
#endif /* __GTK_ENTRY_PRIVATE_H__ */ #endif /* __GTK_ENTRY_PRIVATE_H__ */

View File

@ -98,7 +98,8 @@ gtk_modifier_style_get_style_property (GtkStyleProvider *provider,
GValue *value) GValue *value)
{ {
GtkModifierStylePrivate *priv; GtkModifierStylePrivate *priv;
GdkColor *color; GdkRGBA *rgba;
GdkColor color;
gchar *str; gchar *str;
/* Reject non-color types for now */ /* Reject non-color types for now */
@ -110,13 +111,17 @@ gtk_modifier_style_get_style_property (GtkStyleProvider *provider,
g_type_name (pspec->owner_type), g_type_name (pspec->owner_type),
pspec->name); pspec->name);
color = g_hash_table_lookup (priv->color_properties, str); rgba = g_hash_table_lookup (priv->color_properties, str);
g_free (str); g_free (str);
if (!color) if (!rgba)
return FALSE; return FALSE;
g_value_set_boxed (value, color); color.red = (guint) (rgba->red * 65535.) + 0.5;
color.green = (guint) (rgba->green * 65535.) + 0.5;
color.blue = (guint) (rgba->blue * 65535.) + 0.5;
g_value_set_boxed (value, &color);
return TRUE; return TRUE;
} }
@ -254,10 +259,10 @@ void
gtk_modifier_style_set_color_property (GtkModifierStyle *style, gtk_modifier_style_set_color_property (GtkModifierStyle *style,
GType widget_type, GType widget_type,
const gchar *prop_name, const gchar *prop_name,
const GdkColor *color) const GdkRGBA *color)
{ {
GtkModifierStylePrivate *priv; GtkModifierStylePrivate *priv;
const GdkColor *old_color; const GdkRGBA *old_color;
gchar *str; gchar *str;
g_return_if_fail (GTK_IS_MODIFIER_STYLE (style)); g_return_if_fail (GTK_IS_MODIFIER_STYLE (style));
@ -270,7 +275,7 @@ gtk_modifier_style_set_color_property (GtkModifierStyle *style,
old_color = g_hash_table_lookup (priv->color_properties, str); old_color = g_hash_table_lookup (priv->color_properties, str);
if ((!color && !old_color) || if ((!color && !old_color) ||
(color && old_color && gdk_color_equal (color, old_color))) (color && old_color && gdk_rgba_equal (color, old_color)))
{ {
g_free (str); g_free (str);
return; return;
@ -278,7 +283,7 @@ gtk_modifier_style_set_color_property (GtkModifierStyle *style,
if (color) if (color)
g_hash_table_insert (priv->color_properties, str, g_hash_table_insert (priv->color_properties, str,
gdk_color_copy (color)); gdk_rgba_copy (color));
else else
g_hash_table_remove (priv->color_properties, str); g_hash_table_remove (priv->color_properties, str);

View File

@ -67,7 +67,7 @@ void gtk_modifier_style_map_color (GtkModifierStyle *style,
void gtk_modifier_style_set_color_property (GtkModifierStyle *style, void gtk_modifier_style_set_color_property (GtkModifierStyle *style,
GType widget_type, GType widget_type,
const gchar *prop_name, const gchar *prop_name,
const GdkColor *color); const GdkRGBA *color);
G_END_DECLS G_END_DECLS

View File

@ -8109,12 +8109,15 @@ gtk_widget_override_symbolic_color (GtkWidget *widget,
* style properties. All other style values are left untouched. * style properties. All other style values are left untouched.
* See also gtk_widget_modify_style(). * See also gtk_widget_modify_style().
* *
* Note that the underlying properties have the #GdkColor type,
* so the alpha value in @primary and @secondary will be ignored.
*
* Since: 3.0 * Since: 3.0
**/ **/
void void
gtk_widget_override_cursor (GtkWidget *widget, gtk_widget_override_cursor (GtkWidget *widget,
const GdkColor *cursor, const GdkRGBA *cursor,
const GdkColor *secondary_cursor) const GdkRGBA *secondary_cursor)
{ {
GtkModifierStyle *style; GtkModifierStyle *style;
@ -8378,9 +8381,21 @@ gtk_widget_modify_cursor (GtkWidget *widget,
const GdkColor *primary, const GdkColor *primary,
const GdkColor *secondary) const GdkColor *secondary)
{ {
GdkRGBA primary_rgba, secondary_rgba;
g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (GTK_IS_WIDGET (widget));
gtk_widget_override_cursor (widget, primary, secondary); primary_rgba.red = primary->red / 65535.;
primary_rgba.green = primary->green / 65535.;
primary_rgba.blue = primary->blue / 65535.;
primary_rgba.alpha = 1;
secondary_rgba.red = secondary->red / 65535.;
secondary_rgba.green = secondary->green / 65535.;
secondary_rgba.blue = secondary->blue / 65535.;
secondary_rgba.alpha = 1;
gtk_widget_override_cursor (widget, &primary_rgba, &secondary_rgba);
g_signal_emit (widget, g_signal_emit (widget,
widget_signals[STYLE_SET], widget_signals[STYLE_SET],

View File

@ -774,8 +774,8 @@ void gtk_widget_override_symbolic_color (GtkWidget *widget,
const gchar *name, const gchar *name,
const GdkRGBA *color); const GdkRGBA *color);
void gtk_widget_override_cursor (GtkWidget *widget, void gtk_widget_override_cursor (GtkWidget *widget,
const GdkColor *cursor, const GdkRGBA *cursor,
const GdkColor *secondary_cursor); const GdkRGBA *secondary_cursor);
void gtk_widget_style_attach (GtkWidget *widget); void gtk_widget_style_attach (GtkWidget *widget);

View File

@ -10,7 +10,7 @@ oriented_test_widget (const gchar *label, const gchar *color, gdouble angle)
widget = gtk_label_new (label); widget = gtk_label_new (label);
gtk_label_set_angle (GTK_LABEL (widget), angle); gtk_label_set_angle (GTK_LABEL (widget), angle);
box = gtk_event_box_new (); box = gtk_event_box_new ();
gdk_rgba_parse (color, &c); gdk_rgba_parse (&c, color);
gtk_widget_override_background_color (box, 0, &c); gtk_widget_override_background_color (box, 0, &c);
gtk_container_add (GTK_CONTAINER (box), widget); gtk_container_add (GTK_CONTAINER (box), widget);