Widen dock separators to make them easier to grab (#277)#595
Widen dock separators to make them easier to grab (#277)#595HaozheZhang6 wants to merge 3 commits into
Conversation
jmwright
left a comment
There was a problem hiding this comment.
Thanks for this @HaozheZhang6
There's just one quick change that I suggested.
| self.viewer = OCCViewer(self) | ||
| self.setCentralWidget(self.viewer.canvas) | ||
|
|
||
| # Widen the dock separators so they are easy to grab. The default handle |
There was a problem hiding this comment.
I try to avoid restating issues in code comments. Maybe something like # Make sure the dock separators are wide enough to grab on high-DPI displays
|
Good call, reworded it. |
|
@HaozheZhang6 In testing this branch, it looks like the stylesheet changes causes other theme-specific styles to revert to the default, which breaks things like the editor syntax highlighting.
|
A stylesheet on the main window moves its whole widget subtree to QStyleSheetStyle, which drops palette based theming (the syntax highlighting regression seen in review).
|
Fixed. The stylesheet was the problem: any stylesheet on the main window flips the whole subtree to QStyleSheetStyle, which drops palette based theming. Replaced it with a QProxyStyle that only overrides PM_DockWidgetSeparatorExtent. Added tests. |

Fixes #277.
On macOS / high-DPI displays the dock separators are only a couple of pixels wide, so grabbing them to resize the panels is very hard. This adds a
QMainWindow::separatorstylesheet inMainWindow.__init__to widen them to 6px.This is the fix @lorenzncode identified and @bendavis78 confirmed (5-10px comfortable) in the issue, matching the qss approach @adam-urbanczyk asked for there. The light/dark themes don't style
QMainWindow::separator, so a theme switch won't clobber it. Verified the stylesheet applies cleanly on a PyQt5 QMainWindow with docks.