2 * Copyright (C) 2014-2015 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17#include "GenericApp.h"
26GenericApp::GenericApp(const QString& name,
27 GenericApp::Type type,
28 GenericApp::State state,
29 const QUrl& screenshot,
30 const QString &qmlFilePath,
32 : MirSurfaceItem(name, type, state, screenshot, qmlFilePath, parent)
33 , m_touchPressCount(0)
34 , m_touchReleaseCount(0)
35 , m_requestedInputMethod(false)
37 connect(this, &QQuickItem::activeFocusChanged,
38 this, &GenericApp::onActiveFocusChanged);
41GenericApp::~GenericApp()
45void GenericApp::onActiveFocusChanged()
47 if (hasActiveFocus()) {
48 if (m_requestedInputMethod) {
49 Q_EMIT inputMethodRequested();
52 Q_EMIT inputMethodDismissed();
56void GenericApp::touchEvent(QTouchEvent * event)
58 if (event->touchPointStates() & Qt::TouchPointPressed) {
60 Q_EMIT touchPressCountChanged(m_touchPressCount);
62 if (hasActiveFocus()) {
63 if (m_requestedInputMethod) {
64 Q_EMIT inputMethodDismissed();
66 Q_EMIT inputMethodRequested();
68 m_requestedInputMethod = !m_requestedInputMethod;
71 } else if (event->touchPointStates() & Qt::TouchPointReleased) {
72 ++m_touchReleaseCount;
73 Q_EMIT touchReleaseCountChanged(m_touchReleaseCount);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list