# Path: qframer/fmoveablewidget.py
# class FMoveableWidget(QFrame):
# 
#     def __init__(self, parent=None):
#         super(FMoveableWidget, self).__init__(parent)
# 
#     def moveCenter(self):
#         qr = self.frameGeometry()
#         cp = QDesktopWidget().availableGeometry().center()
#         qr.moveCenter(cp)
#         self.move(qr.topLeft())
# 
#     def mousePressEvent(self, event):
#         self.setFocus()
#         # 鼠标点击事件
#         if event.button() == Qt.LeftButton:
#             self.dragPosition = event.globalPos() - \
#                 self.frameGeometry().topLeft()
#             event.accept()
# 
#     def mouseReleaseEvent(self, event):
#         # 鼠标释放事件
#         if hasattr(self, "dragPosition"):
#             del self.dragPosition
# 
#     def mouseMoveEvent(self, event):
#         if hasattr(self, "dragPosition"):
#             if event.buttons() == Qt.LeftButton:
#                 self.move(event.globalPos() - self.dragPosition)
#                 event.accept()
# 
# Path: qframer/ftitlebar.py
# class BaseToolButton(QPushButton):
# class FTitleBar(QFrame):
#     def __init__(self, parent=None):
#     def setMenu(self, menu):
#     def recover(self):
#     def __init__(self, parent=None):
#     def initData(self):
#     def initUI(self):
#     def swithModeIcon(self):
#     def swithLockIcon(self):
#     def swithPinIcon(self):
#     def swicthMaxIcon(self):
#     def mouseDoubleClickEvent(self, event):
#     def setLogo(self, icon):
#     def setTitle(self, text):
#     def getTitle(self):
#     def isLocked(self):
#     def isMax(self):


from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from .fmoveablewidget import FMoveableWidget
from .ftitlebar import BaseToolButton, baseHeight
        }
    '''

    def __init__(self, parent=None):
        super(FTitleBar, self).__init__(parent)
        self.initData()
        self.initUI()

    def initData(self):
        self.settingDownIcon = QIcon(":/icons/dark/appbar.control.down.png")
        self.clothesIcon = QIcon(":/icons/dark/appbar.clothes.shirt.png")
        self.lockIcon = QIcon(":/icons/dark/appbar.lock.png")
        self.unlockIcon = QIcon(":/icons/dark/appbar.unlock.keyhole.png")
        self.pinIcon = QIcon(":/icons/dark/appbar.pin.png")
        self.unPinIcon = QIcon(":/icons/dark/appbar.pin.remove.png")
        self.closeIcon = QIcon(":/icons/dark/appbar.close.png")

        self.max_flag = False
        self.lock_flag = False
        self.pin_flag = False

    def initUI(self):
        self.setFixedHeight(baseHeight)

        self.lockButton = BaseToolButton()
        self.lockButton.setIcon(self.unlockIcon)

        self.pinButton = BaseToolButton()
        self.pinButton.setIcon(self.unPinIcon)


# Path: qframer/fmoveablewidget.py
# class FMoveableWidget(QFrame):
# 
#     def __init__(self, parent=None):
#         super(FMoveableWidget, self).__init__(parent)
# 
#     def moveCenter(self):
#         qr = self.frameGeometry()
#         cp = QDesktopWidget().availableGeometry().center()
#         qr.moveCenter(cp)
#         self.move(qr.topLeft())
# 
#     def mousePressEvent(self, event):
#         self.setFocus()
#         # 鼠标点击事件
#         if event.button() == Qt.LeftButton:
#             self.dragPosition = event.globalPos() - \
#                 self.frameGeometry().topLeft()
#             event.accept()
# 
#     def mouseReleaseEvent(self, event):
#         # 鼠标释放事件
#         if hasattr(self, "dragPosition"):
#             del self.dragPosition
# 
#     def mouseMoveEvent(self, event):
#         if hasattr(self, "dragPosition"):
#             if event.buttons() == Qt.LeftButton:
#                 self.move(event.globalPos() - self.dragPosition)
#                 event.accept()
# 
# Path: qframer/ftitlebar.py
# class BaseToolButton(QPushButton):
# class FTitleBar(QFrame):
#     def __init__(self, parent=None):
#     def setMenu(self, menu):
#     def recover(self):
#     def __init__(self, parent=None):
#     def initData(self):
#     def initUI(self):
#     def swithModeIcon(self):
#     def swithLockIcon(self):
#     def swithPinIcon(self):
#     def swicthMaxIcon(self):
#     def mouseDoubleClickEvent(self, event):
#     def setLogo(self, icon):
#     def setTitle(self, text):
#     def getTitle(self):
#     def isLocked(self):
#     def isMax(self):


# Path: qframer/ffloatwidget.py
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from .fmoveablewidget import FMoveableWidget
from .ftitlebar import BaseToolButton, baseHeight

        }
    '''

    def __init__(self, parent=None):
        super(FTitleBar, self).__init__(parent)
        self.initData()
        self.initUI()

    def initData(self):
        self.settingDownIcon = QIcon(":/icons/dark/appbar.control.down.png")
        self.clothesIcon = QIcon(":/icons/dark/appbar.clothes.shirt.png")
        self.lockIcon = QIcon(":/icons/dark/appbar.lock.png")
        self.unlockIcon = QIcon(":/icons/dark/appbar.unlock.keyhole.png")
        self.pinIcon = QIcon(":/icons/dark/appbar.pin.png")
        self.unPinIcon = QIcon(":/icons/dark/appbar.pin.remove.png")
        self.closeIcon = QIcon(":/icons/dark/appbar.close.png")

        self.max_flag = False
        self.lock_flag = False
        self.pin_flag = False

    def initUI(self):
        self.setFixedHeight(baseHeight)

        self.lockButton = BaseToolButton()
        self.lockButton.setIcon(self.unlockIcon)

        self.pinButton = BaseToolButton()
        self.pinButton.setIcon(self.unPinIcon)


        self.settingDownButton = BaseToolButton()