[gimp] plug-ins: make the applied pattern in qbist a bit more prominent.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: make the applied pattern in qbist a bit more prominent.
- Date: Wed, 24 Mar 2021 00:13:48 +0000 (UTC)
commit 708f075f804caa5cbd11cae2f85f3726456aedcb
Author: Jehan <jehan girinstud io>
Date: Wed Mar 24 01:03:44 2021 +0100
plug-ins: make the applied pattern in qbist a bit more prominent.
The qbist plug-in shows a grid of 9 patterns, it was not clear at all
which one will be applied. Also it looked like selecting a pattern would
make it disappear and loading a same file twice would not create the
same patterns (as said in commit 7fb696206e).
Actually the plug-in works fine, but it is simply not clear at all what
is happening until we look at the code. The center pattern is the main
one: the one which will be applied and the only one which will be stored
or loaded in/from a file if we decide to save the pattern. Also when
selecting a pattern, it does not disappear, it is moved to the center
(but you don't necessarily realize it, especially as several will look
the same). And the reason why you get different result when loading a
saved pattern is that it only reimports the center pattern; all others
are indeed randomized from this stable source.
So my fix is attempting to have this center pattern standing out a bit
more by framing it with a "Pattern" title. It's not perfect, and I'm not
very happy with this design, but I don't find a nice widget for better
framing the center pattern, nor do I want to spend too much time on
this. It's better than before at least.
plug-ins/common/qbist.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/common/qbist.c b/plug-ins/common/qbist.c
index cc052747d1..8b8551ded4 100644
--- a/plug-ins/common/qbist.c
+++ b/plug-ins/common/qbist.c
@@ -888,8 +888,27 @@ dialog_run (void)
for (i = 0; i < 9; i++)
{
button = gtk_button_new ();
- gtk_grid_attach (GTK_GRID (grid), button, i % 3, i / 3, 1, 1);
- // GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
+ if (i == 4)
+ {
+ GtkWidget *frame;
+
+ frame = gtk_frame_new (_("Pattern"));
+ gtk_frame_set_label_align (GTK_FRAME (frame), 0.5, 0.5);
+ gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_OUT);
+ gtk_grid_attach (GTK_GRID (grid), frame, i % 3, i / 3, 1, 2);
+
+ gtk_container_add (GTK_CONTAINER (frame), button);
+ gtk_widget_show (frame);
+ }
+ else if (i > 2)
+ {
+ gtk_grid_attach (GTK_GRID (grid), button, i % 3, i / 3 + 1, 1, 1);
+ }
+ else
+ {
+ gtk_grid_attach (GTK_GRID (grid), button, i % 3, i / 3, 1, 1);
+ }
+ gtk_widget_set_valign (button, GTK_ALIGN_END);
gtk_widget_show (button);
g_signal_connect (button, "clicked",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]