[gimp] app: reorganize widgets in two lines
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: reorganize widgets in two lines
- Date: Thu, 4 Mar 2010 20:37:38 +0000 (UTC)
commit 8434bf927621c4d89dd4a1df5e53ba9ce787475a
Author: Michael Natterer <mitch gimp org>
Date: Thu Mar 4 14:32:36 2010 +0100
app: reorganize widgets in two lines
this so needs a clear ui concept...
app/widgets/gimptextstyleeditor.c | 37 ++++++++++++++++++++++++++-----------
app/widgets/gimptextstyleeditor.h | 15 +++++++--------
2 files changed, 33 insertions(+), 19 deletions(-)
---
diff --git a/app/widgets/gimptextstyleeditor.c b/app/widgets/gimptextstyleeditor.c
index 52bf594..f48c8f3 100644
--- a/app/widgets/gimptextstyleeditor.c
+++ b/app/widgets/gimptextstyleeditor.c
@@ -100,7 +100,7 @@ static gboolean gimp_text_style_editor_update_idle (GimpTextStyleEditor *e
G_DEFINE_TYPE (GimpTextStyleEditor, gimp_text_style_editor,
- GTK_TYPE_HBOX)
+ GTK_TYPE_VBOX)
#define parent_class gimp_text_style_editor_parent_class
@@ -161,9 +161,16 @@ gimp_text_style_editor_init (GimpTextStyleEditor *editor)
{
GtkWidget *image;
+ /* upper row */
+
+ editor->upper_hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (editor), editor->upper_hbox, FALSE, FALSE, 0);
+ gtk_widget_show (editor->upper_hbox);
+
editor->font_entry = gimp_container_entry_new (NULL, NULL,
GIMP_VIEW_SIZE_SMALL, 1);
- gtk_box_pack_start (GTK_BOX (editor), editor->font_entry, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (editor->upper_hbox), editor->font_entry,
+ FALSE, FALSE, 0);
gtk_widget_show (editor->font_entry);
/* don't let unhandled key events drop through to the text editor */
@@ -174,9 +181,22 @@ gimp_text_style_editor_init (GimpTextStyleEditor *editor)
G_CALLBACK (gtk_false),
NULL);
+ editor->size_label = gtk_label_new ("0.0");
+ gtk_misc_set_padding (GTK_MISC (editor->size_label), 2, 0);
+ gtk_box_pack_start (GTK_BOX (editor->upper_hbox), editor->size_label,
+ FALSE, FALSE, 0);
+ gtk_widget_show (editor->size_label);
+
+ /* lower row */
+
+ editor->lower_hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (editor), editor->lower_hbox, FALSE, FALSE, 0);
+ gtk_widget_show (editor->lower_hbox);
+
editor->clear_button = gtk_button_new ();
gtk_widget_set_can_focus (editor->clear_button, FALSE);
- gtk_box_pack_start (GTK_BOX (editor), editor->clear_button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (editor->lower_hbox), editor->clear_button,
+ FALSE, FALSE, 0);
gtk_widget_show (editor->clear_button);
gimp_help_set_help_data (editor->clear_button,
@@ -190,17 +210,12 @@ gimp_text_style_editor_init (GimpTextStyleEditor *editor)
gtk_container_add (GTK_CONTAINER (editor->clear_button), image);
gtk_widget_show (image);
- editor->size_label = gtk_label_new ("0.0");
- gtk_misc_set_padding (GTK_MISC (editor->size_label), 2, 0);
- gtk_box_pack_end (GTK_BOX (editor), editor->size_label, FALSE, FALSE, 0);
- gtk_widget_show (editor->size_label);
-
editor->kerning_adjustment =
GTK_ADJUSTMENT (gtk_adjustment_new (0.0, -1000.0, 1000.0, 1.0, 10.0, 0.0));
editor->kerning_spinbutton = gtk_spin_button_new (editor->kerning_adjustment,
1.0, 1);
gtk_entry_set_width_chars (GTK_ENTRY (editor->kerning_spinbutton), 5);
- gtk_box_pack_end (GTK_BOX (editor), editor->kerning_spinbutton,
+ gtk_box_pack_end (GTK_BOX (editor->lower_hbox), editor->kerning_spinbutton,
FALSE, FALSE, 0);
gtk_widget_show (editor->kerning_spinbutton);
@@ -213,7 +228,7 @@ gimp_text_style_editor_init (GimpTextStyleEditor *editor)
editor->baseline_spinbutton = gtk_spin_button_new (editor->baseline_adjustment,
1.0, 1);
gtk_entry_set_width_chars (GTK_ENTRY (editor->baseline_spinbutton), 5);
- gtk_box_pack_end (GTK_BOX (editor), editor->baseline_spinbutton,
+ gtk_box_pack_end (GTK_BOX (editor->lower_hbox), editor->baseline_spinbutton,
FALSE, FALSE, 0);
gtk_widget_show (editor->baseline_spinbutton);
@@ -457,7 +472,7 @@ gimp_text_style_editor_create_toggle (GimpTextStyleEditor *editor,
toggle = gtk_toggle_button_new ();
gtk_widget_set_can_focus (toggle, FALSE);
- gtk_box_pack_start (GTK_BOX (editor), toggle, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (editor->lower_hbox), toggle, FALSE, FALSE, 0);
gtk_widget_show (toggle);
editor->toggles = g_list_append (editor->toggles, toggle);
diff --git a/app/widgets/gimptextstyleeditor.h b/app/widgets/gimptextstyleeditor.h
index 4c6806d..d92efcc 100644
--- a/app/widgets/gimptextstyleeditor.h
+++ b/app/widgets/gimptextstyleeditor.h
@@ -34,7 +34,7 @@ typedef struct _GimpTextStyleEditorClass GimpTextStyleEditorClass;
struct _GimpTextStyleEditor
{
- GtkHBox parent_instance;
+ GtkVBox parent_instance;
Gimp *gimp;
GimpContext *context;
@@ -45,12 +45,13 @@ struct _GimpTextStyleEditor
gdouble resolution_x;
gdouble resolution_y;
+ GtkWidget *upper_hbox;
+ GtkWidget *lower_hbox;
+
GtkWidget *font_entry;
+ GtkWidget *size_label;
+
GtkWidget *clear_button;
- GtkWidget *bold_toggle;
- GtkWidget *italic_toggle;
- GtkWidget *underline_toggle;
- GtkWidget *strikethrough_toggle;
GtkWidget *baseline_spinbutton;
GtkAdjustment *baseline_adjustment;
@@ -58,8 +59,6 @@ struct _GimpTextStyleEditor
GtkWidget *kerning_spinbutton;
GtkAdjustment *kerning_adjustment;
- GtkWidget *size_label;
-
GList *toggles;
guint update_idle_id;
@@ -67,7 +66,7 @@ struct _GimpTextStyleEditor
struct _GimpTextStyleEditorClass
{
- GtkHBoxClass parent_class;
+ GtkVBoxClass parent_class;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]