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.
This commit is contained in:
parent
8396fc5022
commit
708f075f80
1 changed files with 21 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue