# Path: vise/config.py
# def color(key, default):
#     ans = colors().get(key)
#     if not ans or ans == 'default':
#         ans = default
#     return ans
# 
# Path: vise/constants.py
# STATUS_BAR_HEIGHT = 24


from collections import namedtuple
from gettext import gettext as _
from time import monotonic
from xml.sax.saxutils import escape
from PyQt6.QtCore import Qt, QTimer, QUrl, pyqtSignal, QPointF
from PyQt6.QtGui import (QBrush, QColor, QLinearGradient, QPainter, QPalette,
                         QStaticText, QTextOption)
from PyQt6.QtWidgets import (QApplication, QHBoxLayout, QLabel, QLineEdit,
                             QStackedWidget, QStatusBar, QWidget)
from .config import color
from .constants import STATUS_BAR_HEIGHT
        from vise.view import certificate_error_domains
        self.setToolTip(_('Disable passthrough mode') if self.is_enabled else _('Enable passthrough mode'))
        self.update()

    def mousePressEvent(self, ev):
        if ev.button() == Qt.MouseButton.LeftButton:
            self.is_enabled ^= True
            self.toggled.emit(self.is_enabled)
            ev.accept()

    def paintEvent(self, ev):
        painter = QPainter(self)
        painter.setRenderHint(QPainter.RenderHint.TextAntialiasing)
        f = painter.font()
        f.setBold(True)
        f.setPixelSize(self.height() - 1)
        painter.setFont(f)
        painter.setPen(QColor('red' if self.is_enabled else 'green'))
        painter.drawText(self.rect(), Qt.AlignmentFlag.AlignCenter, 'Z')
        painter.end()


class StatusBar(QStatusBar):

    search_bar_hidden = pyqtSignal()
    do_search = pyqtSignal(object, object)
    change_passthrough = pyqtSignal(bool)

    def __init__(self, downloads_indicator, parent=None):
        QStatusBar.__init__(self, parent)
        self.setMaximumHeight(STATUS_BAR_HEIGHT)

# Path: vise/config.py
# def color(key, default):
#     ans = colors().get(key)
#     if not ans or ans == 'default':
#         ans = default
#     return ans
# 
# Path: vise/constants.py
# STATUS_BAR_HEIGHT = 24


# Path: vise/status_bar.py
from collections import namedtuple
from gettext import gettext as _
from time import monotonic
from xml.sax.saxutils import escape
from PyQt6.QtCore import Qt, QTimer, QUrl, pyqtSignal, QPointF
from PyQt6.QtGui import (QBrush, QColor, QLinearGradient, QPainter, QPalette,
                         QStaticText, QTextOption)
from PyQt6.QtWidgets import (QApplication, QHBoxLayout, QLabel, QLineEdit,
                             QStackedWidget, QStatusBar, QWidget)
from .config import color
from .constants import STATUS_BAR_HEIGHT
        from vise.view import certificate_error_domains

        self.setToolTip(_('Disable passthrough mode') if self.is_enabled else _('Enable passthrough mode'))
        self.update()

    def mousePressEvent(self, ev):
        if ev.button() == Qt.MouseButton.LeftButton:
            self.is_enabled ^= True
            self.toggled.emit(self.is_enabled)
            ev.accept()

    def paintEvent(self, ev):
        painter = QPainter(self)
        painter.setRenderHint(QPainter.RenderHint.TextAntialiasing)
        f = painter.font()
        f.setBold(True)
        f.setPixelSize(self.height() - 1)
        painter.setFont(f)
        painter.setPen(QColor('red' if self.is_enabled else 'green'))
        painter.drawText(self.rect(), Qt.AlignmentFlag.AlignCenter, 'Z')
        painter.end()


class StatusBar(QStatusBar):

    search_bar_hidden = pyqtSignal()
    do_search = pyqtSignal(object, object)
    change_passthrough = pyqtSignal(bool)

    def __init__(self, downloads_indicator, parent=None):
        QStatusBar.__init__(self, parent)
        self.setMaximumHeight(STATUS_BAR_HEIGHT)

        self.setMinimumHeight(STATUS_BAR_HEIGHT)