Bug 364034

Summary: toolbox layout class is broken in many ways
Product: [Applications] krita Reporter: Zafio <j>
Component: UsabilityAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: archtan11, halla, m999, nicolas.bougere, rebuilderster, sven.langkamp
Priority: NOR    
Version First Reported In: 3.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
URL: http://imgur.com/rg0Vxy9
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: schema
Adds 'Assistant Tool' to a different group to circumvent misalignment (hack)

Description Zafio 2016-06-06 19:30:07 UTC
The icon seems separated with some extra GUI separator elements, perhaps to separate the assistant tool icon from the gradient tool?
While I understand how and why it might be intentional, it doesn't do any good to the UI. 

Reproducible: Always

Steps to Reproduce:
1. As Krita opens by default it's already noticeable the wrong icon alignment
2. Grab the border of the toolbox and contract the toolbar further to the left
3. The Assistant tool icon is displaced to a new row below.

Actual Results:  
http://imgur.com/rg0Vxy9

Expected Results:  
I expect that icon to be correctly aligned
Comment 1 Sven Langkamp 2016-06-06 19:51:26 UTC
Confirmed. The vertical seperator pushes the button a bit to the right.
Comment 2 Sven Langkamp 2016-06-06 19:51:44 UTC
Confirmed. The vertical seperator pushes the button a bit to the right.
Comment 3 z-uo 2016-08-03 17:43:51 UTC
Created attachment 100437 [details]
schema
Comment 4 z-uo 2016-08-03 17:45:09 UTC
Comment on attachment 100437 [details]
schema

Here the button is not clicable when it is on the same row as the color picker
Comment 5 Halla Rempt 2016-08-23 17:06:31 UTC
Actually, it's because it's in a group of its own. The layout code here is pretty problematical.
Comment 6 Joseph-Eugene Winzer 2016-08-24 00:30:12 UTC
Created attachment 100737 [details]
Adds 'Assistant Tool' to a different group to circumvent misalignment (hack)

(Figuring out how the ToolBox rendering works for a whole day, just to see you giving an answer a few hours earlier.. :O  )

It's just as Boudewijn said, the layout code works as intended.
A possible solution could be that every tool type needs to start on a 'new line'
or we need more TOOL_TYPE_VIEW tools, so that it won't misalign with common toolbox dimensions.
Or resize the toolbox in a way that the 'Assistant Tool' gets pushed on its own row yourself,
what would be the easiest solution, I guess..

But, if it is really bothering you, you can recompile krita with this little hack.
(It prevents the top/left seperators being drawn by adding 'Assistant Tool' to the group TOOL_TYPE_FILL that is next to it.)
Comment 7 Halla Rempt 2016-08-24 08:56:35 UTC
We really need to sit down and rewrite this code from scratch -- it's also broken in that it sometimes becomes impossible to click on a button. The guy who wrote this in 2004 or so has disappeared since then, and the code is pretty impenetrable to me.
Comment 8 Joseph-Eugene Winzer 2016-08-24 17:51:27 UTC
I am glad you think like that.
Is there a bug report to the unclickable toolbox buttons that describes a reliable way to reproduce it?
The only report I found like that was  https://bugs.kde.org/show_bug.cgi?id=355544  and I can't reproduce it..
Comment 9 Joseph-Eugene Winzer 2016-08-24 18:13:11 UTC
Okay, I found a way to reproduce the problem.
I described the steps in  https://bugs.kde.org/show_bug.cgi?id=363253  and recommend reopening it.
Comment 10 Halla Rempt 2016-10-22 06:41:19 UTC
*** Bug 355544 has been marked as a duplicate of this bug. ***
Comment 11 Halla Rempt 2016-10-22 06:41:28 UTC
*** Bug 371476 has been marked as a duplicate of this bug. ***
Comment 12 Halla Rempt 2016-10-22 06:42:41 UTC
One bug for this issue is enough...
Comment 13 Halla Rempt 2016-10-22 13:27:49 UTC
Git commit 45a5e1d0fa73830e1626b107e59f8296897ea623 by Boudewijn Rempt.
Committed on 22/10/2016 at 13:26.
Pushed by rempt into branch 'master'.

Since sections can overlap (if a section occupies two rows, and there
is space on the second row for all of the next section, the next section
will be placed overlapping with the previous section), it's important that
later sections will be higher in the widget z-order than previous
sections, so raise it.

M  +1    -1    libs/widgets/KoToolBox.cpp
M  +0    -1    libs/widgets/KoToolBoxButton_p.h
M  +49   -0    libs/widgets/KoToolBoxLayout_p.h

http://commits.kde.org/krita/45a5e1d0fa73830e1626b107e59f8296897ea623