hyperspyUI icon indicating copy to clipboard operation
hyperspyUI copied to clipboard

QDockWidgets Titlebar have giant toolbars on Mac

Open thomasaarholt opened this issue 8 years ago • 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

thomasaarholt avatar Apr 13 '17 17:04 thomasaarholt

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

thomasaarholt avatar Apr 13 '17 17:04 thomasaarholt

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).

vidartf avatar Apr 16 '17 13:04 vidartf

See comments to #133

thomasaarholt avatar Apr 16 '17 19:04 thomasaarholt

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

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

thomasaarholt avatar Apr 20 '17 20:04 thomasaarholt

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.

thomasaarholt avatar Apr 20 '17 20:04 thomasaarholt

Does the other paddings work if you replace the icons?

vidartf avatar Apr 21 '17 08:04 vidartf

Will try tonight.

thomasaarholt avatar Apr 21 '17 08:04 thomasaarholt

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

thomasaarholt avatar Apr 22 '17 10:04 thomasaarholt

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

thomasaarholt avatar Apr 22 '17 10:04 thomasaarholt

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

thomasaarholt avatar Apr 22 '17 10:04 thomasaarholt