forked from qt-creator/qt-creator
QmlDesigner: Fix showing Component Library module context menu
The context menu for modules and categories was not working properly during search. The menu is now disabled whenever the search is ongoing, as it's unnecessary to show it at that time. Fixes: QDS-4230 Change-Id: If0465f973188d199982e87e765fbfe1efb641bb7 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -225,7 +225,8 @@ ScrollView {
|
||||
importToRemove = importRemovable ? importUrl : ""
|
||||
currentImport = model
|
||||
currentCategory = null
|
||||
moduleContextMenu.popup()
|
||||
if (!rootView.isSearchActive())
|
||||
moduleContextMenu.popup()
|
||||
}
|
||||
|
||||
Column {
|
||||
@@ -251,7 +252,8 @@ ScrollView {
|
||||
onShowContextMenu: {
|
||||
currentCategory = model
|
||||
currentImport = parent.currentImportModel
|
||||
moduleContextMenu.popup()
|
||||
if (!rootView.isSearchActive())
|
||||
moduleContextMenu.popup()
|
||||
}
|
||||
|
||||
Grid {
|
||||
|
@@ -301,6 +301,11 @@ void ItemLibraryWidget::handleAddImport(int index)
|
||||
updateSearch();
|
||||
}
|
||||
|
||||
bool ItemLibraryWidget::isSearchActive() const
|
||||
{
|
||||
return !m_filterText.isEmpty();
|
||||
}
|
||||
|
||||
void ItemLibraryWidget::delayedUpdateModel()
|
||||
{
|
||||
static bool disableTimer = DesignerSettings::getValue(DesignerSettingsKey::DISABLE_ITEM_LIBRARY_UPDATE_TIMER).toBool();
|
||||
|
@@ -96,6 +96,7 @@ public:
|
||||
Q_INVOKABLE void handleAddAsset();
|
||||
Q_INVOKABLE void handleSearchfilterChanged(const QString &filterText);
|
||||
Q_INVOKABLE void handleAddImport(int index);
|
||||
Q_INVOKABLE bool isSearchActive() const;
|
||||
|
||||
signals:
|
||||
void itemActivated(const QString& itemName);
|
||||
|
Reference in New Issue
Block a user