241 foregroundColor = QApplication.palette().color(QPalette.Text) |
241 foregroundColor = QApplication.palette().color(QPalette.Text) |
242 |
242 |
243 if self.__browser is not None: |
243 if self.__browser is not None: |
244 p = self.palette() |
244 p = self.palette() |
245 progress = self.__browser.progress() |
245 progress = self.__browser.progress() |
246 if progress == 0: |
246 if progress == 0 or progress == 100: |
247 if self.__browser.url().scheme() == "https": |
247 if self.__browser.url().scheme() == "https": |
248 backgroundColor = Preferences.getHelp("SaveUrlColor") |
248 if QSslCertificate is not None: |
|
249 if self.__browser.page().hasValidSslInfo(): |
|
250 backgroundColor = Preferences.getHelp("SaveUrlColor") |
|
251 else: |
|
252 backgroundColor = Preferences.getHelp("SaveUrlColor") |
249 p.setBrush(QPalette.Base, backgroundColor) |
253 p.setBrush(QPalette.Base, backgroundColor) |
250 p.setBrush(QPalette.Text, foregroundColor) |
254 p.setBrush(QPalette.Text, foregroundColor) |
251 else: |
255 else: |
252 if self.__browser.url().scheme() == "https": |
256 if self.__browser.url().scheme() == "https": |
253 backgroundColor = Preferences.getHelp("SaveUrlColor") |
257 if QSslCertificate is not None: |
|
258 if self.__browser.page().hasValidSslInfo(): |
|
259 backgroundColor = Preferences.getHelp("SaveUrlColor") |
|
260 else: |
|
261 backgroundColor = Preferences.getHelp("SaveUrlColor") |
254 highlight = QApplication.palette().color(QPalette.Highlight) |
262 highlight = QApplication.palette().color(QPalette.Highlight) |
255 r = (highlight.red() + 2 * backgroundColor.red()) // 3 |
263 r = (highlight.red() + 2 * backgroundColor.red()) // 3 |
256 g = (highlight.green() + 2 * backgroundColor.green()) // 3 |
264 g = (highlight.green() + 2 * backgroundColor.green()) // 3 |
257 b = (highlight.blue() + 2 * backgroundColor.blue()) // 3 |
265 b = (highlight.blue() + 2 * backgroundColor.blue()) // 3 |
258 |
266 |