[Uml-devel] [Bug 67058] Alignment of elements in a group

Daniel Calviño Sánchez danxuliu at gmail.com
Wed Apr 5 10:37:13 UTC 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=67058         




------- Additional Comments From danxuliu gmail com  2006-04-04 04:57 -------
Created an attachment (id=15450)
 --> (http://bugs.kde.org/attachment.cgi?id=15450&action=view)
New alignment: distribute; fixes to align icons

The attached file is a tar.gz containing a patch for the AlignToolBar. It also
includes fixed images for the alignment icons: pngs in "pics" directory and
svgs in "pics/sources" directory. As far as I know, "svn diff" doesn't manage
binary files, so I made it this way because of it.


About the icons, I have retouched a bit the existent alignment icons because
arrows weren't symmetrical and added two new icons for the new alignments.


About the patch, it adds two new alignments: horizontal distribute and vertical
distribute. After using a distribute alignment on various widgets, the distance
between each widget and the next to it is the same for all.

I thought in creating a new toolbar for "distribute" commands, as they're not
exactly alignments. However, I left them in the AlignToolBar class, but if you
prefer them in a new class, just tell me and I'll upload a new patch.

As I was editing the AlignToolBar class, I made some minor changes to adapt it
to the general code style in Umbrello (well, at least, the general code style
I've seen in various classes). I also applied an extract method refactoring
pattern in the cases of the main switch. If you prefer a patch without those
changes, tell me ;) By the way, it'd be very useful if the main code style
guidelines were put somewhere, because it'll help to keep a more homogeneous
code.

To implement the distribute commands, I needed to sort the UMLWidgetList using
different orders depending on the distribution selected. I didn't found a way
to make that sorting with QPtrList (the class of UMLWidgetList), so I copied
the pointers to a STL vector, order the vector, and then filled again the
UMLWidgetList. I think that it should exist a simpler way to do it, but I
haven't found it :$




More information about the umbrello-devel mailing list