You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Snap layouts are a new Windows 11 feature to help introduce users to the power of window snapping. Snap layouts are easily accessible by hovering the mouse over a window's maximize button or pressing Win +Z. After invoking the menu that shows the available layouts, users can click on a zone in a layout to snap a window to that particular zone and then use Snap Assist to finish building an entire layout of windows.
Implementation
PyQt-Frameless-Window does not enable the snap layout feature by default, because users may change the maximize button in the title bar. Here is an example code to enable snap layout when using the default title bar. You should replace the WindowsFramelessWindow.nativeEvent() in qframelesswindow/windows/__init__.py with the following code:
We use self.titleBar.childAt(pos-self.geometry().topLeft()) rather than self.titleBar.childAt(xPos, yPos), because the size of frameless window will be larger than the screen when the window is maximized.
You can also inherit FramelessWindow to rewrite nativeEvent:
Description
Snap layouts are a new Windows 11 feature to help introduce users to the power of window snapping. Snap layouts are easily accessible by hovering the mouse over a window's maximize button or pressing Win +Z. After invoking the menu that shows the available layouts, users can click on a zone in a layout to snap a window to that particular zone and then use Snap Assist to finish building an entire layout of windows.
Implementation
PyQt-Frameless-Window does not enable the snap layout feature by default, because users may change the maximize button in the title bar. Here is an example code to enable snap layout when using the default title bar. You should replace the
WindowsFramelessWindow.nativeEvent()
inqframelesswindow/windows/__init__.py
with the following code:We use
self.titleBar.childAt(pos-self.geometry().topLeft())
rather thanself.titleBar.childAt(xPos, yPos)
, because the size of frameless window will be larger than the screen when the window is maximized.You can also inherit
FramelessWindow
to rewritenativeEvent
:The text was updated successfully, but these errors were encountered: