Skip to content

Commit 727baa1

Browse files
committed
[FEAT] Replaced default tooltips for FXMainWindow
1 parent 5f585d4 commit 727baa1

File tree

5 files changed

+372
-53
lines changed

5 files changed

+372
-53
lines changed

fxgui/examples.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,9 @@ def update_episodic_colors(_theme_name: str = None):
583583
fuzzy_delegate.show_status_dot = True
584584
fuzzy_delegate.show_status_label = True
585585
fuzzy_tree.tree_view.setItemDelegate(fuzzy_delegate)
586-
fxwidgets.FXThumbnailDelegate.apply_transparent_selection(fuzzy_tree.tree_view)
586+
fxwidgets.FXThumbnailDelegate.apply_transparent_selection(
587+
fuzzy_tree.tree_view
588+
)
587589

588590
# Role for storing icon name for theme-aware updates
589591
FUZZY_ICON_NAME_ROLE = Qt.UserRole + 301

fxgui/fxwidgets/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@
5656
from fxgui.fxwidgets._tag_input import FXTagChip, FXTagInput
5757
from fxgui.fxwidgets._timeline_slider import FXTimelineSlider
5858
from fxgui.fxwidgets._toggle_switch import FXToggleSwitch
59-
from fxgui.fxwidgets._tooltip import FXTooltip, FXTooltipManager, FXTooltipPosition
59+
from fxgui.fxwidgets._tooltip import (
60+
FXTooltip,
61+
FXTooltipManager,
62+
FXTooltipPosition,
63+
set_tooltip,
64+
)
6065
from fxgui.fxwidgets._tree_items import FXSortedTreeWidgetItem
6166
from fxgui.fxwidgets._validators import (
6267
FXCamelCaseValidator,
@@ -119,6 +124,7 @@
119124
"FXTooltip",
120125
"FXTooltipManager",
121126
"FXTooltipPosition",
127+
"set_tooltip",
122128
"FXValidatedLineEdit",
123129
"FXWidget",
124130
"theme_manager",

fxgui/fxwidgets/_main_window.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from qtpy.QtWidgets import QDesktopWidget
3333

3434
from fxgui import fxicons, fxstyle, fxutils
35+
from fxgui.fxwidgets._tooltip import FXTooltipManager
3536
from fxgui.fxwidgets._constants import (
3637
CRITICAL,
3738
ERROR,
@@ -131,6 +132,10 @@ def __init__(
131132
if self._set_stylesheet:
132133
self.setStyleSheet(fxstyle.load_stylesheet())
133134

135+
# Install the global FXTooltip manager for rich tooltips
136+
# This replaces standard Qt tooltips with FXTooltip for all widgets
137+
FXTooltipManager.install()
138+
134139
# Private methods
135140
def _load_ui(self) -> None:
136141
"""Load the UI from the specified UI file.

0 commit comments

Comments
 (0)