Esempio n. 1
0
    def _apply_style(self, app: QApplication) -> None:
        buf = ""

        if is_win and platform.release() == "10":
            # day mode is missing a bottom border; background must be
            # also set for border to apply
            buf += f"""
QMenuBar {{
  border-bottom: 1px solid {self.color(colors.BORDER)};
  background: {self.color(colors.WINDOW_BG) if self.night_mode else "white"};
}}
"""
            # qt bug? setting the above changes the browser sidebar
            # to white as well, so set it back
            buf += f"""
QTreeWidget {{
  background: {self.color(colors.WINDOW_BG)};
}}
            """

        if self.night_mode:
            buf += """
QToolTip {
  border: 0;
}
            """

            if not self.macos_dark_mode():
                buf += """
QScrollBar {{ background-color: {}; }}
QScrollBar::handle {{ background-color: {}; border-radius: 5px; }} 

QScrollBar:horizontal {{ height: 12px; }}
QScrollBar::handle:horizontal {{ min-width: 50px; }} 

QScrollBar:vertical {{ width: 12px; }}
QScrollBar::handle:vertical {{ min-height: 50px; }} 
    
QScrollBar::add-line {{
      border: none;
      background: none;
}}

QScrollBar::sub-line {{
      border: none;
      background: none;
}}

QTabWidget {{ background-color: {}; }}
""".format(
                    self.color(colors.WINDOW_BG),
                    # fushion-button-hover-bg
                    "#656565",
                    self.color(colors.WINDOW_BG),
                )

        # allow addons to modify the styling
        buf = gui_hooks.style_did_init(buf)

        app.setStyleSheet(buf)
Esempio n. 2
0
    def _apply_style(self, app: QApplication) -> None:
        buf = ""

        if isWin and platform.release() == "10" and not self.night_mode:
            # add missing bottom border to menubar
            buf += """
QMenuBar {
  border-bottom: 1px solid #aaa;
  background: white;
}
"""
            # qt bug? setting the above changes the browser sidebar
            # to white as well, so set it back
            buf += """
QTreeWidget {
  background: #eee;
}
            """

        if self.night_mode:
            buf += """
QToolTip {
  border: 0;
}

QGroupBox {
  padding-top: 0px;
}              
            """

        # allow addons to modify the styling
        buf = gui_hooks.style_did_init(buf)

        app.setStyleSheet(buf)
Esempio n. 3
0
    def setupStyle(self) -> None:
        buf = ""

        if isWin and platform.release() == "10":
            # add missing bottom border to menubar
            buf += """
QMenuBar {
  border-bottom: 1px solid #aaa;
  background: white;
}        
"""
            # qt bug? setting the above changes the browser sidebar
            # to white as well, so set it back
            buf += """
QTreeWidget {
  background: #eee;
}            
            """

        # allow addons to modify the styling
        buf = gui_hooks.style_did_init(buf)

        # allow users to extend styling
        p = os.path.join(aqt.mw.pm.base, "style.css")
        if os.path.exists(p):
            buf += open(p).read()

        self.app.setStyleSheet(buf)
Esempio n. 4
0
    def _apply_style(self, app: QApplication) -> None:
        buf = ""

        if isWin and platform.release() == "10" and not self.night_mode:
            # add missing bottom border to menubar
            buf += """
QMenuBar {
  border-bottom: 1px solid #aaa;
  background: white;
}
"""
            # qt bug? setting the above changes the browser sidebar
            # to white as well, so set it back
            buf += """
QTreeWidget {
  background: #eee;
}
            """

        if self.night_mode:
            buf += """
QToolTip {
  border: 0;
}
            """

            if not self.macos_dark_mode():
                buf += """
QScrollBar { background-color: %s; }
QScrollBar::handle { background-color: %s; border-radius: 5px; } 

QScrollBar:horizontal { height: 12px; }
QScrollBar::handle:horizontal { min-width: 50px; } 

QScrollBar:vertical { width: 12px; }
QScrollBar::handle:vertical { min-height: 50px; } 
    
QScrollBar::add-line {
      border: none;
      background: none;
}

QScrollBar::sub-line {
      border: none;
      background: none;
}

QTabWidget { background-color: %s; }
""" % (
                    self.color(colors.WINDOW_BG),
                    # fushion-button-hover-bg
                    "#656565",
                    self.color(colors.WINDOW_BG),
                )

        # allow addons to modify the styling
        buf = gui_hooks.style_did_init(buf)

        app.setStyleSheet(buf)