diff --git a/docs/widgets/(Widget)-Bluetooth.md b/docs/widgets/(Widget)-Bluetooth.md index ebcf99a..b87d72c 100644 --- a/docs/widgets/(Widget)-Bluetooth.md +++ b/docs/widgets/(Widget)-Bluetooth.md @@ -4,6 +4,7 @@ |-------------------|---------|-------------------------------------------------------------------------|-----------------------------------------------------------------------------| | `label` | string | `'{icon}'` | The format string for the bluetooth widget. Displays icons. | | `label_alt` | string | `'{device_name}'` | The alternative format string for the bluetooth widget. Displays list of connected devices. | +| `tooltip` | boolean | `True` | Whether to show the tooltip on hover. | | `icons` | dict | `{'bluetooth_on', 'bluetooth_off', 'bluetooth_connected'` | Icons for bluetooth widget | | `callbacks` | dict | `{'on_left': 'toggle_mute', 'on_middle': 'toggle_label', 'on_right': 'do_nothing'}` | Callbacks for mouse events on the memory widget. | | `container_padding` | dict | `{'top': 0, 'left': 0, 'bottom': 0, 'right': 0}` | Explicitly set padding inside widget container. | @@ -29,6 +30,7 @@ bluetooth: - **label:** The format string for the bluetooth widget. Displays the bluetooth icon. - **label_alt:** The alternative format string for the bluetooth widget. Displays list of connected devices. +- **tooltip:** Whether to show the tooltip on hover. - **icons:** A dictionary specifying the icons for the bluetooth widget. The keys are `bluetooth_on`, `bluetooth_off`, and `bluetooth_connected`, and the values are the unicode characters for the icons. - **callbacks:** A dictionary specifying the callbacks for mouse events. The keys are `on_left`, `on_middle`, and `on_right`, and the values are the names of the callback functions. diff --git a/docs/widgets/(Widget)-Clock.md b/docs/widgets/(Widget)-Clock.md index fcdfd2a..40624bd 100644 --- a/docs/widgets/(Widget)-Clock.md +++ b/docs/widgets/(Widget)-Clock.md @@ -4,6 +4,7 @@ |-----------------|---------|-------------------------------------------------------------------------|-----------------------------------------------------------------------------| | `label` | string | `'\uf017 {%H:%M:%S}'` | The format string for the clock. You can use placeholders like `{%H:%M:%S}` to dynamically insert time information. | | `label_alt` | string | `'\uf017 {%d-%m-%y %H:%M:%S}'` | The alternative format string for the clock. Useful for displaying additional time details. | +| `tooltip` | boolean | `True` | Whether to show the tooltip on hover. | | `locale` | string | `""` | The locale to use for the clock. If not specified, it defaults to an empty string. | | `update_interval` | integer | `1000` | The interval in milliseconds to update the clock. Must be between 0 and 60000. | | `timezones` | list | `[]` | A list of timezones to cycle through. Each timezone should be a valid timezone string. | @@ -30,6 +31,7 @@ clock: - **label:** The format string for the clock. You can use placeholders like `{%H:%M:%S}` to dynamically insert time information. - **label_alt:** The alternative format string for the clock. Useful for displaying additional time details. - **locale:** The locale to use for the clock. If not specified, it defaults to an empty string. +- **tooltip:** Whether to show the tooltip on hover. - **update_interval:** The interval in milliseconds to update the clock. Must be between 0 and 60000. - **timezones:** A list of timezones to cycle through. If value is empty YASB will looking up time zone info from registry - **callbacks:** A dictionary specifying the callbacks for mouse events. The keys are `on_left`, `on_middle`, and `on_right`, and the values are the names of the callback functions. diff --git a/docs/widgets/(Widget)-Github.md b/docs/widgets/(Widget)-Github.md index 3e2aa2f..99ec2dd 100644 --- a/docs/widgets/(Widget)-Github.md +++ b/docs/widgets/(Widget)-Github.md @@ -4,6 +4,7 @@ |------------------|----------|--------------------------------|-----------------------------------------------------------------------------| | `label` | string | `'{icon}'` | The format string for the label. You can use placeholders like `{icon}` to dynamically insert icon information. | | `label_alt` | string | `'{data} Notifications'` | The alternative format string for the label. Useful for displaying additional notification details. | +| `tooltip` | boolean | `True` | Whether to show the tooltip on hover. | | `update_interval`| integer | `600` | The interval in seconds to update the notifications. Must be between 60 and 3600. | | `token` | string | `""` | The GitHub personal access token. | | `max_notification`| integer | `20` | The maximum number of notifications to display in the menu. | @@ -34,6 +35,7 @@ github: - **label:** The format string for the label. You can use placeholders like `{icon}` to dynamically insert icon information. - **label_alt:** The alternative format string for the label. Useful for displaying additional notification details. +- **tooltip:** Whether to show the tooltip on hover. - **update_interval:** The interval in seconds to update the notifications. Must be between 60 and 3600. - **token:** The GitHub personal access token. GitHub Personal access tokens (classic) https://github.com/settings/tokens you can set `token: env`, this means you have to set YASB_GITHUB_TOKEN in environment variable. - **max_notification:** The maximum number of notifications to display in the menu, max 50. diff --git a/docs/widgets/(Widget)-Microphone.md b/docs/widgets/(Widget)-Microphone.md index 51a474e..a84a4b0 100644 --- a/docs/widgets/(Widget)-Microphone.md +++ b/docs/widgets/(Widget)-Microphone.md @@ -4,6 +4,7 @@ |-------------------|---------|-------------------------------------------------------------------------|-----------------------------------------------------------------------------| | `label` | string | `'{icon}'` | The format string for the microphone widget. Displays icon or level. | | `label_alt` | string | `'{icon} {level}%'` | The alternative format string for the microphone widget. Displays icon or level. | +| `tooltip` | boolean | `True` | Whether to show the tooltip on hover. | | `icons` | dict | `{'normal', 'muted'` | Icons for microphone widget | | `callbacks` | dict | `{'on_left': 'toggle_mute', 'on_middle': 'toggle_label', 'on_right': 'do_nothing'}` | Callbacks for mouse events on the memory widget. | | `container_padding` | dict | `{'top': 0, 'left': 0, 'bottom': 0, 'right': 0}` | Explicitly set padding inside widget container. | @@ -30,6 +31,7 @@ microphone: - **label:** The format string for the microphone widget. Displays the microphone icon or level. - **label_alt:** The alternative format string for the microphone widget. Displays the microphone icon or level. +- **tooltip:** Whether to show the tooltip on hover. - **icons:** A dictionary specifying the icons for the microphone widget. The keys are `normal` and `muted`, and the values are the unicode characters for the icons. - **callbacks:** A dictionary specifying the callbacks for mouse events. The keys are `on_left`, `on_middle`, and `on_right`, and the values are the names of the callback functions. diff --git a/docs/widgets/(Widget)-Taskbar.md b/docs/widgets/(Widget)-Taskbar.md index e91ab59..e90db88 100644 --- a/docs/widgets/(Widget)-Taskbar.md +++ b/docs/widgets/(Widget)-Taskbar.md @@ -4,6 +4,7 @@ | `icon_size` | integer | 16 | The size of icons | | `ignore_apps` | dict | `processes:[],titles[],classes:[]` | Ignore some apps. | | `animation` | boolean | `false` | Icons animation. | +| `tooltip` | boolean | `True` | Whether to show the tooltip on hover. | | `container_padding` | dict | `{'top': 0, 'left': 0, 'bottom': 0, 'right': 0}` | Explicitly set padding inside widget container. | `callbacks` | dict | `{'on_left': 'toggle_window', 'on_middle': 'do_nothing', 'on_right': 'do_nothing'}` | Callbacks for mouse events on the widget. | @@ -30,6 +31,7 @@ taskbar: - **icon_size:** The size of icons which will show in the widget. - **animation:** Icons animation. +- **tooltip:** Whether to show the tooltip on hover. - **container_padding:** Explicitly set padding inside widget container. - **ignore_apps:** A dictionary that allows you to specify which applications should be ignored by the taskbar widget. It includes: - processes: A list of process names to ignore. diff --git a/docs/widgets/(Widget)-Update-Check.md b/docs/widgets/(Widget)-Update-Check.md index 4154eec..8b49636 100644 --- a/docs/widgets/(Widget)-Update-Check.md +++ b/docs/widgets/(Widget)-Update-Check.md @@ -13,6 +13,7 @@ This widget checks for available updates using Windows Update and Winget. |-----------------|---------|------------|--------------------------------------------------------------| | `enabled` | boolean | `False` | Enable Windows Update checking. | | `label` | string | `'{count}'`| Format string for the widget label. `{count}` shows update count. | +| `tooltip` | boolean | `True` | Whether to show the tooltip on hover. | | `interval` | integer | `1440` | Check interval in minutes (30 to 10080). | | `exclude` | list | `[]` | List of updates to exclude from checking. | @@ -22,6 +23,7 @@ This widget checks for available updates using Windows Update and Winget. |-----------------|---------|------------|--------------------------------------------------------------| | `enabled` | boolean | `False` | Enable Winget package update checking. | | `label` | string | `'{count}'`| Format string for the widget label. `{count}` shows update count. | +| `tooltip` | boolean | `True` | Whether to show the tooltip on hover. | | `interval` | integer | `240` | Check interval in minutes (10 to 10080). | | `exclude` | list | `[]` | List of packages to exclude from checking. | diff --git a/docs/widgets/(Widget)-Volume.md b/docs/widgets/(Widget)-Volume.md index 50b5c5f..ac4989d 100644 --- a/docs/widgets/(Widget)-Volume.md +++ b/docs/widgets/(Widget)-Volume.md @@ -3,6 +3,7 @@ |--------------|--------|-------------------------------------------------------------------------|-----------------------------------------------------------------------------| | `label` | string | `'{volume[percent]}%'` | The format string for the volume label. You can use placeholders like `{volume[percent]}` to dynamically insert volume information. | | `label_alt` | string | `'{volume[percent]}%'` | The alternative format string for the volume label. Useful for displaying additional volume details. | +| `tooltip` | boolean | `True` | Whether to show the tooltip on hover. | | `volume_icons` | list | `['\ueee8', '\uf026', '\uf027', '\uf027', '\uf028']` | A list of icons representing different volume levels. The icons are used based on the current volume percentage. | | `callbacks` | dict | `{'on_middle': 'do_nothing', 'on_right': 'do_nothing'}` | Callbacks for mouse events on the volume widget. | @@ -28,6 +29,7 @@ volume: - **label**: The format string for the volume label. You can use placeholders like `{volume[percent]}` to dynamically insert volume information. - **label_alt**: The alternative format string for the volume label. Useful for displaying additional volume details. +- **tooltip**: Whether to show the tooltip on hover. - **volume_icons**: A list of icons representing different volume levels. The icons are used based on the current volume percentage. - **callbacks**: A dictionary specifying the callbacks for mouse events. The keys are `on_middle` and `on_right`, and the values are the names of the callback functions. diff --git a/docs/widgets/(Widget)-Wallpapers.md b/docs/widgets/(Widget)-Wallpapers.md index 84c6317..0bd5a41 100644 --- a/docs/widgets/(Widget)-Wallpapers.md +++ b/docs/widgets/(Widget)-Wallpapers.md @@ -2,6 +2,7 @@ | Option | Type | Default | Description | |----------------------|----------|----------------|-----------------------------------------------------------------------------| | `label` | string | `"{icon}"` | The format string for the wallpaper widget label. | +| `tooltip` | boolean | `True` | Whether to show the tooltip on hover. | | `update_interval` | integer | 60 | The interval in seconds to update the wallpaper. Must be between 60 and 86400. | | `change_automatically` | boolean | `False` | Whether to automatically change the wallpaper. | | `image_path` | string | `""` | The path to the folder containing images for the wallpaper. This field is required. | @@ -38,6 +39,7 @@ wallpapers: ## Description of Options - **label:** The format string for the wallpaper widget label. - **update_interval:** The interval in seconds to update the wallpaper. Must be between 60 and 86400. +- **tooltip:** Whether to show the tooltip on hover. - **change_automatically:** Whether to automatically change the wallpaper. - **image_path:** The path to the folder containing images for the wallpaper. This field is required. - **gallery:** The gallery options for the wallpaper widget. diff --git a/src/core/validation/widgets/yasb/bluetooth.py b/src/core/validation/widgets/yasb/bluetooth.py index 50ae67a..00f7faa 100644 --- a/src/core/validation/widgets/yasb/bluetooth.py +++ b/src/core/validation/widgets/yasb/bluetooth.py @@ -1,6 +1,7 @@ DEFAULTS = { 'label': '\udb80\udcb1', 'label_alt': '\uf293', + 'tooltip': True, 'icons': { 'bluetooth_on': '\udb80\udcaf', 'bluetooth_off': '\udb80\udcb2', @@ -23,6 +24,11 @@ 'type': 'string', 'default': DEFAULTS['label_alt'] }, + 'tooltip': { + 'type': 'boolean', + 'required': False, + 'default': DEFAULTS['tooltip'] + }, 'icons': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/clock.py b/src/core/validation/widgets/yasb/clock.py index 0d0ab90..066e58a 100644 --- a/src/core/validation/widgets/yasb/clock.py +++ b/src/core/validation/widgets/yasb/clock.py @@ -3,6 +3,7 @@ 'label_alt': '\uf017 {%d-%m-%y %H:%M:%S}', 'update_interval': 1000, 'locale':"", + 'tooltip': True, 'timezones': [], 'callbacks': { 'on_left': 'toggle_label', @@ -25,6 +26,11 @@ 'type': 'string', 'default': DEFAULTS['locale'] }, + 'tooltip': { + 'type': 'boolean', + 'required': False, + 'default': DEFAULTS['tooltip'] + }, 'update_interval': { 'type': 'integer', 'default': 1000, diff --git a/src/core/validation/widgets/yasb/github.py b/src/core/validation/widgets/yasb/github.py index 876d359..a32c225 100644 --- a/src/core/validation/widgets/yasb/github.py +++ b/src/core/validation/widgets/yasb/github.py @@ -2,13 +2,14 @@ 'label': '{icon}', 'label_alt': '{data} Notifications', 'update_interval': 600, - "token": "", - "max_notification":20, - "only_unread": False, - "max_field_size": 100, - "menu_width": 400, - "menu_height": 400, - "menu_offset": 240 + 'token': "", + 'tooltip': True, + 'max_notification':20, + 'only_unread': False, + 'max_field_size': 100, + 'menu_width': 400, + 'menu_height': 400, + 'menu_offset': 240 } VALIDATION_SCHEMA = { @@ -30,6 +31,11 @@ 'type': 'string', 'default': DEFAULTS['token'] }, + 'tooltip': { + 'type': 'boolean', + 'required': False, + 'default': DEFAULTS['tooltip'] + }, 'max_notification': { 'type': 'integer', 'default': DEFAULTS['max_notification'] diff --git a/src/core/validation/widgets/yasb/microphone.py b/src/core/validation/widgets/yasb/microphone.py index abe833a..2f665ee 100644 --- a/src/core/validation/widgets/yasb/microphone.py +++ b/src/core/validation/widgets/yasb/microphone.py @@ -1,6 +1,7 @@ DEFAULTS = { 'label': '{icon}', 'label_alt': '{icon} {level}%', + 'tooltip': True, 'icons': { 'normal': '\uf130', 'muted': '\uf131', @@ -22,6 +23,11 @@ 'type': 'string', 'default': DEFAULTS['label_alt'] }, + 'tooltip': { + 'type': 'boolean', + 'required': False, + 'default': DEFAULTS['tooltip'] + }, 'icons': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/taskbar.py b/src/core/validation/widgets/yasb/taskbar.py index c6d8360..6a68834 100644 --- a/src/core/validation/widgets/yasb/taskbar.py +++ b/src/core/validation/widgets/yasb/taskbar.py @@ -1,6 +1,7 @@ DEFAULTS = { 'icon_size': 16, 'animation': False, + 'tooltip': True, 'ignore_apps': { 'classes': [], 'processes': [], @@ -24,6 +25,11 @@ 'default': DEFAULTS['animation'], 'required': False }, + 'tooltip': { + 'type': 'boolean', + 'required': False, + 'default': DEFAULTS['tooltip'] + }, 'ignore_apps': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/update_check.py b/src/core/validation/widgets/yasb/update_check.py index 33b0e28..9425d8f 100644 --- a/src/core/validation/widgets/yasb/update_check.py +++ b/src/core/validation/widgets/yasb/update_check.py @@ -2,12 +2,14 @@ 'windows_update': { 'enabled': False, 'label': '{count}', + 'tooltip': True, 'interval': 1440, 'exclude': [] }, 'winget_update': { 'enabled': False, 'label': '{count}', + 'tooltip': True, 'interval': 240, 'exclude': [] } @@ -25,6 +27,11 @@ 'type': 'string', 'default': DEFAULTS['windows_update']['label'] }, + 'tooltip': { + 'type': 'boolean', + 'required': False, + 'default': DEFAULTS['windows_update']['tooltip'] + }, 'interval': { 'type': 'integer', 'default': DEFAULTS['windows_update']['interval'], @@ -51,6 +58,11 @@ 'type': 'string', 'default': DEFAULTS['winget_update']['label'] }, + 'tooltip': { + 'type': 'boolean', + 'required': False, + 'default': DEFAULTS['windows_update']['tooltip'] + }, 'interval': { 'type': 'integer', 'default': DEFAULTS['winget_update']['interval'], diff --git a/src/core/validation/widgets/yasb/volume.py b/src/core/validation/widgets/yasb/volume.py index e2aa1ad..31fb22d 100644 --- a/src/core/validation/widgets/yasb/volume.py +++ b/src/core/validation/widgets/yasb/volume.py @@ -1,6 +1,7 @@ DEFAULTS = { 'label': "{volume[percent]}%", 'label_alt': "{volume[percent]}%", + 'tooltip': True, 'volume_icons': [ "\ueee8", # Icon for muted "\uf026", # Icon for 0-10% volume @@ -23,6 +24,11 @@ 'type': 'string', 'default': DEFAULTS['label_alt'] }, + 'tooltip': { + 'type': 'boolean', + 'required': False, + 'default': DEFAULTS['tooltip'] + }, 'volume_icons': { 'type': 'list', 'default': DEFAULTS['volume_icons'], diff --git a/src/core/validation/widgets/yasb/wallpapers.py b/src/core/validation/widgets/yasb/wallpapers.py index 79a4736..b728435 100644 --- a/src/core/validation/widgets/yasb/wallpapers.py +++ b/src/core/validation/widgets/yasb/wallpapers.py @@ -3,6 +3,7 @@ 'update_interval': 60, 'change_automatically': False, 'image_path': "", + 'tooltip': True, 'gallery': { 'enabled': False, 'blur': True, @@ -40,6 +41,11 @@ 'type': 'string', 'default': DEFAULTS['image_path'] }, + 'tooltip': { + 'required': False, + 'type': 'boolean', + 'default': DEFAULTS['tooltip'] + }, 'gallery': { 'type': 'dict', 'required': False, diff --git a/src/core/widgets/yasb/bluetooth.py b/src/core/widgets/yasb/bluetooth.py index 6fab933..55f00d5 100644 --- a/src/core/widgets/yasb/bluetooth.py +++ b/src/core/widgets/yasb/bluetooth.py @@ -217,6 +217,7 @@ def __init__( self, label: str, label_alt: str, + tooltip: bool, icons: dict[str, str], container_padding: dict[str, int], callbacks: dict[str, str] @@ -225,6 +226,7 @@ def __init__( self._show_alt_label = False self._label_content = label self._label_alt_content = label_alt + self._tooltip = tooltip self._padding = container_padding try: self.bt_api = get_bluetooth_api() @@ -351,8 +353,8 @@ def _update_label(self, icon, connected_devices=None): active_widgets[widget_index].setText(formatted_text) widget_index += 1 - # Set tooltip with connected device names - self._widget_container.setToolTip(tooltip_text) + if self._tooltip: + self._widget_container.setToolTip(tooltip_text) def _update_state(self, status): self.current_status = status diff --git a/src/core/widgets/yasb/clock.py b/src/core/widgets/yasb/clock.py index 369053c..12a56a5 100644 --- a/src/core/widgets/yasb/clock.py +++ b/src/core/widgets/yasb/clock.py @@ -17,12 +17,14 @@ def __init__( label: str, label_alt: str, locale: str, + tooltip: bool, update_interval: int, timezones: list[str], callbacks: dict[str, str], ): super().__init__(update_interval, class_name="clock-widget") self._locale = locale + self._tooltip = tooltip self._active_tz = None self._timezones = cycle(timezones if timezones else [get_localzone_name()]) self._active_datetime_format_str = '' @@ -126,5 +128,6 @@ def _update_label(self): def _next_timezone(self): self._active_tz = next(self._timezones) - self.setToolTip(self._active_tz) + if self._tooltip: + self.setToolTip(self._active_tz) self._update_label() diff --git a/src/core/widgets/yasb/github.py b/src/core/widgets/yasb/github.py index c8c5dc8..8ffb2a1 100644 --- a/src/core/widgets/yasb/github.py +++ b/src/core/widgets/yasb/github.py @@ -30,13 +30,14 @@ def leaveEvent(self, event): class GithubWidget(BaseWidget): validation_schema = VALIDATION_SCHEMA - def __init__(self, label: str, label_alt: str, token: str,max_notification: int, only_unread: bool, max_field_size: int, menu_width: int,menu_height: int,menu_offset: str, update_interval: int): + def __init__(self, label: str, label_alt: str, token: str, tooltip: bool, max_notification: int, only_unread: bool, max_field_size: int, menu_width: int,menu_height: int,menu_offset: str, update_interval: int): super().__init__((update_interval * 1000), class_name="github-widget") self._menu_open = False self._show_alt_label = False self._label_content = label self._label_alt_content = label_alt self._token = token if token != 'env' else os.getenv('YASB_GITHUB_TOKEN') + self._tooltip = tooltip self._menu_width = menu_width self._menu_height = menu_height self._menu_offset = menu_offset @@ -122,7 +123,8 @@ def _update_label(self): if '' in part: icon = re.sub(r'|', '', part).strip() current_widget.setText(icon) - current_widget.setToolTip(f'Notifications {notification_count}') + if self._tooltip: + current_widget.setToolTip(f'Notifications {notification_count}') # Update class based on notification count current_classes = current_widget.property("class").split() notification_class = "new-notification" diff --git a/src/core/widgets/yasb/microphone.py b/src/core/widgets/yasb/microphone.py index bd3a51d..67572ea 100644 --- a/src/core/widgets/yasb/microphone.py +++ b/src/core/widgets/yasb/microphone.py @@ -37,6 +37,7 @@ def __init__( self, label: str, label_alt: str, + tooltip: bool, icons: dict[str, str], container_padding: dict[str, int], callbacks: dict[str, str] @@ -49,6 +50,7 @@ def __init__( self._show_alt_label = False self._label_content = label self._label_alt_content = label_alt + self._tooltip = tooltip self._icons = icons self._padding = container_padding @@ -182,7 +184,8 @@ def _get_mic_icon(self): else: mic_icon = self._icons['normal'] tooltip = f'Volume {current_level}' - self.setToolTip(tooltip) + if self._tooltip: + self.setToolTip(tooltip) return mic_icon diff --git a/src/core/widgets/yasb/taskbar.py b/src/core/widgets/yasb/taskbar.py index 4f267d0..7d79d87 100644 --- a/src/core/widgets/yasb/taskbar.py +++ b/src/core/widgets/yasb/taskbar.py @@ -29,6 +29,7 @@ def __init__( self, icon_size: int, animation: bool, + tooltip: bool, ignore_apps: dict[str, list[str]], container_padding: dict, callbacks: dict[str, str] @@ -38,6 +39,7 @@ def __init__( self.icon_label = QLabel() self._label_icon_size = icon_size self._animation = animation + self._tooltip = tooltip self._ignore_apps = ignore_apps self._padding = container_padding self._win_info = None @@ -159,7 +161,8 @@ def _update_label(self, hwnd: int, win_info: dict, event: WinEvent) -> None: if self._animation: icon_label.setFixedWidth(0) icon_label.setPixmap(icon) - icon_label.setToolTip(title) + if self._tooltip: + icon_label.setToolTip(title) icon_label.setProperty("hwnd", hwnd) icon_label.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) self._widget_container_layout.addWidget(icon_label) diff --git a/src/core/widgets/yasb/update_check.py b/src/core/widgets/yasb/update_check.py index f409d75..81ee5d8 100644 --- a/src/core/widgets/yasb/update_check.py +++ b/src/core/widgets/yasb/update_check.py @@ -188,6 +188,9 @@ def __init__(self, windows_update: dict[str, str], winget_update: dict[str, str] self._windows_update = windows_update self._winget_update = winget_update + self._windows_update_tooltip = self._windows_update['tooltip'] + self._winget_update_tooltip = self._winget_update['tooltip'] + self._window_update_enabled = self._windows_update.get('enabled', False) self._windows_update_label = self._windows_update.get('label', '') self._windows_update_exclude = self._windows_update.get('exclude', []) @@ -293,7 +296,10 @@ def _update_label(self, widget_type, data, names): formatted_text = part.format(count=data) active_widgets[widget_index].setText(formatted_text) active_widgets[widget_index].setCursor(Qt.CursorShape.PointingHandCursor) - active_widgets[widget_index].setToolTip("\n".join(names)) + if widget_type == 'windows' and self._windows_update_tooltip: + active_widgets[widget_index].setToolTip("\n".join(names)) + elif widget_type == 'winget' and self._winget_update_tooltip: + active_widgets[widget_index].setToolTip("\n".join(names)) widget_index += 1 diff --git a/src/core/widgets/yasb/volume.py b/src/core/widgets/yasb/volume.py index 3fbce68..ee011e6 100644 --- a/src/core/widgets/yasb/volume.py +++ b/src/core/widgets/yasb/volume.py @@ -38,6 +38,7 @@ def __init__( self, label: str, label_alt: str, + tooltip: bool, volume_icons: list[str], callbacks: dict[str, str] ): @@ -45,7 +46,8 @@ def __init__( self._show_alt_label = False self._label_content = label self._label_alt_content = label_alt - + self._tooltip = tooltip + self.volume = None self._volume_icons = volume_icons self._widget_container_layout: QHBoxLayout = QHBoxLayout() @@ -146,7 +148,8 @@ def _update_label(self): def _get_volume_icon(self): current_mute_status = self.volume.GetMute() current_volume_level = round(self.volume.GetMasterVolumeLevelScalar() * 100) - self.setToolTip(f'Volume {current_volume_level}') + if self._tooltip: + self.setToolTip(f'Volume {current_volume_level}') if current_mute_status == 1: volume_icon = self._volume_icons[0] elif 0 <= current_volume_level < 11: diff --git a/src/core/widgets/yasb/wallpapers.py b/src/core/widgets/yasb/wallpapers.py index 9284370..79e22d0 100644 --- a/src/core/widgets/yasb/wallpapers.py +++ b/src/core/widgets/yasb/wallpapers.py @@ -33,6 +33,7 @@ def __init__( update_interval: int, change_automatically: bool, image_path: str, + tooltip: bool, run_after: list[str], gallery: dict = None ): @@ -44,6 +45,7 @@ def __init__( self._label_content = label self._change_automatically = change_automatically self._image_path = image_path + self._tooltip = tooltip self._run_after = run_after self._gallery = gallery @@ -96,12 +98,14 @@ def process_content(content, is_alt=False): icon = re.sub(r'|', '', part).strip() label = QLabel(icon) label.setProperty("class", class_result) - label.setToolTip(f'Change Wallaper') + if self._tooltip: + label.setToolTip(f'Change Wallaper') label.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) else: label = QLabel(part) label.setProperty("class", "label") - label.setToolTip(f'Change Wallaper') + if self._tooltip: + label.setToolTip(f'Change Wallaper') label.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) label.setAlignment(Qt.AlignmentFlag.AlignCenter)