Skip to content

Widen dock separators to make them easier to grab (#277)#595

Open
HaozheZhang6 wants to merge 3 commits into
CadQuery:masterfrom
HaozheZhang6:fix/dock-separator-width
Open

Widen dock separators to make them easier to grab (#277)#595
HaozheZhang6 wants to merge 3 commits into
CadQuery:masterfrom
HaozheZhang6:fix/dock-separator-width

Conversation

@HaozheZhang6

Copy link
Copy Markdown

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::separator stylesheet in MainWindow.__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.

@jmwright jmwright left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @HaozheZhang6

There's just one quick change that I suggested.

Comment thread cq_editor/main_window.py Outdated
self.viewer = OCCViewer(self)
self.setCentralWidget(self.viewer.canvas)

# Widen the dock separators so they are easy to grab. The default handle

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@HaozheZhang6

Copy link
Copy Markdown
Author

Good call, reworded it.

@jmwright

Copy link
Copy Markdown
Member

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

Screenshot from 2026-07-15 14-19-09

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

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resizer between the panels at 4k resolution very hard to grab

2 participants