Tool buttons alignment

Vladimir Prus ghost at cs.msu.su
Fri May 2 12:25:35 UTC 2008


On Friday 02 May 2008 15:50:01 Kris Wong wrote:
> > yesterday on IRC Alexander and I talked that it would be nice
> > to have the left side
> > or the bottom tool buttons bar to be aligned with the left
> > side of the editor area.
> > Now, the left side is at the left side of the window, which
> > makes it unclear what
> > that left button applies to.
> >
> > I've looked into implementing this, but it's not exactly
> > straightforward. Right
> > now, main window uses QGridLayout at top level, having the
> > tool button bars and
> > the central area. The central area uses IdealMainLayout as layout.
> > So, keeping the button bar left aligned with the editor even
> > if left tool is shown
> > and hidden is gonna be messy. I think the best way would be
> > to make tool button
> > bars managed by the same IdealMainLayout. Some questions:
> 
> --------------------------------------------------------------
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> |   |                                                    |   |
> --------------------------------------------------------------
> | X |                                                    | X |
> --------------------------------------------------------------
> 
> If we are using QGridLayout, this seems like it should not be too hard
> to do.  Essentially you have 3 columns and 2 rows, with the X's
> representing spacer items.  These cells would be empty.  Or am I missing
> something?

In your picture above, the middle area is IdealMainWidget, that contains
both toolviews and the editor area. If we want to left-align buttons
with the left side of the editor, we have to know how wide the left
tool area is -- which is private to ideallayout.

- Volodya




More information about the KDevelop-devel mailing list