You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.4 KiB
58 lines
1.4 KiB
# coding: utf-8
|
|
from PySide6.QtCore import Qt
|
|
from PySide6.QtDesigner import QDesignerCustomWidgetInterface
|
|
|
|
from qfluentwidgets import NavigationInterface, NavigationPanel, Pivot
|
|
|
|
from plugin_base import PluginBase
|
|
|
|
|
|
class NavigationPlugin(PluginBase):
|
|
|
|
def group(self):
|
|
return super().group() + ' (Navigation)'
|
|
|
|
|
|
class NavigationInterfacePlugin(NavigationPlugin, QDesignerCustomWidgetInterface):
|
|
""" Navigation interface plugin """
|
|
|
|
def createWidget(self, parent):
|
|
return NavigationInterface(parent, True, True)
|
|
|
|
def icon(self):
|
|
return super().icon("NavigationView")
|
|
|
|
def name(self):
|
|
return "NavigationInterface"
|
|
|
|
|
|
class NavigationPanelPlugin(NavigationPlugin, QDesignerCustomWidgetInterface):
|
|
""" Navigation panel plugin """
|
|
|
|
def createWidget(self, parent):
|
|
return NavigationPanel(parent)
|
|
|
|
def icon(self):
|
|
return super().icon("NavigationView")
|
|
|
|
def name(self):
|
|
return "NavigationPanel"
|
|
|
|
|
|
class PivotPlugin(NavigationPlugin, QPyDesignerCustomWidgetPlugin):
|
|
""" Navigation panel plugin """
|
|
|
|
def createWidget(self, parent):
|
|
p = Pivot(parent)
|
|
for i in range(1, 4):
|
|
p.addItem(f'Item{i}', f'Item{i}', print)
|
|
|
|
p.setCurrentItem('Item1')
|
|
return p
|
|
|
|
def icon(self):
|
|
return super().icon("Pivot")
|
|
|
|
def name(self):
|
|
return "Pivot"
|