[gtk+] Make GtkFileChooserEntry make GtkStyleContext
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Make GtkFileChooserEntry make GtkStyleContext
- Date: Tue, 28 Dec 2010 18:26:48 +0000 (UTC)
commit 18b333bfe70883d7431231962bcb19a3626c0009
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Dec 28 17:51:46 2010 +0100
Make GtkFileChooserEntry make GtkStyleContext
gtk/gtkfilechooserentry.c | 34 +++++++++++++++++++++-------------
1 files changed, 21 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 03ff782..f2933a7 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -889,16 +889,16 @@ completion_feedback_window_draw_cb (GtkWidget *widget,
/* Stolen from gtk_tooltip_paint_window() */
GtkFileChooserEntry *chooser_entry = GTK_FILE_CHOOSER_ENTRY (data);
+ GtkStyleContext *context;
- gtk_paint_flat_box (gtk_widget_get_style (chooser_entry->completion_feedback_window),
- cr,
- GTK_STATE_NORMAL,
- GTK_SHADOW_OUT,
- chooser_entry->completion_feedback_window,
- "tooltip",
- 0, 0,
- gtk_widget_get_allocated_width (widget),
- gtk_widget_get_allocated_height (widget));
+ context = gtk_widget_get_style_context (chooser_entry->completion_feedback_window);
+
+ gtk_render_background (context, cr, 0, 0,
+ gtk_widget_get_allocated_width (widget),
+ gtk_widget_get_allocated_height (widget));
+ gtk_render_frame (context, cr, 0, 0,
+ gtk_widget_get_allocated_width (widget),
+ gtk_widget_get_allocated_height (widget));
return FALSE;
}
@@ -933,8 +933,9 @@ create_completion_feedback_window (GtkFileChooserEntry *chooser_entry)
{
/* Stolen from gtk_tooltip_init() */
- GtkStyle *style;
+ GtkStyleContext *context;
GtkWidget *alignment;
+ GtkBorder padding, border;
chooser_entry->completion_feedback_window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_type_hint (GTK_WINDOW (chooser_entry->completion_feedback_window),
@@ -944,10 +945,17 @@ create_completion_feedback_window (GtkFileChooserEntry *chooser_entry)
gtk_widget_set_name (chooser_entry->completion_feedback_window, "gtk-tooltip");
alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
- style = gtk_widget_get_style (chooser_entry->completion_feedback_window);
+ context = gtk_widget_get_style_context (chooser_entry->completion_feedback_window);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOOLTIP);
+
+ gtk_style_context_get_padding (context, 0, &padding);
+ gtk_style_context_get_border (context, 0, &border);
+
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment),
- style->ythickness, style->ythickness,
- style->xthickness, style->xthickness);
+ border.top + padding.top,
+ border.bottom + padding.bottom,
+ border.left + padding.left,
+ border.right + padding.right);
gtk_container_add (GTK_CONTAINER (chooser_entry->completion_feedback_window), alignment);
gtk_widget_show (alignment);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]