aqt.theme
=========

.. py:module:: aqt.theme


Attributes
----------

.. autoapisummary::

   aqt.theme.theme_manager


Classes
-------

.. autoapisummary::

   aqt.theme.ColoredIcon
   aqt.theme.WidgetStyle
   aqt.theme.Theme
   aqt.theme.ThemeManager


Functions
---------

.. autoapisummary::

   aqt.theme.get_windows_dark_mode
   aqt.theme.set_macos_dark_mode
   aqt.theme.get_macos_dark_mode
   aqt.theme.get_linux_dark_mode


Module Contents
---------------

.. py:class:: ColoredIcon

   .. py:attribute:: path
      :type:  str


   .. py:attribute:: color
      :type:  dict[str, str]


   .. py:method:: current_color(night_mode: bool) -> str


   .. py:method:: with_color(color: dict[str, str]) -> ColoredIcon


.. py:class:: WidgetStyle

   Bases: :py:obj:`enum.IntEnum`


   Enum where members are also (and must be) ints


   .. py:attribute:: ANKI
      :value: 0



   .. py:attribute:: NATIVE
      :value: 1



.. py:class:: Theme

   Bases: :py:obj:`enum.IntEnum`


   Enum where members are also (and must be) ints


   .. py:attribute:: FOLLOW_SYSTEM
      :value: 0



   .. py:attribute:: LIGHT
      :value: 1



   .. py:attribute:: DARK
      :value: 2



.. py:class:: ThemeManager

   .. py:method:: rtl() -> bool


   .. py:method:: left() -> str


   .. py:method:: right() -> str


   .. py:attribute:: DARK_MODE_BUTTON_BG_MIDPOINT
      :value: '#555555'



   .. py:method:: macos_dark_mode() -> bool

      True if the user has night mode on.



   .. py:method:: get_night_mode() -> bool


   .. py:method:: set_night_mode(val: bool) -> None


   .. py:attribute:: night_mode


   .. py:method:: themed_icon(path: str) -> str

      Fetch themed version of svg.



   .. py:method:: icon_from_resources(path: str | ColoredIcon) -> aqt.qt.QIcon

      Fetch icon from Qt resources.



   .. py:method:: body_class(night_mode: bool | None = None, reviewer: bool = False) -> str

      Returns space-separated class list for platform/theme/global settings.



   .. py:method:: body_classes_for_card_ord(card_ord: int, night_mode: bool | None = None) -> str

      Returns body classes used when showing a card.



   .. py:method:: var(vars: dict[str, str]) -> str

      Given day/night colors/props, return the correct one for the current theme.



   .. py:method:: qcolor(colors: dict[str, str]) -> aqt.qt.QColor

      Create QColor instance from CSS string for the current theme.



   .. py:method:: apply_style() -> None

      Apply currently configured style.



.. py:function:: get_windows_dark_mode() -> bool

   True if Windows system is currently in dark mode.


.. py:function:: set_macos_dark_mode(enabled: bool) -> bool

   True if setting successful.


.. py:function:: get_macos_dark_mode() -> bool

   True if macOS system is currently in dark mode.


.. py:function:: get_linux_dark_mode() -> bool

   True if Linux system is in dark mode.
   Only works if D-Bus is installed and system uses org.freedesktop.appearance
   color-scheme to indicate dark mode preference OR if GNOME theme has
   '-dark' in the name.


.. py:data:: theme_manager

