aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--libempathy-gtk/empathy-account-widget.c25
-rw-r--r--libempathy-gtk/empathy-chat-text-view.c2
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c19
-rw-r--r--libempathy-gtk/empathy-individual-view.c21
-rw-r--r--libempathy-gtk/empathy-persona-view.c21
-rw-r--r--libempathy-gtk/empathy-status-preset-dialog.c8
-rw-r--r--libempathy-gtk/empathy-ui-utils.c10
-rw-r--r--libempathy-gtk/empathy-ui-utils.h3
-rw-r--r--libempathy-gtk/empathy-video-widget.c10
10 files changed, 65 insertions, 56 deletions
diff --git a/configure.ac b/configure.ac
index 00087c6ca..71d07592d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,7 +34,7 @@ AC_COPYRIGHT([
FOLKS_REQUIRED=0.3.3
GLIB_REQUIRED=2.27.2
GNUTLS_REQUIRED=2.8.5
-GTK_REQUIRED=2.91.3
+GTK_REQUIRED=2.91.6
KEYRING_REQUIRED=2.26.0
LIBCANBERRA_GTK_REQUIRED=0.25
LIBNOTIFY_REQUIRED=0.7.0
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index d2a1c56f4..ea1572021 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -226,32 +226,33 @@ account_widget_set_control_buttons_sensitivity (EmpathyAccountWidget *self,
}
static void
-account_widget_set_entry_highlighting (GtkEntry *entry, gboolean highlight)
+account_widget_set_entry_highlighting (GtkEntry *entry,
+ gboolean highlight)
{
- GdkColor color;
- GtkStyle *style;
-
g_return_if_fail (GTK_IS_ENTRY (entry));
- style = gtk_widget_get_style (GTK_WIDGET (entry));
-
if (highlight)
{
- color = style->bg[GTK_STATE_SELECTED];
+ GtkStyleContext *style;
+ GdkRGBA color;
+
+ style = gtk_widget_get_style_context (GTK_WIDGET (entry));
+ gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED,
+ &color);
/* Here we take the current theme colour and add it to
* the colour for white and average the two. This
* gives a colour which is inline with the theme but
* slightly whiter.
*/
- color.red = (color.red + (style->white).red) / 2;
- color.green = (color.green + (style->white).green) / 2;
- color.blue = (color.blue + (style->white).blue) / 2;
+ empathy_make_color_whiter (&color);
- gtk_widget_modify_base (GTK_WIDGET (entry), GTK_STATE_NORMAL, &color);
+ gtk_widget_override_background_color (GTK_WIDGET (entry), 0, &color);
}
else
- gtk_widget_modify_base (GTK_WIDGET (entry), GTK_STATE_NORMAL, NULL);
+ {
+ gtk_widget_override_background_color (GTK_WIDGET (entry), 0, NULL);
+ }
}
static void
diff --git a/libempathy-gtk/empathy-chat-text-view.c b/libempathy-gtk/empathy-chat-text-view.c
index 5d5dcde46..b58fbc239 100644
--- a/libempathy-gtk/empathy-chat-text-view.c
+++ b/libempathy-gtk/empathy-chat-text-view.c
@@ -219,7 +219,7 @@ chat_text_view_system_font_update (EmpathyChatTextView *view)
font_description = NULL;
}
- gtk_widget_modify_font (GTK_WIDGET (view), font_description);
+ gtk_widget_override_font (GTK_WIDGET (view), font_description);
if (font_description) {
pango_font_description_free (font_description);
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 1b11309f3..4679e06f8 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -951,29 +951,28 @@ contact_list_view_cell_set_background (EmpathyContactListView *view,
gboolean is_group,
gboolean is_active)
{
- GdkColor color;
- GtkStyle *style;
+ if (!is_group && is_active) {
+ GdkRGBA color;
+ GtkStyleContext *style;
- style = gtk_widget_get_style (GTK_WIDGET (view));
+ style = gtk_widget_get_style_context (GTK_WIDGET (view));
- if (!is_group && is_active) {
- color = style->bg[GTK_STATE_SELECTED];
+ gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED,
+ &color);
/* Here we take the current theme colour and add it to
* the colour for white and average the two. This
* gives a colour which is inline with the theme but
* slightly whiter.
*/
- color.red = (color.red + (style->white).red) / 2;
- color.green = (color.green + (style->white).green) / 2;
- color.blue = (color.blue + (style->white).blue) / 2;
+ empathy_make_color_whiter (&color);
g_object_set (cell,
- "cell-background-gdk", &color,
+ "cell-background-rgba", &color,
NULL);
} else {
g_object_set (cell,
- "cell-background-gdk", NULL,
+ "cell-background-rgba", NULL,
NULL);
}
}
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index 30098e534..38ef61e54 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -1047,28 +1047,27 @@ individual_view_cell_set_background (EmpathyIndividualView *view,
gboolean is_group,
gboolean is_active)
{
- GdkColor color;
- GtkStyle *style;
-
- style = gtk_widget_get_style (GTK_WIDGET (view));
-
if (!is_group && is_active)
{
- color = style->bg[GTK_STATE_SELECTED];
+ GtkStyleContext *style;
+ GdkRGBA color;
+
+ style = gtk_widget_get_style_context (GTK_WIDGET (view));
+
+ gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED,
+ &color);
/* Here we take the current theme colour and add it to
* the colour for white and average the two. This
* gives a colour which is inline with the theme but
* slightly whiter.
*/
- color.red = (color.red + (style->white).red) / 2;
- color.green = (color.green + (style->white).green) / 2;
- color.blue = (color.blue + (style->white).blue) / 2;
+ empathy_make_color_whiter (&color);
- g_object_set (cell, "cell-background-gdk", &color, NULL);
+ g_object_set (cell, "cell-background-rgba", &color, NULL);
}
else
- g_object_set (cell, "cell-background-gdk", NULL, NULL);
+ g_object_set (cell, "cell-background-rgba", NULL, NULL);
}
static void
diff --git a/libempathy-gtk/empathy-persona-view.c b/libempathy-gtk/empathy-persona-view.c
index adfe6be5c..02a9ff5da 100644
--- a/libempathy-gtk/empathy-persona-view.c
+++ b/libempathy-gtk/empathy-persona-view.c
@@ -236,29 +236,28 @@ cell_set_background (EmpathyPersonaView *self,
GtkCellRenderer *cell,
gboolean is_active)
{
- GdkColor color;
- GtkStyle *style;
-
- style = gtk_widget_get_style (GTK_WIDGET (self));
-
if (is_active)
{
- color = style->bg[GTK_STATE_SELECTED];
+ GdkRGBA color;
+ GtkStyleContext *style;
+
+ style = gtk_widget_get_style_context (GTK_WIDGET (self));
+
+ gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED,
+ &color);
/* Here we take the current theme colour and add it to
* the colour for white and average the two. This
* gives a colour which is inline with the theme but
* slightly whiter.
*/
- color.red = (color.red + (style->white).red) / 2;
- color.green = (color.green + (style->white).green) / 2;
- color.blue = (color.blue + (style->white).blue) / 2;
+ empathy_make_color_whiter (&color);
- g_object_set (cell, "cell-background-gdk", &color, NULL);
+ g_object_set (cell, "cell-background-rgba", &color, NULL);
}
else
{
- g_object_set (cell, "cell-background-gdk", NULL, NULL);
+ g_object_set (cell, "cell-background-rgba", NULL, NULL);
}
}
diff --git a/libempathy-gtk/empathy-status-preset-dialog.c b/libempathy-gtk/empathy-status-preset-dialog.c
index 957a17d58..2c36cb332 100644
--- a/libempathy-gtk/empathy-status-preset-dialog.c
+++ b/libempathy-gtk/empathy-status-preset-dialog.c
@@ -351,12 +351,12 @@ status_preset_dialog_set_add_combo_changed (EmpathyStatusPresetDialog *self,
gtk_widget_set_sensitive (priv->add_button, state);
if (state) {
- gtk_widget_modify_text (entry, GTK_STATE_NORMAL, NULL);
+ gtk_widget_override_color (entry, 0, NULL);
} else {
- GdkColor colour;
+ GdkRGBA color;
- gdk_color_parse ("Gray", &colour); /* FIXME - theme */
- gtk_widget_modify_text (entry, GTK_STATE_NORMAL, &colour);
+ if (gdk_rgba_parse (&color, "Gray")) /* FIXME - theme */
+ gtk_widget_override_color (entry, 0, &color);
if (reset_text) {
priv->block_add_combo_changed++;
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 043c03eb3..e2946e513 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1898,3 +1898,13 @@ empathy_receive_file_with_file_chooser (EmpathyFTHandler *handler)
gtk_widget_show (widget);
g_free (title);
}
+
+void
+empathy_make_color_whiter (GdkRGBA *color)
+{
+ const GdkRGBA white = { 1.0, 1.0, 1.0, 1.0 };
+
+ color->red = (color->red + white.red) / 2;
+ color->green = (color->green + white.green) / 2;
+ color->blue = (color->blue + white.blue) / 2;
+}
diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h
index 0b76d09a3..0ff637a33 100644
--- a/libempathy-gtk/empathy-ui-utils.h
+++ b/libempathy-gtk/empathy-ui-utils.h
@@ -145,6 +145,9 @@ void empathy_send_file_from_uri_list (EmpathyContact *conta
void empathy_send_file_with_file_chooser (EmpathyContact *contact);
void empathy_receive_file_with_file_chooser (EmpathyFTHandler *handler);
+/* Misc */
+void empathy_make_color_whiter (GdkRGBA *color);
+
G_END_DECLS
#endif /* __EMPATHY_UI_UTILS_H__ */
diff --git a/libempathy-gtk/empathy-video-widget.c b/libempathy-gtk/empathy-video-widget.c
index 26cc878b2..b4b39ffdb 100644
--- a/libempathy-gtk/empathy-video-widget.c
+++ b/libempathy-gtk/empathy-video-widget.c
@@ -83,7 +83,7 @@ static void
empathy_video_widget_init (EmpathyVideoWidget *obj)
{
EmpathyVideoWidgetPriv *priv = GET_PRIV (obj);
- GdkColor black;
+ GdkRGBA black;
priv->lock = g_mutex_new ();
@@ -92,9 +92,8 @@ empathy_video_widget_init (EmpathyVideoWidget *obj)
G_CALLBACK (empathy_video_widget_element_added_cb),
obj);
- if (gdk_color_parse ("Black", &black))
- gtk_widget_modify_bg (GTK_WIDGET (obj), GTK_STATE_NORMAL,
- &black);
+ if (gdk_rgba_parse (&black, "Black"))
+ gtk_widget_override_background_color (GTK_WIDGET (obj), 0, &black);
gtk_widget_set_double_buffered (GTK_WIDGET (obj), FALSE);
}
@@ -434,8 +433,7 @@ empathy_video_widget_draw (GtkWidget *widget,
{
gtk_widget_get_allocation (widget, &allocation);
- gtk_paint_flat_box (gtk_widget_get_style (widget), cr,
- GTK_STATE_NORMAL, GTK_SHADOW_NONE, widget, NULL,
+ gtk_render_frame (gtk_widget_get_style_context (widget), cr,
0, 0,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget));