forked from mint-choc-chip-skyblade/sshd-rando
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add toggle for sphere tracking, fix bug with autosave exception handling
- Loading branch information
1 parent
3fe5a20
commit d1cc067
Showing
6 changed files
with
171 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from PySide6.QtWidgets import QPushButton, QSizePolicy, QToolTip | ||
from PySide6.QtGui import QFontDatabase, QCursor, QMouseEvent | ||
from PySide6 import QtCore | ||
from PySide6.QtCore import Signal, QPoint | ||
|
||
from filepathconstants import TRACKER_ASSETS_PATH | ||
|
||
|
||
class TrackerToggleSTButton(QPushButton): | ||
|
||
left_clicked = Signal() | ||
right_clicked = Signal() | ||
|
||
def __init__(self, parent_) -> None: | ||
super().__init__(parent_) | ||
self.setText("Enable Sphere Tracking") | ||
self.setCursor(QCursor(QtCore.Qt.PointingHandCursor)) | ||
self.setStyleSheet( | ||
"QToolTip { color: white; background-color: black; border-image: none; border-color: white; }" | ||
) | ||
self.setMouseTracking(True) | ||
|
||
def mouseMoveEvent(self, ev: QMouseEvent) -> None: | ||
coords = self.mapToGlobal(QPoint(0, 0)) + QPoint(100, self.height() / 4) | ||
QToolTip.showText(coords, "Right-click for info", self) | ||
|
||
return super().mouseMoveEvent(ev) | ||
|
||
def mouseReleaseEvent(self, ev: QMouseEvent) -> None: | ||
if ev.button() == QtCore.Qt.LeftButton: | ||
self.left_clicked.emit() | ||
elif ev.button() == QtCore.Qt.RightButton: | ||
self.right_clicked.emit() | ||
|
||
return super().mouseReleaseEvent(ev) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters