Merge lp:~verzegnassi-stefano/ubuntu-terminal-app/fix-1488588 into lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot

Proposed by Stefano Verzegnassi
Status: Merged
Approved by: Stefano Verzegnassi
Approved revision: 193
Merged at revision: 194
Proposed branch: lp:~verzegnassi-stefano/ubuntu-terminal-app/fix-1488588
Merge into: lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot
Diff against target: 90 lines (+17/-6)
3 files modified
src/app/qml/TerminalComponent.qml (+4/-0)
src/plugin/qmltermwidget/lib/TerminalDisplay.cpp (+3/-2)
src/plugin/qmltermwidget/lib/TerminalDisplay.h (+10/-4)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-terminal-app/fix-1488588
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Approve
Ubuntu Terminal Developers Pending
Review via email: mp+290031@code.launchpad.net

Commit message

* Expose drag mode settings to QML
* Disabled drag support in ubuntu-terminal-app in order to workaround the missing support in Mir

Description of the change

* Expose drag mode settings to QML
* Disabled drag support in ubuntu-terminal-app in order to workaround the missing support in Mir

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Evan McIntire (mcintire-evan) wrote :

As with the other changes, looks good, but I can't test :( Thanks for the work - hopefully someone can test these and get them in before I get back from vacation

193. By Stefano Verzegnassi

updated DragMode enumerators name

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/TerminalComponent.qml'
2--- src/app/qml/TerminalComponent.qml 2016-02-06 16:31:36 +0000
3+++ src/app/qml/TerminalComponent.qml 2016-03-26 17:07:06 +0000
4@@ -14,6 +14,10 @@
5 font.family: settings.fontStyle
6 font.pixelSize: FontUtils.sizeToPixels("medium") * settings.fontSize / 10
7
8+ // WORKAROUND: Mir/QtMir does not support drag&drop yet, therefore we need
9+ // to disable this functionality (see lp:1488588).
10+ dragMode: QMLTermWidget.NoDrag
11+
12 signal sessionFinished(var session);
13
14 session: QMLTermSession {
15
16=== modified file 'src/plugin/qmltermwidget/lib/TerminalDisplay.cpp'
17--- src/plugin/qmltermwidget/lib/TerminalDisplay.cpp 2016-02-08 21:51:41 +0000
18+++ src/plugin/qmltermwidget/lib/TerminalDisplay.cpp 2016-03-26 17:07:06 +0000
19@@ -329,7 +329,7 @@
20 ,_cursorBlinking(false)
21 ,_hasBlinkingCursor(false)
22 ,_allowBlinkingText(true)
23-,_ctrlDrag(false)
24+,_dragMode(CtrlModifierDrag)
25 ,_tripleClickMode(SelectWholeLine)
26 ,_isFixedSize(false)
27 ,_possibleTripleClick(false)
28@@ -1804,7 +1804,8 @@
29
30 selected = _screenWindow->isSelected(pos.x(),pos.y());
31
32- if ((!_ctrlDrag || ev->modifiers() & Qt::ControlModifier) && selected ) {
33+ if (((_dragMode == DragMode::CtrlModifierDrag && ev->modifiers() & Qt::ControlModifier) ||
34+ _dragMode == DragMode::NoModifierDrag) && selected ) {
35 // The user clicked inside selected text
36 dragInfo.state = diPending;
37 dragInfo.start = ev->pos();
38
39=== modified file 'src/plugin/qmltermwidget/lib/TerminalDisplay.h'
40--- src/plugin/qmltermwidget/lib/TerminalDisplay.h 2016-02-07 07:31:59 +0000
41+++ src/plugin/qmltermwidget/lib/TerminalDisplay.h 2016-03-26 17:07:06 +0000
42@@ -83,6 +83,7 @@
43 class KONSOLEPRIVATE_EXPORT TerminalDisplay : public QQuickPaintedItem
44 {
45 Q_OBJECT
46+ Q_ENUMS(DragMode)
47 Q_PROPERTY(KSession* session READ getSession WRITE setSession NOTIFY sessionChanged )
48 Q_PROPERTY(QFont font READ getVTFont WRITE setVTFont )
49 Q_PROPERTY(QString colorScheme WRITE setColorScheme )
50@@ -95,7 +96,8 @@
51 Q_PROPERTY(int scrollbarMaximum READ getScrollbarMaximum NOTIFY scrollbarParamsChanged )
52 Q_PROPERTY(int scrollbarMinimum READ getScrollbarMinimum NOTIFY scrollbarParamsChanged )
53 Q_PROPERTY(QSize fontMetrics READ getFontMetrics NOTIFY changedFontMetricSignal )
54- Q_PROPERTY(bool enableBold WRITE setBoldIntense)
55+ Q_PROPERTY(bool enableBold WRITE setBoldIntense )
56+ Q_PROPERTY(DragMode dragMode MEMBER _dragMode NOTIFY dragModeChanged )
57
58 public:
59 /** Constructs a new terminal display widget with the specified parent. */
60@@ -194,8 +196,11 @@
61 /** Specifies whether or not text can blink. */
62 void setBlinkingTextEnabled(bool blink);
63
64- void setCtrlDrag(bool enable) { _ctrlDrag=enable; }
65- bool ctrlDrag() { return _ctrlDrag; }
66+ enum DragMode {
67+ NoDrag, // drag disabled
68+ CtrlModifierDrag, // require Ctrl key for drag
69+ NoModifierDrag // no additional key is required
70+ };
71
72 /**
73 * This enum describes the methods for selecting text when
74@@ -614,6 +619,7 @@
75 void imagePainted();
76 void scrollbarValueChanged();
77 void scrollbarParamsChanged(int value);
78+ void dragModeChanged();
79
80 protected:
81 virtual bool event( QEvent * );
82@@ -821,7 +827,7 @@
83 bool _cursorBlinking; // hide cursor in paintEvent
84 bool _hasBlinkingCursor; // has blinking cursor enabled
85 bool _allowBlinkingText; // allow text to blink
86- bool _ctrlDrag; // require Ctrl key for drag
87+ DragMode _dragMode;
88 TripleClickMode _tripleClickMode;
89 bool _isFixedSize; //Columns / lines are locked.
90 QTimer* _blinkTimer; // active when hasBlinker

Subscribers

People subscribed via source and target branches