QmlDesigner: Fix states context menu not working in certain areas

Fixed 2 issues with the context menu:
- Left clicking the area to the right of the states doesn't close the
context menu. The issues seems to be a bug in the ListView, solved by
limiting the width of the ListView to the states area width.
- Clicking (left or right) below the states area doesn't work. This is
because the height of the states view was fixed to the height needed.
Solved by not restricting the view height and do necessary changes.

Also some cleanups and removing unnecessary stuff.

Fixes: QDS-5324
Change-Id: Ic1e3f5d0776bb4770a3276c93ad1aee7a0049388
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Mahmoud Badri
2021-12-01 18:43:02 +02:00
parent be059ac11a
commit 0a8ab22f41
2 changed files with 28 additions and 70 deletions

View File

@@ -168,12 +168,9 @@ void StatesEditorWidget::reloadQmlSource()
connect(rootObject(), SIGNAL(createNewState()), m_statesEditorView.data(), SLOT(createNewState()));
connect(rootObject(), SIGNAL(deleteState(int)), m_statesEditorView.data(), SLOT(removeState(int)));
m_statesEditorView.data()->synchonizeCurrentStateFromWidget();
setFixedHeight(initialSize().height());
if (!DesignerSettings::getValue(DesignerSettingsKey::STATESEDITOR_EXPANDED).toBool()) {
if (!DesignerSettings::getValue(DesignerSettingsKey::STATESEDITOR_EXPANDED).toBool())
toggleStatesViewExpanded();
setFixedHeight(rootObject()->height());
}
connect(rootObject(), SIGNAL(expandedChanged()), this, SLOT(handleExpandedChanged()));
}
@@ -184,7 +181,5 @@ void StatesEditorWidget::handleExpandedChanged()
bool expanded = rootObject()->property("expanded").toBool();
DesignerSettings::setValue(DesignerSettingsKey::STATESEDITOR_EXPANDED, expanded);
setFixedHeight(rootObject()->height());
}
}