Update GtkTrayIcon to GtkStyleContext
This commit is contained in:
parent
dd8887c07d
commit
24db0283ad
@ -85,8 +85,7 @@ static void gtk_tray_icon_get_property (GObject *object,
|
|||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
static void gtk_tray_icon_realize (GtkWidget *widget);
|
static void gtk_tray_icon_realize (GtkWidget *widget);
|
||||||
static void gtk_tray_icon_style_set (GtkWidget *widget,
|
static void gtk_tray_icon_style_updated (GtkWidget *widget);
|
||||||
GtkStyle *previous_style);
|
|
||||||
static gboolean gtk_tray_icon_delete (GtkWidget *widget,
|
static gboolean gtk_tray_icon_delete (GtkWidget *widget,
|
||||||
GdkEventAny *event);
|
GdkEventAny *event);
|
||||||
static gboolean gtk_tray_icon_draw (GtkWidget *widget,
|
static gboolean gtk_tray_icon_draw (GtkWidget *widget,
|
||||||
@ -114,7 +113,7 @@ gtk_tray_icon_class_init (GtkTrayIconClass *class)
|
|||||||
gobject_class->dispose = gtk_tray_icon_dispose;
|
gobject_class->dispose = gtk_tray_icon_dispose;
|
||||||
|
|
||||||
widget_class->realize = gtk_tray_icon_realize;
|
widget_class->realize = gtk_tray_icon_realize;
|
||||||
widget_class->style_set = gtk_tray_icon_style_set;
|
widget_class->style_updated = gtk_tray_icon_style_updated;
|
||||||
widget_class->delete_event = gtk_tray_icon_delete;
|
widget_class->delete_event = gtk_tray_icon_delete;
|
||||||
widget_class->draw = gtk_tray_icon_draw;
|
widget_class->draw = gtk_tray_icon_draw;
|
||||||
|
|
||||||
@ -361,15 +360,21 @@ gtk_tray_icon_draw (GtkWidget *widget,
|
|||||||
focus_child = gtk_container_get_focus_child (GTK_CONTAINER (widget));
|
focus_child = gtk_container_get_focus_child (GTK_CONTAINER (widget));
|
||||||
if (focus_child && gtk_widget_has_focus (focus_child))
|
if (focus_child && gtk_widget_has_focus (focus_child))
|
||||||
{
|
{
|
||||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
GtkStyleContext *context;
|
||||||
|
GtkStateFlags state;
|
||||||
|
|
||||||
gtk_paint_focus (gtk_widget_get_style (widget),
|
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||||
cr,
|
context = gtk_widget_get_style_context (widget);
|
||||||
gtk_widget_get_state (widget),
|
state = gtk_widget_get_state_flags (widget);
|
||||||
widget, "tray_icon",
|
|
||||||
border_width, border_width,
|
gtk_style_context_save (context);
|
||||||
gtk_widget_get_allocated_width (widget) - 2 * border_width,
|
gtk_style_context_set_state (context, state);
|
||||||
gtk_widget_get_allocated_height (widget) - 2 * border_width);
|
|
||||||
|
gtk_render_focus (context, cr, border_width, border_width,
|
||||||
|
gtk_widget_get_allocated_width (widget) - 2 * border_width,
|
||||||
|
gtk_widget_get_allocated_height (widget) - 2 * border_width);
|
||||||
|
|
||||||
|
gtk_style_context_restore (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
@ -895,8 +900,7 @@ gtk_tray_icon_realize (GtkWidget *widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_tray_icon_style_set (GtkWidget *widget,
|
gtk_tray_icon_style_updated (GtkWidget *widget)
|
||||||
GtkStyle *previous_style)
|
|
||||||
{
|
{
|
||||||
/* The default handler resets the background according to the style. We either
|
/* The default handler resets the background according to the style. We either
|
||||||
* use a transparent background or a parent-relative background and ignore the
|
* use a transparent background or a parent-relative background and ignore the
|
||||||
|
Loading…
Reference in New Issue
Block a user