Skip to content

Fix broken margins with KPageDialog & KPageView

When adding support for a footer & a header as well as having the navigation view take full-window height in dialogs, the margins e.g. between top and header or around the button box suffered a bit and no longer followed style, making settings dialog stay out from other dialogs or look broken. This was due to not ensuring needed margin or abusing spacing between cells by triggering additional otherwise empty columns/rows of the until-now used QGridLayout to get some kind of margin, though not the real style one.

This patch adds official support for the new navigation-takes-full-window- extent mode to KPageView and redoes the inner UI logic to properly support it without breaking style.

See the broken margins before, by example of KDevelop:

Note different margins to right and to bottom (and both non-normal dialog margin)

Assistant_dialog_margin

Note the missing margin between top window border and the header, as well as small non-normal-dialog margins to right and to bottom

Settinge_dialog_margins

For reference of normal-dialog margins here the margins around a file dialog

File_dialog_margins

To get an idea how the old grid layout was filled in the different forms, see some ASCII drawing I used to see myself:

Tabbed: (nav pos=top)
+--------+--------+
|        |        |
+--------+--------+
|        | header |
+--------+--------+
|        | nav    |
+--------+--------+
|        | footer |
+--------+--------+
Plain: (nav pos=top)
+--------+--------+--------+
|        |        |        |
+--------+--------+--------+
|        |     header      |
+--------+--------+--------+
|        | sta/na |        |
+--------+--------+--------+
|        | footer |        |
+--------+--------+--------+
Not tabbed: (nav pos=top) <- theory if viewPosition subclassed
+--------+--------+--------+
|        |        |        |
+--------+--------+--------+
|        |     header      |
+--------+--------+--------+
|        | sta/na |        |
+--------+--------+--------+
|        | footer |        |
+--------+--------+--------+
|        |        |        |
+--------+--------+--------+
Not tabbed: (nav pos=left)
+--------+--------+--------+
|        |        |        |
+--------+--------+--------+
|        |     header      |
+        +--------+--------+
|        | stack  |        |
+  nav   +--------+--------+
|        | footer |        |
+        +--------+--------+
|        |        |        |
+--------+--------+--------+
Not tabbed: (nav pos=bottom)
+--------+--------+--------+
|        |        |        |
+--------+--------+--------+
|        |     header      |
+--------+--------+--------+
|        | stack  |        |
+--------+--------+--------+
|        | footer |        |
+--------+--------+--------+
|  nav   |        |        |
+--------+--------+--------+
Not tabbed: (nav pos=right)
+--------+--------+--------+
|        |        |        |
+--------+--------+--------+
|        |     header      |
+--------+--------+        +
|        | stack  |        |
+--------+--------+  nav   +
|        | footer |        |
+--------+--------+        +
|        |        |        |
+--------+--------+--------+

Merge request reports