hyperspy/hyperspyUI

QDockWidgets Titlebar have giant toolbars on Mac

thomasaarholt opened this issue · 10 comments

The Titlebar of the docked windows in the UI are very vertically wide on Mac. On Linux and Windows they look great.

screenshot 2017-04-13 19 00 15

Undocked they look like this:
screenshot 2017-04-13 19 04 44

Could you try the style edit PR ( #133 ), and enter the following in the style editor:

QDockWidget::title {
    padding: 0px;  /* try varying this number */
}

The padding can also be 0px 5px for different padding horz/vert or 4 values for left/right/top/bottom (not sure about order).

See comments to #133

QDockWidget::title {
    padding: 10px;  /* try varying this number */
}

is the minimum padding size I can specify. Will try to play max/min.

padding: 20 works, without the px ending.
Padding seems to be dependent only on the first number, see example and comment below:

QDockWidget::title {
    padding: 10px 20px 30px 40px; /* All just 10*/
}

Edit:
On further testing, only padding-top has any effect, so it seems like all other paddings are "turned off". Negative values have no effect.

Does the other paddings work if you replace the icons?

Will try tonight.

Minimum example that is "acceptable" on my Mac:

QDockWidget::close-button, QDockWidget::float-button {
    icon-size: 15px;
    padding: 1px;
}

screenshot 2017-04-22 12 41 02

Just to show, I can make it a lot more sexy for Mac as well:
screenshot 2017-04-22 12 51 07

Making the button image change on hover is difficult (probably a bug), but there is a workaround:
http://stackoverflow.com/questions/32145080/qdockwidget-float-close-button-hover-images