mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
OP-984 Fixed false dirty indication. Added some constant.
This commit is contained in:
parent
b14c8bd4d2
commit
38a709a0da
@ -59,7 +59,7 @@ MyTabbedStackWidget::MyTabbedStackWidget(QWidget *parent, bool isVertical, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_iconAbove && m_vertical) {
|
if (m_iconAbove && m_vertical) {
|
||||||
m_listWidget->setFixedWidth(80); // this should be computed instead
|
m_listWidget->setFixedWidth(LIST_VIEW_WIDTH); // this should be computed instead
|
||||||
m_listWidget->setWrapping(false);
|
m_listWidget->setWrapping(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ void MyTabbedStackWidget::showWidget(int index)
|
|||||||
void MyTabbedStackWidget::resizeEvent(QResizeEvent *event)
|
void MyTabbedStackWidget::resizeEvent(QResizeEvent *event)
|
||||||
{
|
{
|
||||||
QWidget::resizeEvent(event);
|
QWidget::resizeEvent(event);
|
||||||
m_listWidget->setFixedWidth(m_listWidget->verticalScrollBar()->isVisible() ? 100 : 80);
|
m_listWidget->setFixedWidth(m_listWidget->verticalScrollBar()->isVisible() ? LIST_VIEW_WIDTH + 20 : LIST_VIEW_WIDTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyTabbedStackWidget::insertCornerWidget(int index, QWidget *widget)
|
void MyTabbedStackWidget::insertCornerWidget(int index, QWidget *widget)
|
||||||
|
@ -76,6 +76,7 @@ private:
|
|||||||
QStackedWidget *m_stackWidget;
|
QStackedWidget *m_stackWidget;
|
||||||
bool m_vertical;
|
bool m_vertical;
|
||||||
bool m_iconAbove;
|
bool m_iconAbove;
|
||||||
|
static const int LIST_VIEW_WIDTH = 80;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resizeEvent(QResizeEvent * event);
|
void resizeEvent(QResizeEvent * event);
|
||||||
|
@ -173,18 +173,19 @@ void ConfigTaskWidget::setWidgetBindingObjectEnabled(QString objectName, bool en
|
|||||||
|
|
||||||
Q_ASSERT(object);
|
Q_ASSERT(object);
|
||||||
|
|
||||||
|
bool dirtyBack = isDirty();
|
||||||
|
|
||||||
foreach(WidgetBinding * binding, m_widgetBindingsPerObject.values(object)) {
|
foreach(WidgetBinding * binding, m_widgetBindingsPerObject.values(object)) {
|
||||||
binding->setIsEnabled(enabled);
|
binding->setIsEnabled(enabled);
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
// disconnectWidgetUpdatesToSlot(binding->widget(), SLOT(widgetsContentsChanged()));
|
|
||||||
if (binding->value().isValid() && !binding->value().isNull()) {
|
if (binding->value().isValid() && !binding->value().isNull()) {
|
||||||
setWidgetFromVariant(binding->widget(), binding->value(), binding->scale());
|
setWidgetFromVariant(binding->widget(), binding->value(), binding->scale());
|
||||||
} else {
|
} else {
|
||||||
setWidgetFromField(binding->widget(), binding->field(), binding->index(), binding->scale(), binding->isLimited());
|
setWidgetFromField(binding->widget(), binding->field(), binding->index(), binding->scale(), binding->isLimited());
|
||||||
}
|
}
|
||||||
// connectWidgetUpdatesToSlot(binding->widget(), SLOT(widgetsContentsChanged()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setDirty(dirtyBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigTaskWidget::~ConfigTaskWidget()
|
ConfigTaskWidget::~ConfigTaskWidget()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user