# -*- coding: utf-8 -*-

# Proc_MainWin_Staff implementation generated from reading ui file 'proc_mainwin_ui_staff.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

from PyUiFiles.proc_mainwin_staff_ui.attendanceinfo_show_ui import Ui_AttendanceInfo_ui
from PyUiWidgets.uni_showdateinfo_widget import Uni_ShowDateInfo_Widget
from PyUiWidgets.showmanagerinfo_widget import ShowManager_Widget

class Proc_MainWin_Ui_Staff(object):
    def setupUi(self, Proc_MainWin_Staff):
        Proc_MainWin_Staff.setObjectName("Proc_MainWin_Staff")
        Proc_MainWin_Staff.resize(1035, 800)
        Proc_MainWin_Staff.setStyleSheet("""QWidget#Proc_MainWin_Staff{
                                            background-color: rgb(225,225,225);
                                            border-bottom-right-radius: 10px;
                                            border-bottom-left-radius: 10px;
                                            }""")
        self.gridLayout_2 = QtWidgets.QGridLayout(Proc_MainWin_Staff)
        self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.main_top_layout = QtWidgets.QHBoxLayout()
        self.main_top_layout.setContentsMargins(10, 10, 10, 5)
        #self.main_top_layout.setSpacing(13)
        self.main_top_layout.setObjectName("main_top_layout")

        '''init calendar show part'''
        self.calendar_container_widget = QtWidgets.QWidget(Proc_MainWin_Staff)
        self.calendar_container_widget.setObjectName("calendar_container_widget")
        self.calendar_container_widget.setStyleSheet(""" QWidget#calendar_container_widget{border-radius:8px;
                                                    background-color: rgba(245, 245, 245, 155);}""")
        self.gridLayout = QtWidgets.QGridLayout(self.calendar_container_widget)
        self.gridLayout.setSpacing(11)
        self.gridLayout.setObjectName("gridLayout")
        self.calendarWidget = QtWidgets.QCalendarWidget(self.calendar_container_widget)
        self.calendarWidget.setObjectName("calendarWidget")

        # set calendar basic style
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei")
        font.setBold(True)
        font.setPointSize(17)
        self.calendarWidget.setFont(font)
        #self.calendarWidget.setGridVisible(True)
        self.calendarWidget.setNavigationBarVisible(True)
        self.calendarWidget.setVerticalHeaderFormat(QCalendarWidget.NoVerticalHeader)

        cdate=QDate.currentDate()   #获取今天的日期
        format=QTextCharFormat()     
        format.setBackground(QColor(95,158,160))  #设置格式，颜色自选
        self.calendarWidget.setDateTextFormat(cdate, format) #生效配置

        self.gridLayout.addWidget(self.calendarWidget, 0, 0, 1, 1)
        self.gridLayout.setContentsMargins(15,15,15,15)
        self.main_top_layout.addWidget(self.calendar_container_widget)

        '''right part'''
        self.main_right_layout = QtWidgets.QVBoxLayout()
        self.main_right_layout.setContentsMargins(5, 5, 5, 5)
        self.main_right_layout.setObjectName("main_right_layout")
        
        '''today info'''
        self.todayshow_container_widget = QtWidgets.QWidget(Proc_MainWin_Staff)
        self.todayshow_container_widget.setStyleSheet("""QWidget#todayshow_container_widget{border-radius:8px;
                                                        background-color: rgba(255, 222, 173, 155);}""")
        self.todayshow_container_widget.setObjectName("todayshow_container_widget")

        '''add date infos'''
        self.subrightlayout=QtWidgets.QVBoxLayout(self.todayshow_container_widget)
        self.label_showMonthInfo = QtWidgets.QLabel(self.todayshow_container_widget)
        self.label_showMonthInfo.setAlignment(QtCore.Qt.AlignCenter)
        self.label_showMonthInfo.setObjectName("label_showMonthInfo")
        self.subrightlayout.addWidget(self.label_showMonthInfo)
        self.label_showMonthInfo.setAttribute(Qt.WA_TranslucentBackground, True)

        # '''set img'''
        # self.label_showMonthInfo.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored)
        # self.label_showMonthInfo.setScaledContents(True)
        # self.label_showMonthInfo.setStyleSheet("border-radius:8px;")
        #print(self.label_showMonthInfo.size())

        self.label_DayInfo=Uni_ShowDateInfo_Widget()
        self.label_DayInfo.setObjectName("label_DayInfo")

        #self.label_DayInfo.setAttribute(Qt.WA_TranslucentBackground, True)
        self.subrightlayout.addWidget(self.label_DayInfo)

        self.subrightlayout.setStretch(0,1)
        self.subrightlayout.setStretch(1,1)


        self.main_right_layout.addWidget(self.todayshow_container_widget)
        '''manager info'''
        self.managerinfo_container_widget = QtWidgets.QWidget(Proc_MainWin_Staff)
        self.managerinfo_container_widget.setStyleSheet("""QWidget#managerinfo_container_widget{border-radius:8px;
                                                            background-color: rgba(170, 255, 127, 155);}""")
        self.managerinfo_container_widget.setObjectName("managerinfo_container_widget")

        self.layout_widgetManagerInfoContainer=QGridLayout(self.managerinfo_container_widget)
        self.showmanagerwidget=ShowManager_Widget()
        self.layout_widgetManagerInfoContainer.addWidget(self.showmanagerwidget)
        self.layout_widgetManagerInfoContainer.setContentsMargins(5,5,5,5)

        self.main_right_layout.addWidget(self.managerinfo_container_widget)
        self.main_right_layout.setStretch(0, 5)
        self.main_right_layout.setStretch(1, 4)
        self.main_top_layout.addLayout(self.main_right_layout)
        self.main_top_layout.setStretch(0, 3)
        self.main_top_layout.setStretch(1, 1)
        self.gridLayout_2.addLayout(self.main_top_layout, 0, 0, 1, 1)

        '''down part'''
        self.main_down_layout = QtWidgets.QHBoxLayout()
        self.main_down_layout.setContentsMargins(10, 5, 10, 10)
        self.main_down_layout.setObjectName("main_down_layout")

        '''all staff attendance info for today'''
        self.totalattendance_container_widget = QtWidgets.QWidget(Proc_MainWin_Staff)
        self.totalattendance_container_widget.main_ui=Ui_AttendanceInfo_ui()
        self.totalattendance_container_widget.main_ui.setupUi(self.totalattendance_container_widget)
        self.totalattendance_container_widget.setStyleSheet("""QWidget#totalattendance_container_widget{border-radius:8px;
                                                                background-color: rgba(72, 209, 204, 155);}""")
        self.totalattendance_container_widget.setObjectName("totalattendance_container_widget")
        self.main_down_layout.addWidget(self.totalattendance_container_widget)

        '''check in btn'''
        self.btn_checkIn = QtWidgets.QPushButton(Proc_MainWin_Staff)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.btn_checkIn.sizePolicy().hasHeightForWidth())
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei")
        font.setPointSize(25)
        self.btn_checkIn.setFont(font)
        self.btn_checkIn.setSizePolicy(sizePolicy)
        self.btn_checkIn.setObjectName("btn_checkIn")
        self.main_down_layout.addWidget(self.btn_checkIn)

        '''application part'''
        self.application_container_widget = QtWidgets.QWidget(Proc_MainWin_Staff)
        self.application_container_widget.setStyleSheet("""QWidget#application_container_widget{border-radius:8px;
                                                            background-color: rgba(255, 255, 255, 155);}""")
        self.application_container_widget.setObjectName("application_container_widget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.application_container_widget)
        self.verticalLayout.setObjectName("verticalLayout")
        # btn to show "ask for a break day win"
        self.btn_dayBreakApplication = QtWidgets.QPushButton(self.application_container_widget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.btn_dayBreakApplication.sizePolicy().hasHeightForWidth())
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei")
        font.setPointSize(14)
        self.btn_dayBreakApplication.setFont(font)
        self.btn_dayBreakApplication.setSizePolicy(sizePolicy)
        self.btn_dayBreakApplication.setAutoFillBackground(False)
        self.btn_dayBreakApplication.setStyleSheet("")
        self.btn_dayBreakApplication.setAutoDefault(False)
        self.btn_dayBreakApplication.setFlat(False)
        self.btn_dayBreakApplication.setObjectName("btn_dayBreakApplication")
        self.verticalLayout.addWidget(self.btn_dayBreakApplication)

        # btn to show "complain win"
        self.btn_complainApplication = QtWidgets.QPushButton(self.application_container_widget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.btn_complainApplication.sizePolicy().hasHeightForWidth())
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei")
        font.setPointSize(14)
        self.btn_complainApplication.setFont(font)
        self.btn_complainApplication.setSizePolicy(sizePolicy)
        self.btn_complainApplication.setAutoFillBackground(False)
        self.btn_complainApplication.setObjectName("btn_complainApplication")
        self.verticalLayout.addWidget(self.btn_complainApplication)
        self.main_down_layout.addWidget(self.application_container_widget)

        '''some layout setting'''
        self.main_down_layout.setStretch(0, 9)
        self.main_down_layout.setStretch(1, 2)
        self.main_down_layout.setStretch(2, 2)
        self.gridLayout_2.addLayout(self.main_down_layout, 1, 0, 1, 1)
        self.gridLayout_2.setRowStretch(0, 5)
        self.gridLayout_2.setRowStretch(1, 2)

        '''enhance shadow for container'''
        shadow_effect=QGraphicsDropShadowEffect()
        # shadow margin
        shadow_effect.setOffset(0,0)
        # shadow color
        shadow_effect.setColor(QColor("#444444"))
        # shadow radius
        shadow_effect.setBlurRadius(5)
        self.managerinfo_container_widget.setGraphicsEffect(shadow_effect)

        shadow_effect=QGraphicsDropShadowEffect()
        shadow_effect.setOffset(0,0)
        shadow_effect.setColor(QColor("#444444"))
        shadow_effect.setBlurRadius(5)
        #self.calendar_container_widget.setAttribute(Qt.WA_TranslucentBackground, True)
        self.calendar_container_widget.setGraphicsEffect(shadow_effect)

        shadow_effect=QGraphicsDropShadowEffect()
        shadow_effect.setOffset(0,0)
        shadow_effect.setColor(QColor("#444444"))
        shadow_effect.setBlurRadius(5)
        #self.todayshow_container_widget.setAttribute(Qt.WA_TranslucentBackground, True)
        self.todayshow_container_widget.setGraphicsEffect(shadow_effect)

        shadow_effect=QGraphicsDropShadowEffect()
        shadow_effect.setOffset(0,0)
        shadow_effect.setColor(QColor("#444444"))
        shadow_effect.setBlurRadius(5)
        #self.totalattendance_container_widget.setAttribute(Qt.WA_TranslucentBackground, True)
        self.totalattendance_container_widget.setGraphicsEffect(shadow_effect)

        shadow_effect=QGraphicsDropShadowEffect()
        shadow_effect.setOffset(0,0)
        shadow_effect.setColor(QColor("#444444"))
        shadow_effect.setBlurRadius(5)
        self.application_container_widget.setGraphicsEffect(shadow_effect)

        shadow_effect=QGraphicsDropShadowEffect()
        shadow_effect.setOffset(0,0)
        shadow_effect.setColor(QColor("#444444"))
        shadow_effect.setBlurRadius(5)
        self.btn_checkIn.setGraphicsEffect(shadow_effect)

        '''set calendar style'''
        with open("Qss/flatwhite_style.qss") as CalendarStyle:
            self.calendarWidget.setStyleSheet(CalendarStyle.read())

        '''set check-in btn style'''
        with open("Qss/push_button_style_lightred.qss") as BtnStyle:
            self.btn_checkIn.setStyleSheet(BtnStyle.read())

        '''set btn style'''
        with open("Qss/push_button_style.qss") as BtnStyle:
            self.btn_complainApplication.setStyleSheet(BtnStyle.read())
        with open("Qss/push_button_style_lightblue.qss") as BtnStyle:
            self.btn_dayBreakApplication.setStyleSheet(BtnStyle.read())

        self.retranslateUi(Proc_MainWin_Staff)
        QtCore.QMetaObject.connectSlotsByName(Proc_MainWin_Staff)

        '''init connection'''
        self.btn_checkIn.clicked.connect(Proc_MainWin_Staff.slot_GetCheckInWin)
        self.btn_dayBreakApplication.clicked.connect(Proc_MainWin_Staff.slot_BreakDayApply)
        self.btn_complainApplication.clicked.connect(Proc_MainWin_Staff.slot_ComplainApply)
        self.calendarWidget.currentPageChanged['int','int'].connect(Proc_MainWin_Staff.pageChange)


    def retranslateUi(self, Proc_MainWin_Staff):
        _translate = QtCore.QCoreApplication.translate
        Proc_MainWin_Staff.setWindowTitle(_translate("Proc_MainWin_Staff", "Proc_MainWin_Staff"))
        self.btn_checkIn.setText(_translate("Proc_MainWin_Staff", "签到"))
        self.btn_dayBreakApplication.setText(_translate("Proc_MainWin_Staff", "考勤请假申请"))
        self.btn_complainApplication.setText(_translate("Proc_MainWin_Staff", "考勤失败申诉"))
