[gtk+/wip/window-unfocused-fixes: 5/13] notebook: Set GTK_STATE_FLAG_WINDOW_UNFOCUSED on draw
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/window-unfocused-fixes: 5/13] notebook: Set GTK_STATE_FLAG_WINDOW_UNFOCUSED on draw
- Date: Tue, 13 Dec 2011 21:03:35 +0000 (UTC)
commit 8017798af9f8be107b026a0bcc029bc50443ddf0
Author: Rui Matos <tiagomatos gmail com>
Date: Sun Dec 11 23:07:56 2011 +0000
notebook: Set GTK_STATE_FLAG_WINDOW_UNFOCUSED on draw
https://bugzilla.gnome.org/show_bug.cgi?id=666126
gtk/gtknotebook.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 254ce6a..f45842b 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1981,6 +1981,8 @@ notebook_tab_prepare_style_context (GtkNotebook *notebook,
page == notebook->priv->cur_page)
state = GTK_STATE_FLAG_ACTIVE;
+ state |= (gtk_widget_get_state_flags (GTK_WIDGET (notebook)) & GTK_STATE_FLAG_WINDOW_UNFOCUSED);
+
gtk_style_context_set_state (context, state);
if (use_flags && (page != NULL))
@@ -5122,6 +5124,7 @@ gtk_notebook_paint (GtkWidget *widget,
gboolean is_rtl;
gint tab_pos;
GtkStyleContext *context;
+ GtkStateFlags state = 0;
notebook = GTK_NOTEBOOK (widget);
priv = notebook->priv;
@@ -5141,12 +5144,17 @@ gtk_notebook_paint (GtkWidget *widget,
width = allocation.width - border_width * 2;
height = allocation.height - border_width * 2;
+ state |= (gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_WINDOW_UNFOCUSED);
+
if (priv->show_border && (!priv->show_tabs || !priv->children))
{
+ gtk_style_context_save (context);
+ gtk_style_context_set_state (context, state);
gtk_render_background (context, cr,
x, y, width, height);
gtk_render_frame (context, cr,
x, y, width, height);
+ gtk_style_context_restore (context);
return;
}
@@ -5223,6 +5231,7 @@ gtk_notebook_paint (GtkWidget *widget,
}
gtk_style_context_save (context);
+ gtk_style_context_set_state (context, state);
if (!showarrow || !priv->scrollable)
{
@@ -5418,6 +5427,8 @@ gtk_notebook_draw_arrow (GtkNotebook *notebook,
left ? STEP_PREV : STEP_NEXT, TRUE))
state = GTK_STATE_FLAG_INSENSITIVE;
+ state |= (gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_WINDOW_UNFOCUSED);
+
if (priv->tab_pos == GTK_POS_LEFT ||
priv->tab_pos == GTK_POS_RIGHT)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]