Exemplo n.º 1
0
 def addAction(self,
               keyBindID,
               text,
               desc,
               icon=None,
               toolBar=False,
               checkable=False,
               menu=None,
               enabled=True):
     action = EditorAction(text, base.qtWindow, checkable, keyBindID)
     if icon is not None:
         icon = QtGui.QIcon(LEUtils.qtResolvePath(icon))
         action.setIcon(icon)
     action.setCheckable(checkable)
     action.setToolTip(desc)
     action.setStatusTip(desc)
     action.setIconVisibleInMenu(False)
     action.setShortcutVisibleInContextMenu(True)
     action.setEnabled(enabled)
     if toolBar:
         if isinstance(toolBar, bool):
             base.topBar.addAction(action)
         else:
             toolBar.addAction(action)
     if menu:
         menu.addAction(action)
     action.setShortcut(action.keyBind.shortcut)
     self.actions[keyBindID] = action
     return action
Exemplo n.º 2
0
    def __init__(self):
        QtWidgets.QApplication.__init__(self, [])

        pixmap = QtGui.QPixmap(
            LEUtils.qtResolvePath("icons/foundry-splash.png")).scaledToWidth(
                1024, QtCore.Qt.SmoothTransformation)
        splash = QtWidgets.QSplashScreen(self.primaryScreen(), pixmap,
                                         QtCore.Qt.WindowStaysOnTopHint)
        splash.show()
        self.processEvents()

        self.setWindowIcon(
            QtGui.QIcon(LEUtils.qtResolvePath("icons/foundry.ico")))

        self.setStyle("fusion")
        self.setStyleSheet(stylesheet)

        self.window = LevelEditorWindow()
        splash.finish(self.window)
        self.window.showMaximized()