TextEditor: Make TextEditorLinkLabel elideable

And use that in the Include and Type Hierarchy
panels to allow resizing the panels smaller.

Fixes: QTCREATORBUG-23197
Change-Id: Ia4b39e610c7a4be4df564dc69573f4748d7634a5
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Andre Hartmann
2019-11-08 21:07:29 +01:00
committed by André Hartmann
parent 22429728f1
commit 1d357f6b33
2 changed files with 4 additions and 3 deletions

View File

@@ -8438,8 +8438,9 @@ void TextEditorWidget::setupGenericHighlighter()
// TextEditorLinkLabel // TextEditorLinkLabel
// //
TextEditorLinkLabel::TextEditorLinkLabel(QWidget *parent) TextEditorLinkLabel::TextEditorLinkLabel(QWidget *parent)
: QLabel(parent) : Utils::ElidingLabel(parent)
{ {
setElideMode(Qt::ElideMiddle);
} }
void TextEditorLinkLabel::setLink(Utils::Link link) void TextEditorLinkLabel::setLink(Utils::Link link)

View File

@@ -35,10 +35,10 @@
#include <coreplugin/editormanager/ieditorfactory.h> #include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/helpitem.h> #include <coreplugin/helpitem.h>
#include <utils/elidinglabel.h>
#include <utils/link.h> #include <utils/link.h>
#include <utils/uncommentselection.h> #include <utils/uncommentselection.h>
#include <QLabel>
#include <QPlainTextEdit> #include <QPlainTextEdit>
#include <QSharedPointer> #include <QSharedPointer>
#include <functional> #include <functional>
@@ -611,7 +611,7 @@ private:
friend class RefactorOverlay; friend class RefactorOverlay;
}; };
class TEXTEDITOR_EXPORT TextEditorLinkLabel : public QLabel class TEXTEDITOR_EXPORT TextEditorLinkLabel : public Utils::ElidingLabel
{ {
public: public:
TextEditorLinkLabel(QWidget *parent = nullptr); TextEditorLinkLabel(QWidget *parent = nullptr);