Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions PyReconstruct/modules/gui/main/field_widget_7_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ def setLeftHanded(self, left_handed=None):
self.mouse_mode == CLOSEDTRACE):
cursor = self.pencil_l if self.series.getOption("left_handed") else self.pencil_r
if cursor != self.cursor(): self.setCursor(cursor)

# flip the floating tool palette to the matching field edge
palette = getattr(self.mainwindow, "mouse_palette", None)
if palette is not None:
palette.applyHandedness()

def endPendingEvents(self):
"""End ongoing events that are connected to the mouse."""
Expand Down
21 changes: 21 additions & 0 deletions PyReconstruct/modules/gui/palette/buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,27 @@ class ModeButton(MoveableButton):

def __init__(self, parent, manager):
super().__init__(parent, manager, "mode")
self.mode_name = None # display name, set by MousePalette.createModeButton
self.keycap = None # the small shortcut-hint label (or None)
self._hovered = False

def mouseMoveEvent(self, event):
"""Docked in the tool-palette card — not individually draggable (the
card is edge-docked and flips with the left-handed option), so the
MoveableButton drag is intentionally suppressed. Clicks/right-clicks
still work via press/release."""
pass

def enterEvent(self, event):
"""Brighten the resting icon on hover (prototype's ``.tool:hover``)."""
self._hovered = True
self.manager.styleModeButton(self)
super().enterEvent(event)

def leaveEvent(self, event):
self._hovered = False
self.manager.styleModeButton(self)
super().leaveEvent(event)

def highlightButton(self):
"""Mode buttons show their active state via the accent fill applied by
Expand Down
Loading