[libchamplain/libchamplain-0-4] Fix selection color being always blue
- From: Pierre-Luc Beaudoin <plbeaudoin src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libchamplain/libchamplain-0-4] Fix selection color being always blue
- Date: Mon, 19 Oct 2009 05:14:20 +0000 (UTC)
commit 4c92b1a0d408f1f95ba0bcd4e43f98c51814d1c3
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date: Sun Oct 18 23:16:26 2009 -0400
Fix selection color being always blue
champlain-gtk/gtk-champlain-embed.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/champlain-gtk/gtk-champlain-embed.c b/champlain-gtk/gtk-champlain-embed.c
index 9d6b43c..ea7193d 100644
--- a/champlain-gtk/gtk-champlain-embed.c
+++ b/champlain-gtk/gtk-champlain-embed.c
@@ -209,7 +209,6 @@ gtk_champlain_embed_init (GtkChamplainEmbed *embed)
{
ClutterColor stage_color = { 0x34, 0x39, 0x39, 0xff };
ClutterActor *stage;
- GtkStyle *style;
GtkChamplainEmbedPrivate *priv = GET_PRIVATE (embed);
embed->priv = priv;
@@ -245,22 +244,26 @@ gtk_champlain_embed_init (GtkChamplainEmbed *embed)
gtk_container_add (GTK_CONTAINER (embed), priv->clutter_embed);
- /* Set selection color */
- style = gtk_widget_get_style (GTK_WIDGET (embed));
- ClutterColor color = {0, 0, 0, };
- gtk_clutter_get_bg_color (GTK_WIDGET (embed), GTK_STATE_SELECTED, &color);
- champlain_marker_set_highlight_color (&color);
-
}
static void
view_realize_cb (GtkWidget *widget,
GtkChamplainEmbed *view)
{
+ ClutterColor color = {0, 0, 0, };
GtkChamplainEmbedPrivate *priv = view->priv;
- // Setup mouse cursor to a hand
+ /* Setup mouse cursor to a hand */
gdk_window_set_cursor (gtk_widget_get_window (priv->clutter_embed), priv->cursor_hand_open);
+
+ /* Set selection color */
+ gtk_clutter_get_bg_color (GTK_WIDGET (widget), GTK_STATE_SELECTED, &color);
+ champlain_marker_set_highlight_color (&color);
+
+ gtk_clutter_get_text_color (GTK_WIDGET (widget), GTK_STATE_SELECTED, &color);
+ champlain_marker_set_highlight_text_color (&color);
+
+ /* To be added later: bg[active] (for selected markers, but focus is on another widget) */
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]