fluent_window ============= .. py:module:: qfluentwidgets.window.fluent_window Module Contents --------------- .. autoapisummary:: qfluentwidgets.window.fluent_window.FluentWidget qfluentwidgets.window.fluent_window.FluentWindowBase qfluentwidgets.window.fluent_window.FluentTitleBarButton qfluentwidgets.window.fluent_window.FluentTitleBar qfluentwidgets.window.fluent_window.FluentWindow qfluentwidgets.window.fluent_window.MSFluentTitleBar qfluentwidgets.window.fluent_window.FluentWidgetTitleBar qfluentwidgets.window.fluent_window.MSFluentWindow qfluentwidgets.window.fluent_window.SplitTitleBar qfluentwidgets.window.fluent_window.SplitFluentWindow qfluentwidgets.window.fluent_window.FluentBackgroundTheme .. py:class:: FluentWidget(parent=None) Bases: :py:obj:`qfluentwidgets.common.animation.BackgroundAnimationWidget`, :py:obj:`qfluentwidgets.components.widgets.frameless_window.FramelessWindow` Fluent widget .. py:method:: setCustomBackgroundColor(light, dark) set custom background color Parameters ---------- light, dark: QColor | Qt.GlobalColor | str background color in light/dark theme mode .. py:method:: paintEvent(e) .. py:method:: showEvent(e) .. py:method:: setMicaEffectEnabled(isEnabled: bool) set whether the mica effect is enabled, only available on Win11 .. py:method:: isMicaEffectEnabled() .. py:method:: systemTitleBarRect(size: PyQt5.QtCore.QSize) -> PyQt5.QtCore.QRect Returns the system title bar rect, only works for macOS Parameters ---------- size: QSize original system title bar rect .. py:method:: setTitleBar(titleBar) set custom title bar Parameters ---------- titleBar: TitleBar title bar .. py:class:: FluentWindowBase(parent=None) Bases: :py:obj:`FluentWidget` Fluent window base class .. py:attribute:: hBoxLayout .. py:attribute:: stackedWidget .. py:attribute:: navigationInterface :value: None .. py:method:: addSubInterface(interface: PyQt5.QtWidgets.QWidget, icon: Union[qfluentwidgets.common.icon.FluentIconBase, PyQt5.QtGui.QIcon, str], text: str, position=NavigationItemPosition.TOP) :abstractmethod: add sub interface .. py:method:: removeInterface(interface: PyQt5.QtWidgets.QWidget, isDelete=False) :abstractmethod: remove sub interface Parameters ---------- interface: QWidget sub interface to be removed isDelete: bool whether to delete the sub interface .. py:method:: switchTo(interface: PyQt5.QtWidgets.QWidget) .. py:method:: systemTitleBarRect(size: PyQt5.QtCore.QSize) -> PyQt5.QtCore.QRect Returns the system title bar rect, only works for macOS Parameters ---------- size: QSize original system title bar rect .. py:class:: FluentTitleBarButton(icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase], parent=None) Bases: :py:obj:`qframelesswindow.TitleBarButton` Fluent title bar button .. py:method:: setIcon(icon: Union[str, PyQt5.QtGui.QIcon, qfluentwidgets.common.icon.FluentIconBase]) .. py:method:: icon() -> PyQt5.QtGui.QIcon .. py:method:: paintEvent(e) .. py:class:: FluentTitleBar(parent) Bases: :py:obj:`qframelesswindow.TitleBar` Fluent title bar .. py:attribute:: iconLabel .. py:attribute:: titleLabel .. py:attribute:: vBoxLayout .. py:attribute:: buttonLayout .. py:method:: setTitle(title) .. py:method:: setIcon(icon) .. py:class:: FluentWindow(parent=None) Bases: :py:obj:`FluentWindowBase` Fluent window .. py:attribute:: navigationInterface .. py:attribute:: widgetLayout .. py:method:: addSubInterface(interface: PyQt5.QtWidgets.QWidget, icon: Union[qfluentwidgets.common.icon.FluentIconBase, PyQt5.QtGui.QIcon, str], text: str, position=NavigationItemPosition.TOP, parent=None, isTransparent=False) -> qfluentwidgets.components.navigation.NavigationTreeWidget add sub interface, the object name of `interface` should be set already before calling this method Parameters ---------- interface: QWidget the subinterface to be added icon: FluentIconBase | QIcon | str the icon of navigation item text: str the text of navigation item position: NavigationItemPosition the position of navigation item parent: QWidget | str * QWidget: the parent of navigation item * str: the parent route key of navigation item isTransparent: bool whether to use transparent background .. py:method:: removeInterface(interface, isDelete=False) remove sub interface Parameters ---------- interface: QWidget sub interface to be removed isDelete: bool whether to delete the sub interface .. py:method:: resizeEvent(e) .. py:class:: MSFluentTitleBar(parent) Bases: :py:obj:`FluentTitleBar` Fluent title bar .. py:class:: FluentWidgetTitleBar(parent) Bases: :py:obj:`FluentTitleBar` Fluent title bar .. py:class:: MSFluentWindow(parent=None) Bases: :py:obj:`FluentWindowBase` Fluent window in Microsoft Store style .. py:attribute:: navigationInterface .. py:method:: addSubInterface(interface: PyQt5.QtWidgets.QWidget, icon: Union[qfluentwidgets.common.icon.FluentIconBase, PyQt5.QtGui.QIcon, str], text: str, selectedIcon=None, position=NavigationItemPosition.TOP, isTransparent=False) -> qfluentwidgets.components.navigation.NavigationBarPushButton add sub interface, the object name of `interface` should be set already before calling this method Parameters ---------- interface: QWidget the subinterface to be added icon: FluentIconBase | QIcon | str the icon of navigation item text: str the text of navigation item selectedIcon: str | QIcon | FluentIconBase the icon of navigation item in selected state position: NavigationItemPosition the position of navigation item .. py:method:: removeInterface(interface, isDelete=False) remove sub interface Parameters ---------- interface: QWidget sub interface to be removed isDelete: bool whether to delete the sub interface .. py:class:: SplitTitleBar(parent) Bases: :py:obj:`qframelesswindow.TitleBar` Title bar with minimize, maximum and close button .. py:attribute:: iconLabel .. py:attribute:: titleLabel .. py:method:: setTitle(title) .. py:method:: setIcon(icon) .. py:class:: SplitFluentWindow(parent=None) Bases: :py:obj:`FluentWindow` Fluent window with split style .. py:class:: FluentBackgroundTheme Fluent background theme .. py:attribute:: DEFAULT .. py:attribute:: DEFAULT_BLUE