Commit a89a04bb authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[widgets][dataformateditor] Improved buttons

parent 01bb594b
......@@ -63,20 +63,20 @@ def create_button_layout(button):
def create_add_button_layout():
"""Returns a ready to use layout as well as add actions"""
add_pushbutton = QPushButton("+")
add_pushbutton = QPushButton(QCoreApplication.translate("Dataformat", "Add"))
add_menu = QMenu()
add_type_action = add_menu.addAction(
QCoreApplication.translate("Dataformat", "Add type")
QCoreApplication.translate("Dataformat", "Type")
)
add_object_action = add_menu.addAction(
QCoreApplication.translate("Dataformat", "Add object")
QCoreApplication.translate("Dataformat", "Object")
)
add_type_array_action = add_menu.addAction(
QCoreApplication.translate("Dataformat", "Add type array")
QCoreApplication.translate("Dataformat", "Type array")
)
add_object_array_action = add_menu.addAction(
QCoreApplication.translate("Dataformat", "Add object array")
QCoreApplication.translate("Dataformat", "Object array")
)
add_pushbutton.setMenu(add_menu)
......@@ -117,6 +117,8 @@ class DataformatBaseWidget(QWidget):
self.__has_name = False
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)
......@@ -407,6 +409,7 @@ class DataformatArrayWidget(DataformatBaseWidget):
self.dimension_box = QGroupBox(self.tr("Dimensions"))
self.add_dimension_button = QPushButton(self.tr("+"))
self.add_dimension_button.setFixedSize(30, 30)
add_dimension_layout = create_button_layout(self.add_dimension_button)
self.dimension_layout = QVBoxLayout(self.dimension_box)
......
Supports Markdown
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