summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2017-06-23 08:44:00 +0200
committerDavid Schulz <david.schulz@qt.io>2017-06-30 08:30:21 +0000
commit0f7e69034e0b800b559d777085d58f6fb2006036 (patch)
treeb89129ef5f81c977a58c489b8edc5e2e85e7a0f8
parent6591a01452918ce40ca101bb6cfe9770a44d16be (diff)
downloadqt-creator-0f7e69034e0b800b559d777085d58f6fb2006036.tar.gz
Bookmark: make bookmarks draggable
Task-number: QTCREATORBUG-9721 Change-Id: I157e2c4a15ae9d7e4942d3be378ecd01ef493155 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
-rw-r--r--src/plugins/bookmarks/bookmark.cpp11
-rw-r--r--src/plugins/bookmarks/bookmark.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/bookmarks/bookmark.cpp b/src/plugins/bookmarks/bookmark.cpp
index e24f734ee4..dd8f71fb03 100644
--- a/src/plugins/bookmarks/bookmark.cpp
+++ b/src/plugins/bookmarks/bookmark.cpp
@@ -50,6 +50,16 @@ void Bookmark::removedFromEditor()
m_manager->deleteBookmark(this);
}
+bool Bookmark::isDraggable() const
+{
+ return true;
+}
+
+void Bookmark::dragToLine(int lineNumber)
+{
+ move(lineNumber);
+}
+
void Bookmark::updateLineNumber(int line)
{
if (line != lineNumber()) {
@@ -63,6 +73,7 @@ void Bookmark::move(int line)
if (line != lineNumber()) {
TextMark::move(line);
m_manager->updateBookmark(this);
+ updateMarker();
}
}
diff --git a/src/plugins/bookmarks/bookmark.h b/src/plugins/bookmarks/bookmark.h
index 6d818946ff..ad9a1d7f53 100644
--- a/src/plugins/bookmarks/bookmark.h
+++ b/src/plugins/bookmarks/bookmark.h
@@ -43,6 +43,9 @@ public:
void updateFileName(const QString &fileName) override;
void removedFromEditor() override;
+ bool isDraggable() const override;
+ void dragToLine(int lineNumber) override;
+
void setNote(const QString &note);
void updateNote(const QString &note);