from PyQt5 import QtCore, QtGui, QtWidgets

## For each of the module there is a label and an icon. Icon can be changed by replacing the image location in the addPixmap method
class Modules(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1920, 1080)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.Subconhiringicon = QtWidgets.QPushButton(self.centralwidget)
        self.Subconhiringicon.setGeometry(QtCore.QRect(610, 170, 102, 90))
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.Subconhiringicon.sizePolicy().hasHeightForWidth())
        self.Subconhiringicon.setSizePolicy(sizePolicy)
        self.Subconhiringicon.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("hiring.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) ## For ex., replacing the image location for icon of hiring request module here will do the work. 
        self.Subconhiringicon.setIcon(icon)
        self.Subconhiringicon.setIconSize(QtCore.QSize(80, 80))
        self.Subconhiringicon.setObjectName("Subconhiringicon")
        self.subconhiring = QtWidgets.QLabel(self.centralwidget)
        self.subconhiring.setGeometry(QtCore.QRect(410, 310, 489, 23))
        font = QtGui.QFont()
        font.setPointSize(15)
        self.subconhiring.setFont(font)
        self.subconhiring.setText("Subcon Hiring Request")
        self.subconhiring.setAlignment(QtCore.Qt.AlignCenter)
        self.subconhiring.setObjectName("subconhiring")

        ## Subcon Extension Button ##
        self.Subconextensionicon = QtWidgets.QPushButton(self.centralwidget)
        self.Subconextensionicon.setGeometry(QtCore.QRect(1200, 380, 102, 90))
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.Subconextensionicon.sizePolicy().hasHeightForWidth())
        self.Subconextensionicon.setSizePolicy(sizePolicy)
        self.Subconextensionicon.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("renewal.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.Subconextensionicon.setIcon(icon)
        self.Subconextensionicon.setIconSize(QtCore.QSize(80, 80))
        self.Subconextensionicon.setObjectName("Subconextensionicon")
        self.Subconextension = QtWidgets.QLabel(self.centralwidget)
        self.Subconextension.setGeometry(QtCore.QRect(1010, 520, 489, 23))
        font = QtGui.QFont()
        font.setPointSize(15)
        self.Subconextension.setFont(font)
        self.Subconextension.setAlignment(QtCore.Qt.AlignCenter)
        self.Subconextension.setText("Subcon Extension")
        self.Subconextension.setObjectName("Subconextension")

        ## Allocation Update Module ## 
        self.Subconallocationicon = QtWidgets.QPushButton(self.centralwidget)
        self.Subconallocationicon.setGeometry(QtCore.QRect(1200,170, 102, 90))
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.Subconallocationicon.sizePolicy().hasHeightForWidth())
        self.Subconallocationicon.setSizePolicy(sizePolicy)
        self.Subconallocationicon.setStyleSheet('background-color: 	#404040;')
        self.Subconallocationicon.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("allocation.jpg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.Subconallocationicon.setIcon(icon)
        self.Subconallocationicon.setIconSize(QtCore.QSize(80, 80))
        self.Subconallocationicon.setObjectName("Subconallocationicon")
        self.subconallocation = QtWidgets.QLabel(self.centralwidget)
        self.subconallocation.setGeometry(QtCore.QRect(1010, 310, 489, 23))
        font = QtGui.QFont()
        font.setPointSize(15)
        self.subconallocation.setFont(font)
        self.subconallocation.setAlignment(QtCore.Qt.AlignCenter)
        self.subconallocation.setText("Subcon Allocation Details")
        self.subconallocation.setObjectName("subconallocation")

        ## Subcon Portfolio module ##
        self.Subconportfolioicon = QtWidgets.QPushButton(self.centralwidget)
        self.Subconportfolioicon.setGeometry(QtCore.QRect(610, 580, 102, 90))
        self.Subconportfolioicon.setStyleSheet('background-color: 	#404040;')
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.Subconportfolioicon.sizePolicy().hasHeightForWidth())
        self.Subconportfolioicon.setSizePolicy(sizePolicy)
        self.Subconportfolioicon.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("portfolio.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.Subconportfolioicon.setIcon(icon)
        self.Subconportfolioicon.setIconSize(QtCore.QSize(80, 80))
        self.Subconportfolioicon.setObjectName("Subconportfolioicon")
        self.Subconportfolio = QtWidgets.QLabel(self.centralwidget)
        self.Subconportfolio.setGeometry(QtCore.QRect(410, 710, 489, 23))
        font = QtGui.QFont()
        font.setPointSize(15)
        self.Subconportfolio.setFont(font)
        self.Subconportfolio.setAlignment(QtCore.Qt.AlignCenter)
        self.Subconportfolio.setObjectName("Subconportfolio")
        self.Subconportfolio.setText("Subcon Portfolio")
        
        ## Subcon Performance Evaluation module ##
        self.label_10 = QtWidgets.QLabel(self.centralwidget)
        self.label_10.setGeometry(QtCore.QRect(1010, 710, 489, 23))
        font = QtGui.QFont()
        font.setPointSize(15)
        self.label_10.setFont(font)
        self.label_10.setAlignment(QtCore.Qt.AlignCenter)
        self.label_10.setObjectName("label_10")
        self.label_10.setText("Subcon Performance Evaluation")
        self.Subconperformanceicon = QtWidgets.QPushButton(self.centralwidget)
        self.Subconperformanceicon.setGeometry(QtCore.QRect(1200, 580, 102, 90))
        self.Subconperformanceicon.setStyleSheet('background-color: 	#404040;')
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.Subconperformanceicon.sizePolicy().hasHeightForWidth())
        self.Subconperformanceicon.setSizePolicy(sizePolicy)
        self.Subconperformanceicon.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("performance.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.Subconperformanceicon.setIcon(icon)
        self.Subconperformanceicon.setIconSize(QtCore.QSize(80, 80))
        self.Subconperformanceicon.setObjectName("Subconperformanceicon")
        
        ## Vendor Management module ##
        self.Vendor = QtWidgets.QLabel(self.centralwidget)
        self.Vendor.setGeometry(QtCore.QRect(1010, 910, 489, 23))
        font = QtGui.QFont()
        font.setPointSize(15)
        self.Vendor.setFont(font)
        self.Vendor.setAlignment(QtCore.Qt.AlignCenter)
        self.Vendor.setObjectName("Vendor")
        self.Vendor.setText("Vendor Management")
        self.Vendoricon = QtWidgets.QPushButton(self.centralwidget)
        self.Vendoricon.setGeometry(QtCore.QRect(1200, 780, 102, 90))
        self.Vendoricon.setStyleSheet('background-color: 	#404040;')
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.Vendoricon.sizePolicy().hasHeightForWidth())
        self.Vendoricon.setSizePolicy(sizePolicy)
        self.Vendoricon.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("Vendor.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.Vendoricon.setIcon(icon)
        self.Vendoricon.setIconSize(QtCore.QSize(80, 80))
        self.Vendoricon.setObjectName("Vendoricon")


        ## Timesheet module ##
        self.Timesheeticon = QtWidgets.QPushButton(self.centralwidget)
        self.Timesheeticon.setGeometry(QtCore.QRect(610, 380, 102, 90))
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.Timesheeticon.sizePolicy().hasHeightForWidth())
        self.Timesheeticon.setSizePolicy(sizePolicy)
        self.Timesheeticon.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("timesheet.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.Timesheeticon.setIcon(icon)
        self.Timesheeticon.setIconSize(QtCore.QSize(80, 80))
        self.Timesheeticon.setObjectName("Timesheeticon")
        self.Timesheet = QtWidgets.QLabel(self.centralwidget)
        self.Timesheet.setGeometry(QtCore.QRect(410, 520, 489, 23))
        font = QtGui.QFont()
        font.setPointSize(15)
        self.Timesheet.setFont(font)
        self.Timesheet.setAlignment(QtCore.Qt.AlignCenter)
        self.Timesheet.setObjectName("Timesheet")
        self.Timesheet.setText("Timesheet and Expenses")

        ## Dashboard module ##
        self.Dashboardicon = QtWidgets.QPushButton(self.centralwidget)
        self.Dashboardicon.setGeometry(QtCore.QRect(610, 780, 102, 90))
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.Dashboardicon.sizePolicy().hasHeightForWidth())
        self.Dashboardicon.setSizePolicy(sizePolicy)
        self.Dashboardicon.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("dashboard.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.Dashboardicon.setIcon(icon)
        self.Dashboardicon.setIconSize(QtCore.QSize(80, 80))
        self.Dashboardicon.setObjectName("Dashboardicon")
        self.Dashboard = QtWidgets.QLabel(self.centralwidget)
        self.Dashboard.setGeometry(QtCore.QRect(410, 910, 489, 23))
        font = QtGui.QFont()
        font.setPointSize(15)
        self.Dashboard.setFont(font)
        self.Dashboard.setAlignment(QtCore.Qt.AlignCenter)
        self.Dashboard.setObjectName("Dashboard")
        self.Dashboard.setText("Dashboard")
        
        MainWindow.setCentralWidget(self.centralwidget)

        ## Menubar ##
        self.menubar = QtWidgets.QMenuBar(self.centralwidget)
        self.menubar.setStyleSheet("QMenuBar{background-color: rgb(0,0,0); color: #e0e0e0; font-size: 20px;} QMenuBar::item:selected{background-color: #e0e0e0; color: #2e2e2e; font-size: 20px;} QMenu{background-color: rgb(0,0,0); color: rgb(255,255,255); font-size: 18px; font-weight: 150} QMenu::item:selected{background-color: #e0e0e0; color: #2e2e2e; font-size: 18px;}") ## Properties of Menubar
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1920, 32))
        self.homescreen = QtWidgets.QAction("Home", self.menubar) ## Home Button on Menubar
        self.font_1 = QtGui.QFont()
        self.font_1.setBold(True)
        self.font_1.setWeight(30)
        self.menubar.addAction(self.homescreen)
        self.modules_menu = self.menubar.addMenu("Modules")  ## Modules menu
        self.modules_menu.setFont(self.font_1)
        self.accessdashboard = QtWidgets.QAction("Dashboard", self.menubar) ## Dashboard Menu
        self.menubar.addAction(self.accessdashboard)

        ## Sub-menus under Modules Menu
        self.hiring = QtWidgets.QAction("Subcon Hiring Request", self.menubar)
        self.renewal = QtWidgets.QAction("Subcon Renewal", self.menubar)
        self.allocation = QtWidgets.QAction("Subcon Allocation Update", self.menubar)
        self.performance  = QtWidgets.QAction("Subcon Performance Evaluation", self.menubar)
        self.portfolio = QtWidgets.QAction("Subcon Portfolio", self.menubar)
        self.timesheet = QtWidgets.QAction("Timesheet and Expenses", self.menubar)
        self.vendor = QtWidgets.QAction("Vendor Management", self.menubar)
        self.modules_menu.addAction(self.hiring)
        self.modules_menu.addAction(self.renewal)
        self.modules_menu.addAction(self.allocation)
        self.modules_menu.addAction(self.performance)
        self.modules_menu.addAction(self.portfolio)
        self.modules_menu.addAction(self.timesheet)
        self.modules_menu.addAction(self.vendor)
        
        QtCore.QMetaObject.connectSlotsByName(MainWindow)


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Modules()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())

