diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp
index cbf4d159c..97b2f3b20 100644
--- a/src/libs/vtools/dialogs/tools/dialogdetail.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp
@@ -78,6 +78,8 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge
connect(ui.lineEditNameDetail, &QLineEdit::textChanged, this, &DialogDetail::NamePointChanged);
connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem);
+ connect(ui.toolButtonUp, &QToolButton::clicked, this, &DialogDetail::ScrollUp);
+ connect(ui.toolButtonDown, &QToolButton::clicked, this, &DialogDetail::ScrollDown);
}
//---------------------------------------------------------------------------------------------------------------------
@@ -176,6 +178,8 @@ void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &t
if(ui.listWidget->count() == 0)
{
canAddNewPoint = true;
+ ui.toolButtonUp->setEnabled(false);
+ ui.toolButtonDown->setEnabled(false);
}
else
{
@@ -184,6 +188,8 @@ void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &t
{
canAddNewPoint = true;
}
+ ui.toolButtonUp->setEnabled(true);
+ ui.toolButtonDown->setEnabled(true);
}
if(canAddNewPoint)
@@ -413,6 +419,37 @@ void DialogDetail::DeleteItem()
delete ui.listWidget->item(ui.listWidget->currentRow());
ValidObjects(DetailIsValid());
+
+ if(ui.listWidget->count() < 2)
+ {
+ ui.toolButtonUp->setEnabled(false);
+ ui.toolButtonDown->setEnabled(false);
+ }
+ else
+ {
+ ui.toolButtonUp->setEnabled(true);
+ ui.toolButtonDown->setEnabled(true);
+ }
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void DialogDetail::ScrollUp()
+{
+ if (ui.listWidget->count() > 1)
+ {
+ QListWidgetItem *item = ui.listWidget->takeItem(0);
+ ui.listWidget->addItem(item);
+ }
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void DialogDetail::ScrollDown()
+{
+ if (ui.listWidget->count() > 1)
+ {
+ QListWidgetItem *item = ui.listWidget->takeItem(ui.listWidget->count()-1);
+ ui.listWidget->insertItem(0, item);
+ }
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.h b/src/libs/vtools/dialogs/tools/dialogdetail.h
index dac43f320..9a8ec4314 100644
--- a/src/libs/vtools/dialogs/tools/dialogdetail.h
+++ b/src/libs/vtools/dialogs/tools/dialogdetail.h
@@ -54,6 +54,8 @@ public slots:
void ClickedReverse(bool checked);
void ObjectChanged(int row);
void DeleteItem();
+ void ScrollUp();
+ void ScrollDown();
protected:
/**
* @brief SaveData Put dialog data in local variables
diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.ui b/src/libs/vtools/dialogs/tools/dialogdetail.ui
index 808fcc799..1e5536314 100644
--- a/src/libs/vtools/dialogs/tools/dialogdetail.ui
+++ b/src/libs/vtools/dialogs/tools/dialogdetail.ui
@@ -6,8 +6,8 @@
0
0
- 565
- 382
+ 522
+ 368
@@ -313,14 +313,72 @@
-
-
-
- false
+
+
+ QLayout::SetFixedSize
-
- Delete
+
+ 10
-
+
+ 10
+
+
+ 10
+
+
+ 10
+
+
-
+
+
+ false
+
+
+ Delete
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Scroll down the list
+
+
+ ...
+
+
+
+
+
+
+ -
+
+
+ Scroll up the list
+
+
+ ...
+
+
+
+
+
+
+
@@ -352,7 +410,6 @@
checkBoxSeams
doubleSpinBoxSeams
checkBoxClosed
- toolButtonDelete
buttonBox