Commit 62147e1f authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[widgets][dataformateditor] Move remove button beside name field

This makes the layout more compact
parent f16d7629
......@@ -114,17 +114,18 @@ class DataformatBaseWidget(QGroupBox):
self.delete_button = QPushButton(self.tr("-"))
self.delete_button.setFixedSize(30, 30)
delete_layout = QHBoxLayout()
delete_layout.addStretch(1)
delete_layout.addWidget(self.delete_button)
self.name_lineedit = QLineEdit()
self.name_layout = QHBoxLayout()
self.name_layout.addWidget(self.name_lineedit, 10)
self.name_layout.addStretch(1)
self.name_layout.addWidget(self.delete_button)
self.form_layout = QFormLayout()
self.form_layout.setFieldGrowthPolicy(QFormLayout.AllNonFixedFieldsGrow)
self.form_layout.addRow(self.tr("Name"), self.name_lineedit)
self.form_layout.addRow(self.tr("Name"), self.name_layout)
layout = QVBoxLayout(self)
layout.addLayout(delete_layout)
layout.addLayout(self.form_layout)
self.delete_button.clicked.connect(self.deletionRequested)
......@@ -148,7 +149,7 @@ class DataformatBaseWidget(QGroupBox):
self.__has_name = has_name
self.name_lineedit.setVisible(self.__has_name)
self.form_layout.labelForField(self.name_lineedit).setVisible(self.__has_name)
self.form_layout.labelForField(self.name_layout).setVisible(self.__has_name)
def hasName(self):
"""Returns whether the entry shown by this widget has a name"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment