forked from qt-creator/qt-creator
GLSLEditor: Remove GlslHoverHandler
The BaseHoverHandler does the same job. Change-Id: I2708a87ed5cbc3b320766f52927be4a9670b522b Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -27,7 +27,6 @@
|
|||||||
#include "glsleditorconstants.h"
|
#include "glsleditorconstants.h"
|
||||||
#include "glsleditorplugin.h"
|
#include "glsleditorplugin.h"
|
||||||
#include "glslhighlighter.h"
|
#include "glslhighlighter.h"
|
||||||
#include "glslhoverhandler.h"
|
|
||||||
#include "glslautocompleter.h"
|
#include "glslautocompleter.h"
|
||||||
#include "glslcompletionassist.h"
|
#include "glslcompletionassist.h"
|
||||||
#include "glslindenter.h"
|
#include "glslindenter.h"
|
||||||
@@ -332,8 +331,6 @@ GlslEditorFactory::GlslEditorFactory()
|
|||||||
setEditorActionHandlers(TextEditorActionHandler::Format
|
setEditorActionHandlers(TextEditorActionHandler::Format
|
||||||
| TextEditorActionHandler::UnCommentSelection
|
| TextEditorActionHandler::UnCommentSelection
|
||||||
| TextEditorActionHandler::UnCollapseAll);
|
| TextEditorActionHandler::UnCollapseAll);
|
||||||
|
|
||||||
addHoverHandler(new GlslHoverHandler);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -10,7 +10,6 @@ glsleditorplugin.h \
|
|||||||
glslhighlighter.h \
|
glslhighlighter.h \
|
||||||
glslautocompleter.h \
|
glslautocompleter.h \
|
||||||
glslindenter.h \
|
glslindenter.h \
|
||||||
glslhoverhandler.h \
|
|
||||||
glslcompletionassist.h
|
glslcompletionassist.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
@@ -19,7 +18,6 @@ glsleditorplugin.cpp \
|
|||||||
glslhighlighter.cpp \
|
glslhighlighter.cpp \
|
||||||
glslautocompleter.cpp \
|
glslautocompleter.cpp \
|
||||||
glslindenter.cpp \
|
glslindenter.cpp \
|
||||||
glslhoverhandler.cpp \
|
|
||||||
glslcompletionassist.cpp
|
glslcompletionassist.cpp
|
||||||
|
|
||||||
RESOURCES += glsleditor.qrc
|
RESOURCES += glsleditor.qrc
|
||||||
|
@@ -25,8 +25,6 @@ QtcPlugin {
|
|||||||
"glsleditorplugin.h",
|
"glsleditorplugin.h",
|
||||||
"glslhighlighter.cpp",
|
"glslhighlighter.cpp",
|
||||||
"glslhighlighter.h",
|
"glslhighlighter.h",
|
||||||
"glslhoverhandler.cpp",
|
|
||||||
"glslhoverhandler.h",
|
|
||||||
"glslindenter.cpp",
|
"glslindenter.cpp",
|
||||||
"glslindenter.h",
|
"glslindenter.h",
|
||||||
]
|
]
|
||||||
|
@@ -1,45 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "glslhoverhandler.h"
|
|
||||||
#include "glsleditor.h"
|
|
||||||
|
|
||||||
namespace GlslEditor {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
void GlslHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos)
|
|
||||||
{
|
|
||||||
if (!editorWidget->extraSelectionTooltip(pos).isEmpty())
|
|
||||||
setToolTip(editorWidget->extraSelectionTooltip(pos));
|
|
||||||
}
|
|
||||||
|
|
||||||
void GlslHoverHandler::decorateToolTip()
|
|
||||||
{
|
|
||||||
if (Qt::mightBeRichText(toolTip()))
|
|
||||||
setToolTip(toolTip().toHtmlEscaped());
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace GlslEditor
|
|
@@ -1,44 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <texteditor/basehoverhandler.h>
|
|
||||||
|
|
||||||
namespace GlslEditor {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class GlslHoverHandler : public TextEditor::BaseHoverHandler
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
GlslHoverHandler() {}
|
|
||||||
|
|
||||||
private:
|
|
||||||
void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos) override;
|
|
||||||
void decorateToolTip() override;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace GlslEditor
|
|
Reference in New Issue
Block a user