tools: add padding to on-canvas text editor

After the parent of GimpOverlayFrame was changed to a GtkEventBox,
the gtk_container_set_border_width() function no longer worked correctly.
For this reason, this commit manually adds the padding by directly modifying
the widget contained within the overlay, adding external margin.
This commit is contained in:
Gabriele Barbero 2025-06-13 00:56:01 +02:00
parent dab374b2bc
commit 17edeb355d
2 changed files with 10 additions and 2 deletions

View file

@ -221,8 +221,6 @@ gimp_text_tool_editor_start (GimpTextTool *text_tool)
gdouble yres = 1.0; gdouble yres = 1.0;
text_tool->style_overlay = gimp_overlay_frame_new (); text_tool->style_overlay = gimp_overlay_frame_new ();
gtk_container_set_border_width (GTK_CONTAINER (text_tool->style_overlay),
4);
gimp_display_shell_add_overlay (shell, gimp_display_shell_add_overlay (shell,
text_tool->style_overlay, text_tool->style_overlay,
0, 0, 0, 0,

View file

@ -299,6 +299,16 @@ gimp_text_style_editor_init (GimpTextStyleEditor *editor)
g_signal_connect (editor->baseline_adjustment, "value-changed", g_signal_connect (editor->baseline_adjustment, "value-changed",
G_CALLBACK (gimp_text_style_editor_baseline_changed), G_CALLBACK (gimp_text_style_editor_baseline_changed),
editor); editor);
/* Add external spacing to the upper and lower boxes */
gtk_widget_set_margin_top (editor->upper_hbox, 8);
gtk_widget_set_margin_start (editor->upper_hbox, 6);
gtk_widget_set_margin_end (editor->upper_hbox, 6);
gtk_widget_set_margin_start (editor->lower_hbox, 6);
gtk_widget_set_margin_end (editor->lower_hbox, 6);
gtk_widget_set_margin_bottom (editor->lower_hbox, 6);
} }
static void static void