6 """ |
6 """ |
7 Module implementing the URL bar widget. |
7 Module implementing the URL bar widget. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtCore import pyqtSlot, Qt, QPointF, QUrl, QDateTime |
10 from PyQt4.QtCore import pyqtSlot, Qt, QPointF, QUrl, QDateTime |
11 from PyQt4.QtGui import QColor, QPalette, QApplication, QLinearGradient, QIcon, QDialog |
11 from PyQt4.QtGui import QColor, QPalette, QLinearGradient, QIcon, QDialog |
12 try: |
12 try: |
13 from PyQt4.QtNetwork import QSslCertificate # __IGNORE_EXCEPTION__ |
13 from PyQt4.QtNetwork import QSslCertificate # __IGNORE_EXCEPTION__ |
14 except ImportError: |
14 except ImportError: |
15 QSslCertificate = None # __IGNORE_WARNING__ |
15 QSslCertificate = None # __IGNORE_WARNING__ |
16 from PyQt4.QtWebKit import QWebSettings, QWebPage |
16 from PyQt4.QtWebKit import QWebSettings, QWebPage |
17 |
17 |
18 from E5Gui.E5LineEdit import E5LineEdit |
18 from E5Gui.E5LineEdit import E5LineEdit |
19 from E5Gui.E5LineEditButton import E5LineEditButton |
19 from E5Gui.E5LineEditButton import E5LineEditButton |
|
20 from E5Gui.E5Application import E5Application |
20 |
21 |
21 import Helpviewer.HelpWindow |
22 import Helpviewer.HelpWindow |
22 |
23 |
23 from .FavIconLabel import FavIconLabel |
24 from .FavIconLabel import FavIconLabel |
24 from .SslLabel import SslLabel |
25 from .SslLabel import SslLabel |
262 """ |
263 """ |
263 if self.__privateMode: |
264 if self.__privateMode: |
264 backgroundColor = QColor(220, 220, 220) # light gray |
265 backgroundColor = QColor(220, 220, 220) # light gray |
265 foregroundColor = Qt.black |
266 foregroundColor = Qt.black |
266 else: |
267 else: |
267 backgroundColor = QApplication.palette().color(QPalette.Base) |
268 backgroundColor = E5Application.palette().color(QPalette.Base) |
268 foregroundColor = QApplication.palette().color(QPalette.Text) |
269 foregroundColor = E5Application.palette().color(QPalette.Text) |
269 |
270 |
270 if self.__browser is not None: |
271 if self.__browser is not None: |
271 p = self.palette() |
272 p = self.palette() |
272 progress = self.__browser.progress() |
273 progress = self.__browser.progress() |
273 if progress == 0 or progress == 100: |
274 if progress == 0 or progress == 100: |
284 if QSslCertificate is not None: |
285 if QSslCertificate is not None: |
285 if self.__browser.page().hasValidSslInfo(): |
286 if self.__browser.page().hasValidSslInfo(): |
286 backgroundColor = Preferences.getHelp("SaveUrlColor") |
287 backgroundColor = Preferences.getHelp("SaveUrlColor") |
287 else: |
288 else: |
288 backgroundColor = Preferences.getHelp("SaveUrlColor") |
289 backgroundColor = Preferences.getHelp("SaveUrlColor") |
289 highlight = QApplication.palette().color(QPalette.Highlight) |
290 highlight = E5Application.palette().color(QPalette.Highlight) |
290 r = (highlight.red() + 2 * backgroundColor.red()) // 3 |
291 r = (highlight.red() + 2 * backgroundColor.red()) // 3 |
291 g = (highlight.green() + 2 * backgroundColor.green()) // 3 |
292 g = (highlight.green() + 2 * backgroundColor.green()) // 3 |
292 b = (highlight.blue() + 2 * backgroundColor.blue()) // 3 |
293 b = (highlight.blue() + 2 * backgroundColor.blue()) // 3 |
293 |
294 |
294 loadingColor = QColor(r, g, b) |
295 loadingColor = QColor(r, g, b) |