~tiagosh/unity-2d/fix-dash-cursor

« back to all changes in this revision

Viewing changes to launcher/app/launcherview.h

  • Committer: Tarmac
  • Author(s): Albert Astals, Ugo Riboni, Michał Sawicz, Florian Boucault, LDS
  • Date: 2012-02-10 17:32:14 UTC
  • mfrom: (771.3.235 unity-2d-shell_trunk)
  • Revision ID: tarmac-20120210173214-eekg5uiqdb7gjza6
Merge launcher and dash into a common new QML scene: the shell.
 - Created a shell folder that holds both launcher and dash QML code, the C++ code for the single binary and a common folder with shared QML files
 - The shell occupies the whole screen but is shaped for input where it is transparent in order not to interfere with the rest of the windows
 - The shell binary, unity-2d-shell, has a -rootqml option that lets the user specify the QML file to load
 - Implement visibility behaviours in QML instead of C++
 - Do not use D-Bus anymore to communicate between the launcher and the dash
 - Remove the homebutton panel plugin
 - Make the strut setting reusable outside of Unity2dPanel
 - Make LauncherDropItem a FocusScope
 - Implement gesture handling in QML instead of C++

Known issues:
 - In non composited mode there is a 1px wide rectangle on the edge of the screen where the launcher is hidden. This is acceptable for the moment since XFixes barriers to show the launcher are in the plan and will get rid of this problem
 - HomeShortcuts.qml has a transparent Rectangle to fix alignment in RTL mode that causes QML warnings. This is acceptable since the Home lens is going away. Fixes: . Approved by .

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2010 Canonical, Ltd.
3
 
 *
4
 
 * Authors:
5
 
 *  Olivier Tilloy <olivier.tilloy@canonical.com>
6
 
 *
7
 
 * This program is free software; you can redistribute it and/or modify
8
 
 * it under the terms of the GNU General Public License as published by
9
 
 * the Free Software Foundation; version 3.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 
 */
19
 
 
20
 
#ifndef LAUNCHERVIEW
21
 
#define LAUNCHERVIEW
22
 
 
23
 
#include <QDeclarativeView>
24
 
#include <QList>
25
 
#include <QUrl>
26
 
#include <QTimer>
27
 
#include <QVariant>
28
 
 
29
 
#include <unity2ddeclarativeview.h>
30
 
 
31
 
class DeclarativeDragDropEvent;
32
 
class LauncherDBus;
33
 
 
34
 
class LauncherView : public Unity2DDeclarativeView
35
 
{
36
 
    Q_OBJECT
37
 
    Q_PROPERTY(bool superKeyHeld READ superKeyHeld NOTIFY superKeyHeldChanged)
38
 
    Q_PROPERTY(bool focus READ hasFocus NOTIFY focusChanged) // overridden
39
 
 
40
 
public:
41
 
    explicit LauncherView(QWidget* parent = NULL);
42
 
    ~LauncherView();
43
 
 
44
 
    bool superKeyHeld() const { return m_superKeyHeld; }
45
 
 
46
 
Q_SIGNALS:
47
 
    void activateShortcutPressed(int itemIndex);
48
 
    void newInstanceShortcutPressed(int itemIndex);
49
 
    void superKeyHeldChanged(bool superKeyHeld);
50
 
    void superKeyTapped();
51
 
    void addWebFavoriteRequested(const QUrl& url);
52
 
    void focusChanged(bool focus);
53
 
 
54
 
private Q_SLOTS:
55
 
    void setHotkeysForModifiers(Qt::KeyboardModifiers modifiers);
56
 
    void forwardNumericHotkey();
57
 
    void ignoreSuperPress();
58
 
    void updateSuperKeyMonitoring();
59
 
    void updateSuperKeyHoldState();
60
 
    void toggleDash();
61
 
    void showCommandsLens();
62
 
    void onSuperSPressed();
63
 
    void onAltF1Pressed();
64
 
 
65
 
protected:
66
 
    void focusInEvent(QFocusEvent* event);
67
 
    void focusOutEvent(QFocusEvent* event);
68
 
 
69
 
private:
70
 
    bool m_superKeyPressed;
71
 
    bool m_superKeyHeld;
72
 
    bool m_superPressIgnored;
73
 
    QTimer m_superKeyHoldTimer;
74
 
 
75
 
    friend class LauncherDBus;
76
 
};
77
 
 
78
 
#endif // LAUNCHERVIEW
79