[gimp/alxsa-outline-text-massimo] Updating GUI
- From: Alx Sa <sawyeralex src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/alxsa-outline-text-massimo] Updating GUI
- Date: Wed, 5 Oct 2022 12:09:12 +0000 (UTC)
commit 140bb68742ec1686706bab2f36d31809760f7511
Author: Alx Sa <cmyk student gmail com>
Date: Wed Oct 5 12:09:10 2022 +0000
Updating GUI
app/text/gimptext.c | 7 ------
app/tools/gimptextoptions.c | 60 ++++++++++++++++++++++++++++++---------------
2 files changed, 40 insertions(+), 27 deletions(-)
---
diff --git a/app/text/gimptext.c b/app/text/gimptext.c
index 31ef2f46bf..ddfe45b88b 100644
--- a/app/text/gimptext.c
+++ b/app/text/gimptext.c
@@ -83,7 +83,6 @@ enum
PROP_OUTLINE_JOIN_STYLE,
PROP_OUTLINE_MITER_LIMIT,
PROP_OUTLINE_ANTIALIAS, /* fill-options */
- PROP_OUTLINE_DASH_UNIT, /* NOT USED */
PROP_OUTLINE_DASH_OFFSET,
PROP_OUTLINE_DASH_INFO,
/* for backward compatibility */
@@ -526,9 +525,6 @@ gimp_text_get_property (GObject *object,
case PROP_OUTLINE_ANTIALIAS:
g_value_set_boolean (value, text->outline_antialias);
break;
- case PROP_OUTLINE_DASH_UNIT:
- /* NOT USED */
- break;
case PROP_OUTLINE_DASH_OFFSET:
g_value_set_double (value, text->outline_dash_offset);
break;
@@ -702,9 +698,6 @@ gimp_text_set_property (GObject *object,
case PROP_OUTLINE_ANTIALIAS:
text->outline_antialias = g_value_get_boolean (value);
break;
- case PROP_OUTLINE_DASH_UNIT:
- /* unused */
- break;
case PROP_OUTLINE_DASH_OFFSET:
text->outline_dash_offset = g_value_get_double (value);
break;
diff --git a/app/tools/gimptextoptions.c b/app/tools/gimptextoptions.c
index db1c8599cf..0f374754fc 100644
--- a/app/tools/gimptextoptions.c
+++ b/app/tools/gimptextoptions.c
@@ -81,7 +81,6 @@ enum
PROP_OUTLINE_JOIN_STYLE,
PROP_OUTLINE_MITER_LIMIT,
PROP_OUTLINE_ANTIALIAS, /* fill-options */
- PROP_OUTLINE_DASH_UNIT, /* NOT USED */
PROP_OUTLINE_DASH_OFFSET,
PROP_OUTLINE_DASH_INFO,
PROP_USE_EDITOR,
@@ -131,6 +130,9 @@ static void gimp_text_options_notify_color (GimpContext *contex
static void gimp_text_options_notify_text_color (GimpText *text,
GParamSpec *pspec,
GimpContext *context);
+static void gimp_text_options_outline_changed (GtkWidget *combo,
+ GtkWidget *vbox);
+
G_DEFINE_TYPE_WITH_CODE (GimpTextOptions, gimp_text_options,
@@ -440,9 +442,6 @@ gimp_text_options_get_property (GObject *object,
case PROP_OUTLINE_ANTIALIAS:
g_value_set_boolean (value, options->outline_antialias);
break;
- case PROP_OUTLINE_DASH_UNIT:
- /* NOT USED */
- break;
case PROP_OUTLINE_DASH_OFFSET:
g_value_set_double (value, options->outline_dash_offset);
break;
@@ -559,9 +558,6 @@ gimp_text_options_set_property (GObject *object,
case PROP_OUTLINE_ANTIALIAS:
options->outline_antialias = g_value_get_boolean (value);
break;
- case PROP_OUTLINE_DASH_UNIT:
- /* unused */
- break;
case PROP_OUTLINE_DASH_OFFSET:
options->outline_dash_offset = g_value_get_double (value);
break;
@@ -626,7 +622,6 @@ gimp_text_options_reset (GimpConfig *config)
gimp_config_reset_property (object, "outline-join-style");
gimp_config_reset_property (object, "outline-miter-limit");
gimp_config_reset_property (object, "outline-antialias");
- //gimp_config_reset_property (object, "outline-dash-unit");
gimp_config_reset_property (object, "outline-dash-offset");
gimp_config_reset_property (object, "outline-dash-info");
@@ -756,6 +751,7 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
GtkWidget *combo;
GtkWidget *editor;
GimpStrokeOptions *stroke_options;
+ GtkWidget *outline_vbox;
GtkSizeGroup *size_group;
gint row = 0;
@@ -844,6 +840,24 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
button, 1);
gtk_size_group_add_widget (size_group, button);
+ outline_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL,
+ gtk_box_get_spacing (GTK_BOX (options_vbox)));
+ gtk_box_pack_start (GTK_BOX (options_vbox), outline_vbox, FALSE, FALSE, 0);
+ gtk_widget_show (outline_vbox);
+
+ g_signal_connect (button, "changed",
+ G_CALLBACK (gimp_text_options_outline_changed),
+ outline_vbox);
+ gimp_text_options_outline_changed (button, outline_vbox);
+
+ grid = gtk_grid_new ();
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 2);
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 2);
+ gtk_box_pack_start (GTK_BOX (options_vbox), grid, FALSE, FALSE, 0);
+ gtk_widget_show (grid);
+
+ row = 0;
+
box = gimp_prop_enum_icon_box_new (config, "justify", "format-justify", 0, 0);
gtk_widget_set_halign (box, GTK_ALIGN_START);
gimp_grid_attach_aligned (GTK_GRID (grid), 0, row++,
@@ -880,8 +894,7 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
_("Box:"), 0.0, 0.5,
combo, 1);
stroke_options = gimp_stroke_options_new (GIMP_CONTEXT (options)->gimp,
- NULL,
- FALSE);
+ NULL, FALSE);
#define BIND(a) \
g_object_bind_property (options, "outline-" #a, \
stroke_options, #a, \
@@ -895,23 +908,15 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
BIND (join-style);
BIND (miter-limit);
BIND (antialias);
- // BIND (dash-unit);
BIND (dash-offset);
BIND (dash-info);
- /*
- {
- GimpPattern *pattern = gimp_context_get_pattern (gimp_get_user_context (GIMP_CONTEXT (options)->gimp));
- gimp_context_set_pattern (GIMP_CONTEXT (stroke_options), pattern);
- }
- */
+
editor = gimp_stroke_editor_new (stroke_options, 72.0, TRUE);
- gtk_box_pack_start (GTK_BOX (main_vbox), editor, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (outline_vbox), editor, FALSE, FALSE, 0);
gtk_widget_show (editor);
g_object_unref (stroke_options);
-
-
/* Only add the language entry if the iso-codes package is available. */
#ifdef HAVE_ISO_CODES
@@ -973,6 +978,21 @@ gimp_text_options_editor_notify_font (GimpTextOptions *options,
gimp_text_editor_set_font_name (editor, font_name);
}
+static void
+gimp_text_options_outline_changed (GtkWidget *combo,
+ GtkWidget *vbox)
+{
+ GimpTextOutline active;
+
+ active =
+ (GimpTextOutline) gtk_combo_box_get_active (GTK_COMBO_BOX (combo));
+
+ if (active == GIMP_TEXT_OUTLINE_NONE)
+ gtk_widget_hide (vbox);
+ else
+ gtk_widget_show (vbox);
+}
+
GtkWidget *
gimp_text_options_editor_new (GtkWindow *parent,
Gimp *gimp,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]