- added all the Tools in a new ToolBar
This commit is contained in:
parent
4d8eefb92d
commit
fac11586b3
|
@ -1289,6 +1289,19 @@ class App(QtCore.QObject):
|
||||||
self.ui.delete_btn.triggered.connect(self.on_delete)
|
self.ui.delete_btn.triggered.connect(self.on_delete)
|
||||||
self.ui.shell_btn.triggered.connect(self.on_toggle_shell)
|
self.ui.shell_btn.triggered.connect(self.on_toggle_shell)
|
||||||
|
|
||||||
|
# Tools Toolbar Signals
|
||||||
|
self.ui.dblsided_btn.triggered.connect(lambda: self.dblsidedtool.run())
|
||||||
|
self.ui.cutout_btn.triggered.connect(lambda: self.cutout_tool.run())
|
||||||
|
self.ui.ncc_btn.triggered.connect(lambda: self.ncclear_tool.run())
|
||||||
|
self.ui.paint_btn.triggered.connect(lambda: self.paint_tool.run())
|
||||||
|
|
||||||
|
self.ui.panelize_btn.triggered.connect(lambda: self.panelize_tool.run())
|
||||||
|
self.ui.film_btn.triggered.connect(lambda: self.film_tool.run())
|
||||||
|
self.ui.solder_btn.triggered.connect(lambda: self.paste_tool.run())
|
||||||
|
|
||||||
|
self.ui.calculators_btn.triggered.connect(lambda: self.calculator_tool.run())
|
||||||
|
self.ui.transform_btn.triggered.connect(lambda: self.transform_tool.run())
|
||||||
|
|
||||||
# Context Menu
|
# Context Menu
|
||||||
self.ui.popmenu_disable.triggered.connect(lambda: self.disable_plots(self.collection.get_selected()))
|
self.ui.popmenu_disable.triggered.connect(lambda: self.disable_plots(self.collection.get_selected()))
|
||||||
|
|
||||||
|
@ -2146,6 +2159,11 @@ class App(QtCore.QObject):
|
||||||
else:
|
else:
|
||||||
self.ui.snap_toolbar.setVisible(False)
|
self.ui.snap_toolbar.setVisible(False)
|
||||||
|
|
||||||
|
if tb & 128:
|
||||||
|
self.ui.toolbarshell.setVisible(True)
|
||||||
|
else:
|
||||||
|
self.ui.toolbarshell.setVisible(False)
|
||||||
|
|
||||||
def load_defaults(self, filename):
|
def load_defaults(self, filename):
|
||||||
"""
|
"""
|
||||||
Loads the aplication's default settings from current_defaults.FlatConfig into
|
Loads the aplication's default settings from current_defaults.FlatConfig into
|
||||||
|
@ -2161,14 +2179,14 @@ class App(QtCore.QObject):
|
||||||
self.log.error("Could not load defaults file.")
|
self.log.error("Could not load defaults file.")
|
||||||
self.inform.emit("[ERROR] Could not load defaults file.")
|
self.inform.emit("[ERROR] Could not load defaults file.")
|
||||||
# in case the defaults file can't be loaded, show all toolbars
|
# in case the defaults file can't be loaded, show all toolbars
|
||||||
self.defaults["global_toolbar_view"] = 127
|
self.defaults["global_toolbar_view"] = 255
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
defaults = json.loads(options)
|
defaults = json.loads(options)
|
||||||
except:
|
except:
|
||||||
# in case the defaults file can't be loaded, show all toolbars
|
# in case the defaults file can't be loaded, show all toolbars
|
||||||
self.defaults["global_toolbar_view"] = 127
|
self.defaults["global_toolbar_view"] = 255
|
||||||
e = sys.exc_info()[0]
|
e = sys.exc_info()[0]
|
||||||
App.log.error(str(e))
|
App.log.error(str(e))
|
||||||
self.inform.emit("[ERROR] Failed to parse defaults file.")
|
self.inform.emit("[ERROR] Failed to parse defaults file.")
|
||||||
|
@ -2733,6 +2751,9 @@ class App(QtCore.QObject):
|
||||||
if self.ui.snap_toolbar.isVisible():
|
if self.ui.snap_toolbar.isVisible():
|
||||||
tb_status += 64
|
tb_status += 64
|
||||||
|
|
||||||
|
if self.ui.toolbarshell.isVisible():
|
||||||
|
tb_status += 128
|
||||||
|
|
||||||
self.defaults["global_toolbar_view"] = tb_status
|
self.defaults["global_toolbar_view"] = tb_status
|
||||||
|
|
||||||
if not silent:
|
if not silent:
|
||||||
|
@ -3539,10 +3560,12 @@ class App(QtCore.QObject):
|
||||||
self.ui.removeToolBar(self.ui.toolbarfile)
|
self.ui.removeToolBar(self.ui.toolbarfile)
|
||||||
self.ui.removeToolBar(self.ui.toolbargeo)
|
self.ui.removeToolBar(self.ui.toolbargeo)
|
||||||
self.ui.removeToolBar(self.ui.toolbarview)
|
self.ui.removeToolBar(self.ui.toolbarview)
|
||||||
|
self.ui.removeToolBar(self.ui.toolbarshell)
|
||||||
self.ui.removeToolBar(self.ui.toolbartools)
|
self.ui.removeToolBar(self.ui.toolbartools)
|
||||||
self.ui.removeToolBar(self.ui.exc_edit_toolbar)
|
self.ui.removeToolBar(self.ui.exc_edit_toolbar)
|
||||||
self.ui.removeToolBar(self.ui.geo_edit_toolbar)
|
self.ui.removeToolBar(self.ui.geo_edit_toolbar)
|
||||||
self.ui.removeToolBar(self.ui.snap_toolbar)
|
self.ui.removeToolBar(self.ui.snap_toolbar)
|
||||||
|
self.ui.removeToolBar(self.ui.toolbarshell)
|
||||||
|
|
||||||
if current_layout == 'standard':
|
if current_layout == 'standard':
|
||||||
### TOOLBAR INSTALLATION ###
|
### TOOLBAR INSTALLATION ###
|
||||||
|
@ -3558,6 +3581,10 @@ class App(QtCore.QObject):
|
||||||
self.ui.toolbarview.setObjectName('View_TB')
|
self.ui.toolbarview.setObjectName('View_TB')
|
||||||
self.ui.addToolBar(self.ui.toolbarview)
|
self.ui.addToolBar(self.ui.toolbarview)
|
||||||
|
|
||||||
|
self.ui.toolbarshell = QtWidgets.QToolBar('Shell Toolbar')
|
||||||
|
self.ui.toolbarshell.setObjectName('Shell_TB')
|
||||||
|
self.ui.addToolBar(self.ui.toolbarshell)
|
||||||
|
|
||||||
self.ui.toolbartools = QtWidgets.QToolBar('Tools Toolbar')
|
self.ui.toolbartools = QtWidgets.QToolBar('Tools Toolbar')
|
||||||
self.ui.toolbartools.setObjectName('Tools_TB')
|
self.ui.toolbartools.setObjectName('Tools_TB')
|
||||||
self.ui.addToolBar(self.ui.toolbartools)
|
self.ui.addToolBar(self.ui.toolbartools)
|
||||||
|
@ -3590,16 +3617,24 @@ class App(QtCore.QObject):
|
||||||
self.ui.toolbarview = QtWidgets.QToolBar('View Toolbar')
|
self.ui.toolbarview = QtWidgets.QToolBar('View Toolbar')
|
||||||
self.ui.toolbarview.setObjectName('View_TB')
|
self.ui.toolbarview.setObjectName('View_TB')
|
||||||
self.ui.addToolBar(Qt.LeftToolBarArea, self.ui.toolbarview)
|
self.ui.addToolBar(Qt.LeftToolBarArea, self.ui.toolbarview)
|
||||||
|
|
||||||
|
self.ui.toolbarshell = QtWidgets.QToolBar('Shell Toolbar')
|
||||||
|
self.ui.toolbarshell.setObjectName('Shell_TB')
|
||||||
|
self.ui.addToolBar(Qt.LeftToolBarArea, self.ui.toolbarshell)
|
||||||
|
|
||||||
self.ui.toolbartools = QtWidgets.QToolBar('Tools Toolbar')
|
self.ui.toolbartools = QtWidgets.QToolBar('Tools Toolbar')
|
||||||
self.ui.toolbartools.setObjectName('Tools_TB')
|
self.ui.toolbartools.setObjectName('Tools_TB')
|
||||||
self.ui.addToolBar(Qt.LeftToolBarArea, self.ui.toolbartools)
|
self.ui.addToolBar(Qt.LeftToolBarArea, self.ui.toolbartools)
|
||||||
self.ui.exc_edit_toolbar = QtWidgets.QToolBar('Excellon Editor Toolbar')
|
|
||||||
self.ui.exc_edit_toolbar.setObjectName('ExcEditor_TB')
|
|
||||||
self.ui.addToolBar(Qt.LeftToolBarArea, self.ui.exc_edit_toolbar)
|
|
||||||
self.ui.geo_edit_toolbar = QtWidgets.QToolBar('Geometry Editor Toolbar')
|
self.ui.geo_edit_toolbar = QtWidgets.QToolBar('Geometry Editor Toolbar')
|
||||||
self.ui.geo_edit_toolbar.setVisible(False)
|
# self.ui.geo_edit_toolbar.setVisible(False)
|
||||||
self.ui.geo_edit_toolbar.setObjectName('GeoEditor_TB')
|
self.ui.geo_edit_toolbar.setObjectName('GeoEditor_TB')
|
||||||
self.ui.addToolBar(Qt.RightToolBarArea, self.ui.geo_edit_toolbar)
|
self.ui.addToolBar(Qt.RightToolBarArea, self.ui.geo_edit_toolbar)
|
||||||
|
|
||||||
|
self.ui.exc_edit_toolbar = QtWidgets.QToolBar('Excellon Editor Toolbar')
|
||||||
|
self.ui.exc_edit_toolbar.setObjectName('ExcEditor_TB')
|
||||||
|
self.ui.addToolBar(Qt.RightToolBarArea, self.ui.exc_edit_toolbar)
|
||||||
|
|
||||||
self.ui.snap_toolbar = QtWidgets.QToolBar('Grid Toolbar')
|
self.ui.snap_toolbar = QtWidgets.QToolBar('Grid Toolbar')
|
||||||
self.ui.snap_toolbar.setObjectName('Snap_TB')
|
self.ui.snap_toolbar.setObjectName('Snap_TB')
|
||||||
self.ui.snap_toolbar.setMaximumHeight(30)
|
self.ui.snap_toolbar.setMaximumHeight(30)
|
||||||
|
|
|
@ -466,18 +466,27 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||||
self.toolbarfile = QtWidgets.QToolBar('File Toolbar')
|
self.toolbarfile = QtWidgets.QToolBar('File Toolbar')
|
||||||
self.toolbarfile.setObjectName('File_TB')
|
self.toolbarfile.setObjectName('File_TB')
|
||||||
self.addToolBar(self.toolbarfile)
|
self.addToolBar(self.toolbarfile)
|
||||||
|
|
||||||
self.toolbargeo = QtWidgets.QToolBar('Edit Toolbar')
|
self.toolbargeo = QtWidgets.QToolBar('Edit Toolbar')
|
||||||
self.toolbargeo.setObjectName('Edit_TB')
|
self.toolbargeo.setObjectName('Edit_TB')
|
||||||
self.addToolBar(self.toolbargeo)
|
self.addToolBar(self.toolbargeo)
|
||||||
|
|
||||||
self.toolbarview = QtWidgets.QToolBar('View Toolbar')
|
self.toolbarview = QtWidgets.QToolBar('View Toolbar')
|
||||||
self.toolbarview.setObjectName('View_TB')
|
self.toolbarview.setObjectName('View_TB')
|
||||||
self.addToolBar(self.toolbarview)
|
self.addToolBar(self.toolbarview)
|
||||||
|
|
||||||
|
self.toolbarshell = QtWidgets.QToolBar('Shell Toolbar')
|
||||||
|
self.toolbarshell.setObjectName('Shell_TB')
|
||||||
|
self.addToolBar(self.toolbarshell)
|
||||||
|
|
||||||
self.toolbartools = QtWidgets.QToolBar('Tools Toolbar')
|
self.toolbartools = QtWidgets.QToolBar('Tools Toolbar')
|
||||||
self.toolbartools.setObjectName('Tools_TB')
|
self.toolbartools.setObjectName('Tools_TB')
|
||||||
self.addToolBar(self.toolbartools)
|
self.addToolBar(self.toolbartools)
|
||||||
|
|
||||||
self.exc_edit_toolbar = QtWidgets.QToolBar('Excellon Editor Toolbar')
|
self.exc_edit_toolbar = QtWidgets.QToolBar('Excellon Editor Toolbar')
|
||||||
self.exc_edit_toolbar.setObjectName('ExcEditor_TB')
|
self.exc_edit_toolbar.setObjectName('ExcEditor_TB')
|
||||||
self.addToolBar(self.exc_edit_toolbar)
|
self.addToolBar(self.exc_edit_toolbar)
|
||||||
|
|
||||||
self.geo_edit_toolbar = QtWidgets.QToolBar('Geometry Editor Toolbar')
|
self.geo_edit_toolbar = QtWidgets.QToolBar('Geometry Editor Toolbar')
|
||||||
self.geo_edit_toolbar.setObjectName('GeoEditor_TB')
|
self.geo_edit_toolbar.setObjectName('GeoEditor_TB')
|
||||||
self.addToolBar(self.geo_edit_toolbar)
|
self.addToolBar(self.geo_edit_toolbar)
|
||||||
|
@ -525,8 +534,23 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||||
|
|
||||||
# self.toolbarview.setVisible(False)
|
# self.toolbarview.setVisible(False)
|
||||||
|
|
||||||
|
### Shell Toolbar ###
|
||||||
|
self.shell_btn = self.toolbarshell.addAction(QtGui.QIcon('share/shell32.png'), "&Command Line")
|
||||||
|
|
||||||
### Tools Toolbar ###
|
### Tools Toolbar ###
|
||||||
self.shell_btn = self.toolbartools.addAction(QtGui.QIcon('share/shell32.png'), "&Command Line")
|
self.dblsided_btn = self.toolbartools.addAction(QtGui.QIcon('share/doubleside32.png'), "2Sided Tool")
|
||||||
|
self.cutout_btn = self.toolbartools.addAction(QtGui.QIcon('share/cut16.png'), "&Cutout Tool")
|
||||||
|
self.ncc_btn = self.toolbartools.addAction(QtGui.QIcon('share/flatcam_icon32.png'), "NCC Tool")
|
||||||
|
self.paint_btn = self.toolbartools.addAction(QtGui.QIcon('share/paint20_1.png'), "Paint Tool")
|
||||||
|
self.toolbartools.addSeparator()
|
||||||
|
|
||||||
|
self.panelize_btn = self.toolbartools.addAction(QtGui.QIcon('share/panel16.png'), "Panel Tool")
|
||||||
|
self.film_btn = self.toolbartools.addAction(QtGui.QIcon('share/film16.png'), "Film Tool")
|
||||||
|
self.solder_btn = self.toolbartools.addAction(QtGui.QIcon('share/solderpastebis32.png'), "SolderPaste Tool")
|
||||||
|
self.toolbartools.addSeparator()
|
||||||
|
|
||||||
|
self.calculators_btn = self.toolbartools.addAction(QtGui.QIcon('share/calculator24.png'), "Calculators Tool")
|
||||||
|
self.transform_btn = self.toolbartools.addAction(QtGui.QIcon('share/transform.png'), "Transform Tool")
|
||||||
|
|
||||||
### Drill Editor Toolbar ###
|
### Drill Editor Toolbar ###
|
||||||
self.select_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), "Select")
|
self.select_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), "Select")
|
||||||
|
@ -1554,8 +1578,23 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||||
|
|
||||||
# self.toolbarview.setVisible(False)
|
# self.toolbarview.setVisible(False)
|
||||||
|
|
||||||
|
### Shell Toolbar ###
|
||||||
|
self.shell_btn = self.toolbarshell.addAction(QtGui.QIcon('share/shell32.png'), "&Command Line")
|
||||||
|
|
||||||
### Tools Toolbar ###
|
### Tools Toolbar ###
|
||||||
self.shell_btn = self.toolbartools.addAction(QtGui.QIcon('share/shell32.png'), "&Command Line")
|
self.dblsided_btn = self.toolbartools.addAction(QtGui.QIcon('share/doubleside32.png'), "2Sided Tool")
|
||||||
|
self.cutout_btn = self.toolbartools.addAction(QtGui.QIcon('share/cut16.png'), "&Cutout Tool")
|
||||||
|
self.ncc_btn = self.toolbartools.addAction(QtGui.QIcon('share/flatcam_icon32.png'), "NCC Tool")
|
||||||
|
self.paint_btn = self.toolbartools.addAction(QtGui.QIcon('share/paint20_1.png'), "Paint Tool")
|
||||||
|
self.toolbartools.addSeparator()
|
||||||
|
|
||||||
|
self.panelize_btn = self.toolbartools.addAction(QtGui.QIcon('share/panel16.png'), "Panel Tool")
|
||||||
|
self.film_btn = self.toolbartools.addAction(QtGui.QIcon('share/film16.png'), "Film Tool")
|
||||||
|
self.solder_btn = self.toolbartools.addAction(QtGui.QIcon('share/solderpastebis32.png'), "SolderPaste Tool")
|
||||||
|
self.toolbartools.addSeparator()
|
||||||
|
|
||||||
|
self.calculators_btn = self.toolbartools.addAction(QtGui.QIcon('share/calculator24.png'), "Calculators Tool")
|
||||||
|
self.transform_btn = self.toolbartools.addAction(QtGui.QIcon('share/transform.png'), "Transform Tool")
|
||||||
|
|
||||||
### Drill Editor Toolbar ###
|
### Drill Editor Toolbar ###
|
||||||
self.select_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), "Select")
|
self.select_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), "Select")
|
||||||
|
|
|
@ -20,6 +20,7 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
- reverted a change in GCode that might affect Gerber polarity change in Gerber parser
|
- reverted a change in GCode that might affect Gerber polarity change in Gerber parser
|
||||||
- ability to double click the FlatConfig files and open them in the FlatCAM Code Editor - fixed and verified
|
- ability to double click the FlatConfig files and open them in the FlatCAM Code Editor - fixed and verified
|
||||||
- fixed the Set To Origin function when Escape was clicked
|
- fixed the Set To Origin function when Escape was clicked
|
||||||
|
- added all the Tools in a new ToolBar
|
||||||
|
|
||||||
23.02.2019
|
23.02.2019
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,146 @@
|
||||||
|
import sys
|
||||||
|
from PyQt5 import QtGui, QtWidgets
|
||||||
|
from PyQt5 import QtCore
|
||||||
|
from PyQt5.QtCore import Qt
|
||||||
|
|
||||||
|
class TitleBar(QtWidgets.QDialog):
|
||||||
|
def __init__(self, parent=None):
|
||||||
|
QtWidgets.QWidget.__init__(self, parent)
|
||||||
|
self.setWindowFlags(Qt.FramelessWindowHint);
|
||||||
|
css = """
|
||||||
|
QWidget{
|
||||||
|
Background: #AA00AA;
|
||||||
|
color:white;
|
||||||
|
font:12px bold;
|
||||||
|
font-weight:bold;
|
||||||
|
border-radius: 1px;
|
||||||
|
height: 11px;
|
||||||
|
}
|
||||||
|
QDialog{
|
||||||
|
Background-image:url('img/titlebar bg.png');
|
||||||
|
font-size:12px;
|
||||||
|
color: black;
|
||||||
|
|
||||||
|
}
|
||||||
|
QToolButton{
|
||||||
|
Background:#AA00AA;
|
||||||
|
font-size:11px;
|
||||||
|
}
|
||||||
|
QToolButton:hover{
|
||||||
|
Background: #FF00FF;
|
||||||
|
font-size:11px;
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
self.setAutoFillBackground(True)
|
||||||
|
self.setBackgroundRole(QtGui.QPalette.Highlight)
|
||||||
|
self.setStyleSheet(css)
|
||||||
|
self.minimize=QtWidgets.QToolButton(self)
|
||||||
|
self.minimize.setIcon(QtGui.QIcon('img/min.png'))
|
||||||
|
self.maximize=QtWidgets.QToolButton(self);
|
||||||
|
self.maximize.setIcon(QtGui.QIcon('img/max.png'))
|
||||||
|
close=QtWidgets.QToolButton(self)
|
||||||
|
close.setIcon(QtGui.QIcon('img/close.png'))
|
||||||
|
self.minimize.setMinimumHeight(10)
|
||||||
|
close.setMinimumHeight(10)
|
||||||
|
self.maximize.setMinimumHeight(10)
|
||||||
|
label=QtWidgets.QLabel(self)
|
||||||
|
label.setText("Abracadabra")
|
||||||
|
self.setWindowTitle("Alhambra")
|
||||||
|
hbox=QtWidgets.QHBoxLayout(self)
|
||||||
|
hbox.addWidget(label)
|
||||||
|
hbox.addWidget(self.minimize)
|
||||||
|
hbox.addWidget(self.maximize)
|
||||||
|
hbox.addWidget(close)
|
||||||
|
hbox.insertStretch(1,500)
|
||||||
|
hbox.setSpacing(0)
|
||||||
|
self.setSizePolicy(QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Fixed)
|
||||||
|
self.maxNormal=False
|
||||||
|
close.clicked.connect(self.close)
|
||||||
|
self.minimize.clicked.connect(self.showSmall)
|
||||||
|
self.maximize.clicked.connect(self.showMaxRestore)
|
||||||
|
|
||||||
|
def showSmall(self):
|
||||||
|
box.showMinimized();
|
||||||
|
|
||||||
|
def showMaxRestore(self):
|
||||||
|
if(self.maxNormal):
|
||||||
|
box.showNormal();
|
||||||
|
self.maxNormal= False;
|
||||||
|
self.maximize.setIcon(QtGui.QIcon('img/max.png'));
|
||||||
|
print(1)
|
||||||
|
else:
|
||||||
|
box.showMaximized();
|
||||||
|
self.maxNormal= True;
|
||||||
|
print(2)
|
||||||
|
self.maximize.setIcon(QtGui.QIcon('img/max2.png'));
|
||||||
|
|
||||||
|
def close(self):
|
||||||
|
box.close()
|
||||||
|
|
||||||
|
def mousePressEvent(self,event):
|
||||||
|
if event.button() == Qt.LeftButton:
|
||||||
|
box.moving = True; box.offset = event.pos()
|
||||||
|
|
||||||
|
def mouseMoveEvent(self,event):
|
||||||
|
if box.moving: box.move(event.globalPos()-box.offset)
|
||||||
|
|
||||||
|
|
||||||
|
class Frame(QtWidgets.QFrame):
|
||||||
|
def __init__(self, parent=None):
|
||||||
|
QtWidgets.QFrame.__init__(self, parent)
|
||||||
|
self.m_mouse_down= False;
|
||||||
|
self.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||||
|
css = """
|
||||||
|
QFrame{
|
||||||
|
Background: #D700D7;
|
||||||
|
color:white;
|
||||||
|
font:13px ;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
self.setStyleSheet(css)
|
||||||
|
self.setWindowFlags(Qt.FramelessWindowHint)
|
||||||
|
self.setMouseTracking(True)
|
||||||
|
self.m_titleBar= TitleBar(self)
|
||||||
|
self.m_content= QtWidgets.QWidget(self)
|
||||||
|
vbox=QtWidgets.QVBoxLayout(self)
|
||||||
|
vbox.addWidget(self.m_titleBar)
|
||||||
|
vbox.setContentsMargins(0, 0, 0, 0)
|
||||||
|
vbox.setSpacing(0)
|
||||||
|
layout=QtWidgets.QVBoxLayout(self)
|
||||||
|
layout.addWidget(self.m_content)
|
||||||
|
layout.setContentsMargins(5, 5, 5, 5)
|
||||||
|
layout.setSpacing(0)
|
||||||
|
vbox.addLayout(layout)
|
||||||
|
# Allows you to access the content area of the frame
|
||||||
|
# where widgets and layouts can be added
|
||||||
|
|
||||||
|
def contentWidget(self):
|
||||||
|
return self.m_content
|
||||||
|
|
||||||
|
def titleBar(self):
|
||||||
|
return self.m_titleBar
|
||||||
|
|
||||||
|
def mousePressEvent(self,event):
|
||||||
|
self.m_old_pos = event.pos();
|
||||||
|
self.m_mouse_down = event.button()== Qt.LeftButton;
|
||||||
|
|
||||||
|
def mouseMoveEvent(self,event):
|
||||||
|
x=event.x()
|
||||||
|
y=event.y()
|
||||||
|
|
||||||
|
def mouseReleaseEvent(self,event):
|
||||||
|
m_mouse_down=False;
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app = QtWidgets.QApplication(sys.argv);
|
||||||
|
box = Frame()
|
||||||
|
box.move(60,60)
|
||||||
|
l=QtWidgets.QVBoxLayout(box.contentWidget());
|
||||||
|
l.setContentsMargins(0, 0,0 ,0)
|
||||||
|
edit=QtWidgets.QLabel("""I would've did anything for you to show you how much I adored you
|
||||||
|
But it's over now, it's too late to save our loveJust promise me you'll think of me
|
||||||
|
Every time you look up in the sky and see a star 'cuz I'm your star.""");
|
||||||
|
l.addWidget(edit)
|
||||||
|
box.show()
|
||||||
|
app.exec_()
|
Loading…
Reference in New Issue