Skip to content

Commit 8e91e6c

Browse files
authored
Change tooltip cursor for OSX (#362)
1 parent f257bf8 commit 8e91e6c

7 files changed

Lines changed: 21 additions & 8 deletions

File tree

scrutiny/gui/components/locals/embedded_graph/graph_config_widget.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
VariableFreqSamplingRate, DataloggingConfig)
2525
from scrutiny.sdk import EmbeddedDataType, DeviceInfo
2626
from scrutiny.sdk.watchable_handle import WatchableHandle
27+
from scrutiny.gui.themes import scrutiny_get_theme
2728

2829
from scrutiny.tools.typing import *
2930
from scrutiny import tools
@@ -234,7 +235,7 @@ def add_row(layout: QFormLayout, txt: str, widget: QWidget, tooltip: Optional[st
234235
label = QLabel(txt)
235236
if tooltip is not None:
236237
label.setToolTip(tooltip)
237-
label.setCursor(Qt.CursorShape.WhatsThisCursor)
238+
label.setCursor(scrutiny_get_theme().tooltip_cursor())
238239
layout.addRow(label, widget)
239240

240241
# Layouts

scrutiny/gui/core/server_manager/client_task_reactor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,4 @@ def _thread_task(self) -> None:
155155
self._logger.debug(f"Task #{entry.task_id} failed")
156156
error = e
157157

158-
invoke_in_qt_thread(functools.partial(entry.ui_callback, result, error)) # Non blocking
158+
invoke_in_qt_thread(functools.partial(entry.ui_callback, result, error)) # Non blocking

scrutiny/gui/dialogs/device_info_dialog.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
from PySide6.QtWidgets import QDialog, QFormLayout, QLabel, QWidget, QVBoxLayout, QGroupBox, QGridLayout
1212
from PySide6.QtCore import Qt
1313

14-
from scrutiny.tools.typing import *
14+
from scrutiny.gui.themes import scrutiny_get_theme
1515
from scrutiny.sdk import DeviceInfo, SupportedFeatureMap, MemoryRegion, SamplingRate, FixedFreqSamplingRate, VariableFreqSamplingRate
16+
from scrutiny.tools.typing import *
1617

1718

1819
def _configure_property_label(label: QLabel, has_tooltip: bool) -> None:
1920
"""Helper to create FormLayout content. Applied on the property label"""
2021
if has_tooltip:
21-
label.setCursor(Qt.CursorShape.WhatsThisCursor)
22+
label.setCursor(scrutiny_get_theme().tooltip_cursor())
2223
label.setTextInteractionFlags(Qt.TextInteractionFlag.TextSelectableByMouse)
2324

2425

scrutiny/gui/dialogs/sfd_content_dialog.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
from PySide6.QtWidgets import QDialog, QFormLayout, QLabel, QWidget, QVBoxLayout, QGroupBox
1313
from PySide6.QtCore import Qt
14+
15+
from scrutiny.gui.themes import scrutiny_get_theme
1416
from scrutiny import sdk
1517
from scrutiny.tools.typing import *
1618

@@ -45,7 +47,7 @@ def write_fields(gb: QGroupBox, fields: List[Tuple[str, Optional[str]]]) -> None
4547
value = field[1]
4648
value_label = QLabel(value)
4749
property_label.setTextInteractionFlags(Qt.TextInteractionFlag.TextSelectableByMouse)
48-
property_label.setCursor(Qt.CursorShape.WhatsThisCursor)
50+
property_label.setCursor(scrutiny_get_theme().tooltip_cursor())
4951
value_label.setTextInteractionFlags(Qt.TextInteractionFlag.TextSelectableByMouse)
5052
value_label.setCursor(Qt.CursorShape.IBeamCursor)
5153
layout.addRow(property_label, value_label)

scrutiny/gui/themes/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99

1010
import enum
1111
import abc
12+
import sys
1213

1314
from PySide6.QtWidgets import QApplication, QStyle, QWidget
1415
from PySide6.QtGui import QPalette, QIcon, QPixmap
16+
from PySide6.QtCore import Qt
1517
from scrutiny.gui import assets
1618
from scrutiny.tools.typing import *
1719

@@ -107,6 +109,12 @@ def set_default_state(self, widget: QWidget) -> None:
107109
def set_success_state(self, widget: QWidget) -> None:
108110
self.set_state(widget, "success")
109111

112+
def tooltip_cursor(self) -> Qt.CursorShape:
113+
if sys.platform == 'darwin':
114+
return Qt.CursorShape.ArrowCursor
115+
else:
116+
return Qt.CursorShape.WhatsThisCursor
117+
110118
@abc.abstractmethod
111119
def get_val(self, prop: ScrutinyThemeProperties) -> Any:
112120
pass

scrutiny/gui/widgets/app_stats_display.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
from PySide6.QtCore import Qt
1313
from scrutiny import sdk
1414
from scrutiny.gui.core.server_manager.server_manager import ServerManager
15+
from scrutiny.gui.themes import scrutiny_get_theme
1516
from scrutiny.tools import format_eng_unit, format_sec_to_dhms
1617
from scrutiny.tools.typing import *
1718

1819

1920
def _configure_property_label(label: QLabel, has_tooltip: bool) -> None:
2021
if has_tooltip:
21-
label.setCursor(Qt.CursorShape.WhatsThisCursor)
22+
label.setCursor(scrutiny_get_theme().tooltip_cursor())
2223
label.setTextInteractionFlags(Qt.TextInteractionFlag.TextSelectableByMouse)
2324

2425

scrutiny/gui/widgets/tooltip_form_layout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# Copyright (c) 2026 Scrutiny Debugger
88

99
from PySide6.QtWidgets import QFormLayout, QWidget, QLabel
10-
from PySide6.QtCore import Qt
1110

11+
from scrutiny.gui.themes import scrutiny_get_theme
1212
from scrutiny.tools.typing import *
1313

1414

@@ -17,5 +17,5 @@ def add_row_tooltip(self, txt: str, widget: QWidget, tooltip: Optional[str] = No
1717
label = QLabel(txt)
1818
if tooltip is not None:
1919
label.setToolTip(tooltip)
20-
label.setCursor(Qt.CursorShape.WhatsThisCursor)
20+
label.setCursor(scrutiny_get_theme().tooltip_cursor())
2121
self.addRow(label, widget)

0 commit comments

Comments
 (0)