Compare commits
No commits in common. "master" and "0.5.2" have entirely different histories.
@ -27,6 +27,11 @@ Additional Options
|
|||||||
``can_minimize_to_tray``
|
``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
|
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.
|
``can_minimize_to_tray=True`` to the class and a tray icon will be installed with the necessary menu options.
|
||||||
|
|
||||||
@ -36,10 +41,6 @@ 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.
|
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
|
.. |pypi| image:: https://img.shields.io/pypi/v/WebAppify
|
||||||
:target: https://pypi.org/project/webappify/
|
:target: https://pypi.org/project/webappify/
|
||||||
.. |license| image:: https://img.shields.io/pypi/l/WebAppify
|
.. |license| image:: https://img.shields.io/pypi/l/WebAppify
|
||||||
|
@ -209,7 +209,7 @@ class WebApp(QtWidgets.QApplication):
|
|||||||
"""
|
"""
|
||||||
A generic application to open a web page in a desktop app
|
A generic application to open a web page in a desktop app
|
||||||
"""
|
"""
|
||||||
def __init__(self, title, url, icon, can_minimize_to_tray=False):
|
def __init__(self, title, url, icon, can_minimize_to_tray=False, canMinimizeToTray=False):
|
||||||
"""
|
"""
|
||||||
Create an application which loads a URL into a window
|
Create an application which loads a URL into a window
|
||||||
"""
|
"""
|
||||||
@ -219,7 +219,8 @@ class WebApp(QtWidgets.QApplication):
|
|||||||
self.title = title
|
self.title = title
|
||||||
self.url = url
|
self.url = url
|
||||||
self.icon = icon
|
self.icon = icon
|
||||||
self.can_minimize_to_tray = QtWidgets.QSystemTrayIcon.isSystemTrayAvailable() and can_minimize_to_tray
|
self.can_minimize_to_tray = QtWidgets.QSystemTrayIcon.isSystemTrayAvailable() and \
|
||||||
|
(can_minimize_to_tray or canMinimizeToTray)
|
||||||
if self.can_minimize_to_tray:
|
if self.can_minimize_to_tray:
|
||||||
self.setQuitOnLastWindowClosed(False)
|
self.setQuitOnLastWindowClosed(False)
|
||||||
self.setWindowIcon(QtGui.QIcon(self.icon))
|
self.setWindowIcon(QtGui.QIcon(self.icon))
|
||||||
|
Loading…
Reference in New Issue
Block a user