Remove deprecated canMinimizeToTray option #13

Merged
raoul merged 1 commits from remove-deprecated-option into master 2024-09-27 17:33:08 +00:00
2 changed files with 6 additions and 8 deletions

View File

@ -27,11 +27,6 @@ Additional Options
``can_minimize_to_tray``
''''''''''''''''''''''''
.. important::
This option was changed in version 0.4.0 from ``canMinimizeToTray`` to ``can_minimize_to_tray``. The old option
is still available, but is deprecated. It will be removed in 0.6.0.
To install a system tray icon, and minimize your application to the system tray, simply pass
``can_minimize_to_tray=True`` to the class and a tray icon will be installed with the necessary menu options.
@ -41,6 +36,10 @@ To install a system tray icon, and minimize your application to the system tray,
Clicking on the tray icon will show the window, while right-clicking will show the menu.
.. note::
The `canMinimizeToTray` version of this option was removed in 0.6.0
.. |pypi| image:: https://img.shields.io/pypi/v/WebAppify
:target: https://pypi.org/project/webappify/
.. |license| image:: https://img.shields.io/pypi/l/WebAppify

View File

@ -209,7 +209,7 @@ class WebApp(QtWidgets.QApplication):
"""
A generic application to open a web page in a desktop app
"""
def __init__(self, title, url, icon, can_minimize_to_tray=False, canMinimizeToTray=False):
def __init__(self, title, url, icon, can_minimize_to_tray=False):
"""
Create an application which loads a URL into a window
"""
@ -219,8 +219,7 @@ class WebApp(QtWidgets.QApplication):
self.title = title
self.url = url
self.icon = icon
self.can_minimize_to_tray = QtWidgets.QSystemTrayIcon.isSystemTrayAvailable() and \
(can_minimize_to_tray or canMinimizeToTray)
self.can_minimize_to_tray = QtWidgets.QSystemTrayIcon.isSystemTrayAvailable() and can_minimize_to_tray
if self.can_minimize_to_tray:
self.setQuitOnLastWindowClosed(False)
self.setWindowIcon(QtGui.QIcon(self.icon))