def standard_css(self) -> str: palette = theme_manager.default_palette color_hl = palette.color(QPalette.ColorRole.Highlight).name() if isWin: # T: include a font for your language on Windows, eg: "Segoe UI", "MS Mincho" family = tr.qt_misc_segoe_ui() button_style = "button { font-family:%s; }" % family button_style += "\n:focus { outline: 1px solid %s; }" % color_hl font = f"font-size:12px;font-family:{family};" elif isMac: family = "Helvetica" font = f'font-size:15px;font-family:"{family}";' button_style = """ button { -webkit-appearance: none; background: #fff; border: 1px solid #ccc; border-radius:5px; font-family: Helvetica }""" else: family = self.font().family() color_hl_txt = palette.color( QPalette.ColorRole.HighlightedText).name() color_btn = palette.color(QPalette.ColorRole.Button).name() font = f'font-size:14px;font-family:"{family}";' button_style = """ /* Buttons */ button{{ background-color: {color_btn}; font-family:"{family}"; }} button:focus{{ border-color: {color_hl} }} button:active, button:active:hover {{ background-color: {color_hl}; color: {color_hl_txt};}} /* Input field focus outline */ textarea:focus, input:focus, input[type]:focus, .uneditable-input:focus, div[contenteditable="true"]:focus {{ outline: 0 none; border-color: {color_hl}; }}""".format( family=family, color_btn=color_btn, color_hl=color_hl, color_hl_txt=color_hl_txt, ) zoom = self.zoomFactor() window_bg_day = self.get_window_bg_color(False).name() window_bg_night = self.get_window_bg_color(True).name() body_bg = window_bg_night if theme_manager.night_mode else window_bg_day if is_rtl(anki.lang.currentLang): lang_dir = "rtl" else: lang_dir = "ltr" return f"""
def standard_css(self) -> str: palette = self.style().standardPalette() color_hl = palette.color(QPalette.Highlight).name() if isWin: # T: include a font for your language on Windows, eg: "Segoe UI", "MS Mincho" family = tr.qt_misc_segoe_ui() button_style = "button { font-family:%s; }" % family button_style += "\n:focus { outline: 1px solid %s; }" % color_hl font = f"font-size:12px;font-family:{family};" elif isMac: family = "Helvetica" font = f'font-size:15px;font-family:"{family}";' button_style = """ button { -webkit-appearance: none; background: #fff; border: 1px solid #ccc; border-radius:5px; font-family: Helvetica }""" else: family = self.font().family() color_hl_txt = palette.color(QPalette.HighlightedText).name() color_btn = palette.color(QPalette.Button).name() font = f'font-size:14px;font-family:"{family}";' button_style = """ /* Buttons */ button{ background-color: %(color_btn)s; font-family:"%(family)s"; } button:focus{ border-color: %(color_hl)s } button:active, button:active:hover { background-color: %(color_hl)s; color: %(color_hl_txt)s;} /* Input field focus outline */ textarea:focus, input:focus, input[type]:focus, .uneditable-input:focus, div[contenteditable="true"]:focus { outline: 0 none; border-color: %(color_hl)s; }""" % { "family": family, "color_btn": color_btn, "color_hl": color_hl, "color_hl_txt": color_hl_txt, } zoom = self.zoomFactor() background = self._getWindowColor().name() if is_rtl(anki.lang.currentLang): lang_dir = "rtl" else: lang_dir = "ltr" return f"""