forked from qt-creator/qt-creator
QmlPreview: Fix enabled state of editor action
Kind of amends 42c1b15874
.
Change-Id: Ifd340d0f9bb206c48fd82cecf4e735cca0d70a7d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -199,7 +199,7 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent)
|
||||
previewFileAction->setVisible(fileNode && fileNode->fileType() == FileType::QML);
|
||||
});
|
||||
connect(Core::EditorManager::instance(), &Core::EditorManager::editorOpened, this,
|
||||
[runPreviewAction] (Core::IEditor *editor) {
|
||||
[] (Core::IEditor *editor) {
|
||||
if (!editor)
|
||||
return;
|
||||
if (!editor->document())
|
||||
@@ -225,8 +225,8 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent)
|
||||
{":/utils/images/run_small.png", Utils::Theme::IconsRunToolBarColor},
|
||||
{":/utils/images/eyeoverlay.png", Utils::Theme::IconsDebugColor}
|
||||
}).icon();
|
||||
Utils::ProxyAction *action =
|
||||
Utils::ProxyAction::proxyActionWithIcon(runPreviewAction, icon);
|
||||
Utils::ProxyAction *action = Utils::ProxyAction::proxyActionWithIcon(
|
||||
Core::ActionManager::command("QmlPreview.RunPreview")->action(), icon);
|
||||
toolBar->insertAction(nullptr, action);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user