|
@@ -49,25 +49,8 @@ from labelme.widgets import ZoomWidget
|
|
# - Zoom is too "steppy".
|
|
# - Zoom is too "steppy".
|
|
|
|
|
|
|
|
|
|
-class WindowMixin(object):
|
|
|
|
- def menu(self, title, actions=None):
|
|
|
|
- menu = self.menuBar().addMenu(title)
|
|
|
|
- if actions:
|
|
|
|
- addActions(menu, actions)
|
|
|
|
- return menu
|
|
|
|
-
|
|
|
|
- def toolbar(self, title, actions=None):
|
|
|
|
- toolbar = ToolBar(title)
|
|
|
|
- toolbar.setObjectName('%sToolBar' % title)
|
|
|
|
- # toolbar.setOrientation(Qt.Vertical)
|
|
|
|
- toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
|
|
|
|
- if actions:
|
|
|
|
- addActions(toolbar, actions)
|
|
|
|
- self.addToolBar(Qt.LeftToolBarArea, toolbar)
|
|
|
|
- return toolbar
|
|
|
|
-
|
|
|
|
|
|
+class MainWindow(QtWidgets.QMainWindow):
|
|
|
|
|
|
-class MainWindow(QtWidgets.QMainWindow, WindowMixin):
|
|
|
|
FIT_WINDOW, FIT_WIDTH, MANUAL_ZOOM = 0, 1, 2
|
|
FIT_WINDOW, FIT_WIDTH, MANUAL_ZOOM = 0, 1, 2
|
|
|
|
|
|
def __init__(
|
|
def __init__(
|
|
@@ -617,6 +600,22 @@ class MainWindow(QtWidgets.QMainWindow, WindowMixin):
|
|
# if self.firstStart:
|
|
# if self.firstStart:
|
|
# QWhatsThis.enterWhatsThisMode()
|
|
# QWhatsThis.enterWhatsThisMode()
|
|
|
|
|
|
|
|
+ def menu(self, title, actions=None):
|
|
|
|
+ menu = self.menuBar().addMenu(title)
|
|
|
|
+ if actions:
|
|
|
|
+ addActions(menu, actions)
|
|
|
|
+ return menu
|
|
|
|
+
|
|
|
|
+ def toolbar(self, title, actions=None):
|
|
|
|
+ toolbar = ToolBar(title)
|
|
|
|
+ toolbar.setObjectName('%sToolBar' % title)
|
|
|
|
+ # toolbar.setOrientation(Qt.Vertical)
|
|
|
|
+ toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
|
|
|
|
+ if actions:
|
|
|
|
+ addActions(toolbar, actions)
|
|
|
|
+ self.addToolBar(Qt.LeftToolBarArea, toolbar)
|
|
|
|
+ return toolbar
|
|
|
|
+
|
|
# Support Functions
|
|
# Support Functions
|
|
|
|
|
|
def noShapes(self):
|
|
def noShapes(self):
|