[glide] Use the inspector color button in glide-window now



commit 1744897ce2cdf39e3581c04e1954f6f58e64e071
Author: Robert Carr <racarr Valentine localdomain>
Date:   Sun May 2 03:13:39 2010 -0400

    Use the inspector color button in glide-window now

 src/glide-inspector-notebook.c |   13 +++++++++++++
 src/glide-inspector-notebook.h |    4 ++++
 src/glide-inspector-text.c     |   15 +++++++++++++++
 src/glide-inspector-text.h     |    3 +++
 src/glide-window.c             |   20 +++-----------------
 5 files changed, 38 insertions(+), 17 deletions(-)
---
diff --git a/src/glide-inspector-notebook.c b/src/glide-inspector-notebook.c
index 0f5dfe3..2bef319 100644
--- a/src/glide-inspector-notebook.c
+++ b/src/glide-inspector-notebook.c
@@ -198,3 +198,16 @@ glide_inspector_notebook_set_stage_manager (GlideInspectorNotebook *inspector,
   
   g_object_notify (G_OBJECT (inspector), "stage-manager");
 }
+
+void
+glide_inspector_notebook_get_text_color (GlideInspectorNotebook *ins,
+					 ClutterColor *cc)
+{
+  glide_inspector_text_get_color (GLIDE_INSPECTOR_TEXT (ins->priv->inspector_text), cc);
+}
+
+const gchar *
+glide_inspector_notebook_get_font_name (GlideInspectorNotebook *ins)
+{
+  return glide_inspector_text_get_font_name (GLIDE_INSPECTOR_TEXT (ins->priv->inspector_text));
+}
diff --git a/src/glide-inspector-notebook.h b/src/glide-inspector-notebook.h
index e14eea9..428004b 100644
--- a/src/glide-inspector-notebook.h
+++ b/src/glide-inspector-notebook.h
@@ -56,6 +56,10 @@ GtkWidget *glide_inspector_notebook_new (void);
 GlideStageManager *glide_inspector_notebook_get_stage_manager (GlideInspectorNotebook *inspector);
 void glide_inspector_notebook_set_stage_manager (GlideInspectorNotebook *inspector, GlideStageManager *manager);
 
+void glide_inspector_notebook_get_text_color (GlideInspectorNotebook *ins, ClutterColor *cc);
+const gchar *glide_inspector_notebook_get_font_name (GlideInspectorNotebook *ins);
+
+
 G_END_DECLS
 
 #endif
diff --git a/src/glide-inspector-text.c b/src/glide-inspector-text.c
index 9274ec5..eaa86c4 100644
--- a/src/glide-inspector-text.c
+++ b/src/glide-inspector-text.c
@@ -374,3 +374,18 @@ glide_inspector_text_set_actor (GlideInspectorText *inspector,
   
   g_object_notify (G_OBJECT (inspector), "actor");
 }
+
+const gchar *
+glide_inspector_text_get_font_name (GlideInspectorText *ins)
+{
+  return glide_text_get_font_name (GLIDE_TEXT (ins->priv->actor));
+}
+
+void
+glide_inspector_text_get_color (GlideInspectorText *ins, ClutterColor *cc)
+{
+  GdkColor c;
+  
+  gtk_color_button_get_color (GTK_COLOR_BUTTON (ins->priv->color_button), &c);
+  glide_clutter_color_from_gdk_color (&c, cc);
+}
diff --git a/src/glide-inspector-text.h b/src/glide-inspector-text.h
index ff752d6..7e5365b 100644
--- a/src/glide-inspector-text.h
+++ b/src/glide-inspector-text.h
@@ -56,6 +56,9 @@ GtkWidget *glide_inspector_text_new (void);
 GlideActor *glide_inspector_text_get_actor (GlideInspectorText *inspector);
 void glide_inspector_text_set_actor (GlideInspectorText *inspector, GlideActor *actor);
 
+const gchar *glide_inspector_text_get_font_name (GlideInspectorText *ins);
+void glide_inspector_text_get_color (GlideInspectorText *ins, ClutterColor *cc);
+
 G_END_DECLS
 
 #endif
diff --git a/src/glide-window.c b/src/glide-window.c
index 54809dc..bc0a0ce 100644
--- a/src/glide-window.c
+++ b/src/glide-window.c
@@ -259,14 +259,6 @@ glide_window_stage_selection_changed_cb (GlideStageManager *manager,
   
   if (selection && (GLIDE_IS_TEXT (selection)))
     {
-      GdkColor c;
-      ClutterColor cc;
-      
-      glide_text_get_color (GLIDE_TEXT (selection), &cc);
-      glide_gdk_color_from_clutter_color (&cc, &c);
-
-      gtk_color_button_set_color (GTK_COLOR_BUTTON (gtk_builder_get_object (w->priv->builder, "text-color-button")), &c);
-
       gtk_font_button_set_font_name (GTK_FONT_BUTTON (gtk_builder_get_object (w->priv->builder, "text-font-button")),
 				     glide_text_get_font_name (GLIDE_TEXT (selection)));
 
@@ -692,11 +684,8 @@ glide_window_paste_contents_text_received (GtkClipboard *clipboard,
     {
       ClutterActor *ntext = glide_text_new ();
       ClutterColor cc;
-      GdkColor c;
-      
-      gtk_color_button_get_color (GTK_COLOR_BUTTON (gtk_builder_get_object (w->priv->builder, "text-color-button")),
-				  &c);
-      glide_clutter_color_from_gdk_color (&c, &cc);
+
+      glide_inspector_notebook_get_text_color (GLIDE_INSPECTOR_NOTEBOOK (w->priv->inspector_notebook), &cc);
       
       glide_text_set_color (GLIDE_TEXT (ntext), &cc);
       
@@ -1076,11 +1065,8 @@ glide_window_new_text_action_activate (GtkAction *a,
   GlideWindow *w = (GlideWindow *)user_data;
   ClutterActor *text = glide_text_new ();
   ClutterColor cc;
-  GdkColor c;
   
-  gtk_color_button_get_color (GTK_COLOR_BUTTON (gtk_builder_get_object (w->priv->builder, "text-color-button")),
-			      &c);
-  glide_clutter_color_from_gdk_color (&c, &cc);
+  glide_inspector_notebook_get_text_color (GLIDE_INSPECTOR_NOTEBOOK (w->priv->inspector_notebook), &cc);
   
   glide_text_set_color (GLIDE_TEXT (text), &cc);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]