[glide] Start implementing text inspector



commit 4671773548649bc8322f9846ecfc0af96f336b18
Author: Robert Carr <racarr Valentine localdomain>
Date:   Sun May 2 02:00:14 2010 -0400

    Start implementing text inspector

 src/glide-inspector-text-priv.h |    4 +++
 src/glide-inspector-text.c      |   44 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 0 deletions(-)
---
diff --git a/src/glide-inspector-text-priv.h b/src/glide-inspector-text-priv.h
index fbdd164..dae7660 100644
--- a/src/glide-inspector-text-priv.h
+++ b/src/glide-inspector-text-priv.h
@@ -27,6 +27,10 @@ G_BEGIN_DECLS
 struct _GlideInspectorTextPrivate
 {
   GlideActor *actor;
+  
+  GtkWidget *font_button;
+  
+  gboolean ignore_set;
 };
 
 G_END_DECLS
diff --git a/src/glide-inspector-text.c b/src/glide-inspector-text.c
index ffc4368..9bcdec0 100644
--- a/src/glide-inspector-text.c
+++ b/src/glide-inspector-text.c
@@ -38,6 +38,17 @@ enum {
 };
 
 static void
+glide_inspector_text_update_fontname (GlideInspectorText *ins)
+{
+  const gchar *fontname = glide_text_get_font_name (GLIDE_TEXT (ins->priv->actor));
+
+  ins->priv->ignore_set = TRUE;
+  gtk_font_button_set_font_name (GTK_FONT_BUTTON (ins->priv->font_button), fontname);
+  ins->priv->ignore_set = FALSE;
+}
+
+
+static void
 glide_inspector_text_finalize (GObject *object)
 {
   
@@ -81,6 +92,36 @@ glide_inspector_text_set_property (GObject *object,
     }
 }
 
+static GtkWidget *
+glide_inspector_text_make_font_box (GlideInspectorText *ins)
+{ 
+  GtkWidget *ret = gtk_hbox_new (FALSE, 0);
+  GtkWidget *label = gtk_label_new (NULL);
+  GtkWidget *align = gtk_alignment_new (1, 0, 0.6, 1);
+  GtkWidget *button = gtk_font_button_new ();
+  
+  gtk_label_set_markup (GTK_LABEL (label), "<b>Font:</b>");
+  
+  gtk_container_add (GTK_CONTAINER (align), button);
+  
+  gtk_box_pack_start (GTK_BOX(ret), label, FALSE, FALSE, 0);
+  gtk_box_pack_start (GTK_BOX(ret), align, TRUE, TRUE, 0);
+  
+  ins->priv->font_button = button;
+  return ret;
+}
+
+static void
+glide_inspector_text_setup_ui (GlideInspectorText *ins)
+{  
+  GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
+  GtkWidget *font_box = glide_inspector_text_make_font_box (ins);
+  
+  gtk_box_pack_start (GTK_BOX (vbox), font_box, FALSE, FALSE, 0);
+  
+  gtk_container_add (GTK_CONTAINER (ins), vbox);
+}
+
 static void
 glide_inspector_text_init (GlideInspectorText *inspector)
 {
@@ -88,6 +129,8 @@ glide_inspector_text_init (GlideInspectorText *inspector)
   
   gtk_widget_set_sensitive (GTK_WIDGET (inspector), FALSE);
 
+  glide_inspector_text_setup_ui (inspector);
+
   gtk_alignment_set (GTK_ALIGNMENT (inspector), .5, 0, 0.8, 1.0);
   gtk_alignment_set_padding (GTK_ALIGNMENT (inspector), 5, 0, 0, 0);
 }
@@ -138,6 +181,7 @@ glide_inspector_text_set_actor (GlideInspectorText *inspector,
   else
     {
       gtk_widget_set_sensitive (GTK_WIDGET (inspector), TRUE);
+      glide_inspector_text_update_fontname (inspector);
     }
   
   g_object_notify (G_OBJECT (inspector), "actor");



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