fluent_window

Module Contents

FluentWidget

Fluent widget

FluentWindowBase

Fluent window base class

FluentTitleBarButton

Fluent title bar button

FluentTitleBar

Fluent title bar

FluentWindow

Fluent window

MSFluentTitleBar

Fluent title bar

FluentWidgetTitleBar

Fluent title bar

MSFluentWindow

Fluent window in Microsoft Store style

SplitTitleBar

Title bar with minimize, maximum and close button

SplitFluentWindow

Fluent window with split style

FluentBackgroundTheme

Fluent background theme

class FluentWidget(parent=None)

Bases: qfluentwidgets.common.animation.BackgroundAnimationWidget, qfluentwidgets.components.widgets.frameless_window.FramelessWindow

Fluent widget

setCustomBackgroundColor(light, dark)

set custom background color

Parameters

light, dark: QColor | Qt.GlobalColor | str

background color in light/dark theme mode

paintEvent(e)
showEvent(e)
setMicaEffectEnabled(isEnabled: bool)

set whether the mica effect is enabled, only available on Win11

isMicaEffectEnabled()
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

setTitleBar(titleBar)

set custom title bar

Parameters

titleBar: TitleBar

title bar

class FluentWindowBase(parent=None)

Bases: FluentWidget

Fluent window base class

hBoxLayout
stackedWidget
navigationInterface = None
abstract addSubInterface(interface: PyQt5.QtWidgets.QWidget, icon: qfluentwidgets.common.icon.FluentIconBase | PyQt5.QtGui.QIcon | str, text: str, position=NavigationItemPosition.TOP)

add sub interface

abstract removeInterface(interface: PyQt5.QtWidgets.QWidget, isDelete=False)

remove sub interface

Parameters

interface: QWidget

sub interface to be removed

isDelete: bool

whether to delete the sub interface

switchTo(interface: PyQt5.QtWidgets.QWidget)
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

class FluentTitleBarButton(icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase, parent=None)

Bases: qframelesswindow.TitleBarButton

Fluent title bar button

setIcon(icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase)
icon() PyQt5.QtGui.QIcon
paintEvent(e)
class FluentTitleBar(parent)

Bases: qframelesswindow.TitleBar

Fluent title bar

iconLabel
titleLabel
vBoxLayout
buttonLayout
setTitle(title)
setIcon(icon)
class FluentWindow(parent=None)

Bases: FluentWindowBase

Fluent window

navigationInterface
widgetLayout
addSubInterface(interface: PyQt5.QtWidgets.QWidget, icon: 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

removeInterface(interface, isDelete=False)

remove sub interface

Parameters

interface: QWidget

sub interface to be removed

isDelete: bool

whether to delete the sub interface

resizeEvent(e)
class MSFluentTitleBar(parent)

Bases: FluentTitleBar

Fluent title bar

class FluentWidgetTitleBar(parent)

Bases: FluentTitleBar

Fluent title bar

class MSFluentWindow(parent=None)

Bases: FluentWindowBase

Fluent window in Microsoft Store style

navigationInterface
addSubInterface(interface: PyQt5.QtWidgets.QWidget, icon: 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

removeInterface(interface, isDelete=False)

remove sub interface

Parameters

interface: QWidget

sub interface to be removed

isDelete: bool

whether to delete the sub interface

class SplitTitleBar(parent)

Bases: qframelesswindow.TitleBar

Title bar with minimize, maximum and close button

iconLabel
titleLabel
setTitle(title)
setIcon(icon)
class SplitFluentWindow(parent=None)

Bases: FluentWindow

Fluent window with split style

class FluentBackgroundTheme

Fluent background theme

DEFAULT
DEFAULT_BLUE