aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralexandremazari <scaroo@gmail.com>2011-03-16 20:44:05 +0800
committerXan Lopez <xlopez@igalia.com>2011-04-26 06:36:49 +0800
commit50376426e43b6a518f3d28520c621d885b325d9c (patch)
tree29dfbd6c8e8f9b97f2becdb8b5c2b6bab485996b
parent03fe13e164e3d0cf8440307381559e6f3c3d7329 (diff)
downloadgsoc2013-epiphany-50376426e43b6a518f3d28520c621d885b325d9c.tar
gsoc2013-epiphany-50376426e43b6a518f3d28520c621d885b325d9c.tar.gz
gsoc2013-epiphany-50376426e43b6a518f3d28520c621d885b325d9c.tar.bz2
gsoc2013-epiphany-50376426e43b6a518f3d28520c621d885b325d9c.tar.lz
gsoc2013-epiphany-50376426e43b6a518f3d28520c621d885b325d9c.tar.xz
gsoc2013-epiphany-50376426e43b6a518f3d28520c621d885b325d9c.tar.zst
gsoc2013-epiphany-50376426e43b6a518f3d28520c621d885b325d9c.zip
Fix for bug 642403: Selecting text in URL bar doesn't highlight if page is encrypted
https://bugzilla.gnome.org/show_bug.cgi?id=642403
-rw-r--r--lib/widgets/ephy-location-entry.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 0ad827757..2cf4c036d 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -57,6 +57,8 @@ struct _EphyLocationEntryPrivate
GdkPixbuf *favicon;
GdkRGBA secure_bg_color;
GdkRGBA secure_fg_color;
+ GdkRGBA secure_selected_bg_color;
+ GdkRGBA secure_selected_fg_color;
GSList *search_terms;
@@ -132,6 +134,8 @@ ephy_location_entry_style_updated (GtkWidget *widget)
GtkStyleContext *style;
GdkRGBA *bg_color = NULL;
GdkRGBA *fg_color = NULL;
+ GdkRGBA *selected_bg_color = NULL;
+ GdkRGBA *selected_fg_color = NULL;
char *theme;
gboolean is_a11y_theme;
@@ -151,6 +155,8 @@ ephy_location_entry_style_updated (GtkWidget *widget)
gtk_style_context_get_style (style,
"secure-fg-color", &fg_color,
"secure-bg-color", &bg_color,
+ "secure-selected-bg-color", &selected_bg_color,
+ "secure-selected-fg-color", &selected_fg_color,
NULL);
/* We only use the fallback colors when we don't have an a11y theme */
@@ -175,6 +181,24 @@ ephy_location_entry_style_updated (GtkWidget *widget)
{
priv->secure_bg_color = fallback_bg_color;
}
+ if (selected_bg_color != NULL)
+ {
+ priv->secure_selected_bg_color = *selected_bg_color;
+ gdk_rgba_free (selected_bg_color);
+ }
+ else
+ {
+ gtk_style_context_lookup_color (style, "selected_bg_color", &priv->secure_selected_bg_color);
+ }
+ if (selected_fg_color != NULL)
+ {
+ priv->secure_selected_fg_color = *selected_fg_color;
+ gdk_rgba_free (selected_fg_color);
+ }
+ else
+ {
+ gtk_style_context_lookup_color (style, "selected_fg_color", &priv->secure_selected_fg_color);
+ }
/* Apply the new style */
ephy_location_entry_set_secure (entry, priv->secure);
@@ -312,6 +336,18 @@ ephy_location_entry_class_init (EphyLocationEntryClass *klass)
"Foreground colour to use for secure sites",
GDK_TYPE_RGBA,
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boxed ("secure-selected-bg-color",
+ "Secure selection background Colour",
+ "Background colour to use for selected text on secure sites",
+ GDK_TYPE_RGBA,
+ G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boxed ("secure-selected-fg-color",
+ "Secure selection foreground Colour",
+ "Foreground colour to use for selected text on secure sites",
+ GDK_TYPE_RGBA,
+ G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_type_class_add_private (object_class, sizeof (EphyLocationEntryPrivate));
}
@@ -1623,10 +1659,14 @@ ephy_location_entry_set_secure (EphyLocationEntry *entry,
{
gtk_widget_override_color (gentry, GTK_STATE_FLAG_NORMAL, &priv->secure_fg_color);
gtk_widget_override_background_color (gentry, GTK_STATE_FLAG_NORMAL, &priv->secure_bg_color);
+ gtk_widget_override_color (gentry, GTK_STATE_FLAG_SELECTED, &priv->secure_selected_fg_color);
+ gtk_widget_override_background_color (gentry, GTK_STATE_FLAG_SELECTED, &priv->secure_selected_bg_color);
}
else
{
gtk_widget_override_color (gentry, GTK_STATE_FLAG_NORMAL, NULL);
+ gtk_widget_override_color (gentry, GTK_STATE_FLAG_SELECTED, NULL);
+ gtk_widget_override_background_color (gentry, GTK_STATE_FLAG_SELECTED, NULL);
gtk_widget_override_background_color (gentry, GTK_STATE_FLAG_NORMAL, NULL);
}
gtk_widget_queue_draw (widget);