Resolved Issue #329. Add button to 'Scroll Up/Scroll Down' in Detail mode
--HG-- branch : feature
This commit is contained in:
parent
148f9cab44
commit
ef1fff7a22
|
@ -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);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -170,6 +172,8 @@ void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &t
|
|||
qDebug()<<"Got wrong tools. Ignore.";
|
||||
return;
|
||||
}
|
||||
ui.toolButtonUp->setEnabled(ui.checkBoxSeams->isChecked() && not ui.checkBoxClosed->isChecked());
|
||||
ui.toolButtonDown->setEnabled(ui.checkBoxSeams->isChecked() && not ui.checkBoxClosed->isChecked());
|
||||
|
||||
bool canAddNewPoint = false;
|
||||
|
||||
|
@ -338,6 +342,9 @@ void DialogDetail::ClickedSeams(bool checked)
|
|||
ui.checkBoxClosed->setEnabled(checked);
|
||||
ui.doubleSpinBoxSeams->setEnabled(checked);
|
||||
|
||||
ui.toolButtonUp->setEnabled(checked && not ui.checkBoxClosed->isChecked());
|
||||
ui.toolButtonDown->setEnabled(checked && not ui.checkBoxClosed->isChecked());
|
||||
|
||||
if (checked && ui.doubleSpinBoxSeams->value() <= 0)
|
||||
{
|
||||
flagWidth = false;
|
||||
|
@ -359,6 +366,8 @@ void DialogDetail::ClickedSeams(bool checked)
|
|||
void DialogDetail::ClickedClosed(bool checked)
|
||||
{
|
||||
closed = checked;
|
||||
ui.toolButtonUp->setEnabled(not checked);
|
||||
ui.toolButtonDown->setEnabled(not checked);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -415,6 +424,26 @@ void DialogDetail::DeleteItem()
|
|||
ValidObjects(DetailIsValid());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::ScrollUp()
|
||||
{
|
||||
if (ui.listWidget->count() > 1)
|
||||
{
|
||||
QListWidgetItem *item = ui.listWidget->takeItem(ui.listWidget->count()-1);
|
||||
ui.listWidget->insertItem(0, item);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::ScrollDown()
|
||||
{
|
||||
if (ui.listWidget->count() > 1)
|
||||
{
|
||||
QListWidgetItem *item = ui.listWidget->takeItem(0);
|
||||
ui.listWidget->addItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool DialogDetail::DetailIsValid() const
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>565</width>
|
||||
<height>382</height>
|
||||
<width>522</width>
|
||||
<height>368</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -313,14 +313,72 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButtonDelete">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_16">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
<property name="topMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButtonDelete">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButtonDown">
|
||||
<property name="toolTip">
|
||||
<string>Scroll down</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="go-down"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButtonUp">
|
||||
<property name="toolTip">
|
||||
<string>Scroll up</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="go-up"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
@ -352,7 +410,6 @@
|
|||
<tabstop>checkBoxSeams</tabstop>
|
||||
<tabstop>doubleSpinBoxSeams</tabstop>
|
||||
<tabstop>checkBoxClosed</tabstop>
|
||||
<tabstop>toolButtonDelete</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
|
|
Loading…
Reference in New Issue
Block a user