Skip to content

Commit

Permalink
Draft: Ensure horizontal orientation of snap_widget
Browse files Browse the repository at this point in the history
From time to time when switching to other workbenches snap_widget changes
orientation to vertical. Make sure it stays horizontal.

Signed-off-by: Łukasz Stelmach <stlman@poczta.fm>
  • Loading branch information
steelman committed Apr 19, 2021
1 parent fc6d129 commit d35daae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Mod/Draft/draftutils/init_draft_statusbar.py
Expand Up @@ -340,6 +340,7 @@ def init_draft_statusbar_snap():

# add snap widget to the statusbar
sb.insertPermanentWidget(2, snap_widget)
snap_widget.setOrientation(QtCore.Qt.Orientation.Horizontal)
snap_widget.show()


Expand Down Expand Up @@ -373,11 +374,13 @@ def show_draft_statusbar():

snap_widget = sb.findChild(QtGui.QToolBar,"draft_snap_widget")
if snap_widget:
snap_widget.setOrientation(QtCore.Qt.Orientation.Horizontal)
snap_widget.show()
else:
snap_widget = mw.findChild(QtGui.QToolBar,"draft_snap_widget")
if snap_widget:
sb.insertPermanentWidget(2, snap_widget)
snap_widget.setOrientation(QtCore.Qt.Orientation.Horizontal)
snap_widget.show()
elif params.GetBool("DisplayStatusbarSnapWidget", True):
t = QtCore.QTimer()
Expand Down

0 comments on commit d35daae

Please sign in to comment.