Skip to content

Commit f30db11

Browse files
committed
qtplasmac-materials: update materials dialog for consistency
1 parent 43d7c2e commit f30db11

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

src/emc/usr_intf/qtplasmac/qtplasmac-materials.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ def __init__(self, parent=None):
3434
self.setCentralWidget(wid)
3535
self.layout = QHBoxLayout()
3636
wid.setLayout(self.layout)
37-
iconPath = 'share/qtvcp/images/qtplasmac/images/Chips_Plasma.png'
37+
self.iconPath = 'share/qtvcp/images/qtplasmac/images/Chips_Plasma.png'
3838
appPath = os.path.realpath(os.path.dirname(sys.argv[0]))
39-
iconBase = '/usr' if appPath == '/bin' else appPath.replace('/bin', '')
40-
self.setWindowIcon(QIcon(os.path.join(iconBase, iconPath)))
41-
self.setWindowTitle('QtPlasmaC Material File Creator')
39+
self.iconBase = '/usr' if appPath == '/bin' else appPath.replace('/bin', '')
40+
self.setWindowIcon(QIcon(os.path.join(self.iconBase, self.iconPath)))
41+
self.setWindowTitle('QtPlasmaC Material File Creator')
4242
self.create_widgets()
4343
self.inButton.setEnabled(False)
4444
self.inFile.setEnabled(False)
@@ -236,6 +236,7 @@ def on_convert_clicked(self):
236236
if self.inManual.isChecked():
237237
getParams = self.fusion_dialog()
238238
if not getParams:
239+
self.msgLabel.setText('')
239240
return
240241
self.materialNum = '[MATERIAL_NUMBER_{}]'.format(self.fNUM)
241242
self.materialName = 'NAME = {}'.format(self.fNAM)
@@ -343,6 +344,7 @@ def on_convert_clicked(self):
343344
lKW = t['geometry']['CW']
344345
getParams = self.fusion_dialog()
345346
if not getParams:
347+
self.msgLabel.setText('')
346348
return
347349
self.materialNum = '[MATERIAL_NUMBER_{}]'.format(self.fNUM)
348350
self.materialName = 'NAME = {}'.format(self.fNAM)
@@ -410,6 +412,7 @@ def output(self):
410412
def fusion_dialog(self):
411413
dialog = QDialog()
412414
dialog.setWindowTitle('Material Maker')
415+
dialog.setWindowIcon(QIcon(os.path.join(self.iconBase, self.iconPath)))
413416
dialog.setModal(True)
414417
topL = QLabel('Items with a *** are mandatory')
415418
infL = QLabel('For Material # {}\n{}'.format(self.fNUM,self.fNAM))
@@ -483,6 +486,7 @@ def fusion_dialog(self):
483486
dCM = QLineEdit()
484487
dCM.setText(self.fCM)
485488
dCM.setAlignment(Qt.AlignRight)
489+
vSpace1 = QSpacerItem(0, 25)
486490
buttons = QDialogButtonBox.Ok | QDialogButtonBox.Cancel
487491
buttonBox = QDialogButtonBox(buttons)
488492
buttonBox.accepted.connect(dialog.accept)
@@ -522,9 +526,12 @@ def fusion_dialog(self):
522526
layout.addWidget(dGP)
523527
layout.addWidget(dCMl)
524528
layout.addWidget(dCM)
525-
layout.addWidget(buttonBox)
529+
layout.addItem(vSpace1)
530+
layout.addWidget(buttonBox, alignment=Qt.AlignCenter)
526531
dialog.setStyleSheet('* { color: #ffee06; background: #16160e; font: 10pt DejaVuSans } \
527-
QLineEdit { border: 1px solid #ffee06; border-radius: 4 }')
532+
QLineEdit { border: 1px solid #ffee06; border-radius: 4 } \
533+
QPushButton {border: 1px solid #ffee06; border-radius: 4; height: 20; width: 80} \
534+
QPushButton:pressed {color: #16160e; background: #ffee06}')
528535
response = dialog.exec_()
529536
if self.inManual.isChecked():
530537
self.fNUM = dNU.text()

0 commit comments

Comments
 (0)