~gang65/unity-2d/new-app-menu

« back to all changes in this revision

Viewing changes to shell/app/shelldeclarativeview.cpp

  • Committer: Tarmac
  • Author(s): Gerry Boland
  • Date: 2012-02-13 17:04:30 UTC
  • mfrom: (771.69.16 shell-hud)
  • Revision ID: tarmac-20120213170430-aaerib1gn5e3fvjz
HUD backend work: Add wrapper for Unity-Core HUD, add hudActive property to shell which is exported over DBus, and add improved Alt-key handling in the panel.. Fixes: . Approved by Albert Astals Cid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    : Unity2DDeclarativeView()
56
56
    , m_mode(DesktopMode)
57
57
    , m_expanded(true)
58
 
    , m_active(false)
 
58
    , m_dashActive(false)
 
59
    , m_hudActive(false)
59
60
    , m_superKeyPressed(false)
60
61
    , m_superKeyHeld(false)
61
62
{
132
133
{
133
134
    Unity2DDeclarativeView::focusOutEvent(event);
134
135
    setDashActive(false);
 
136
    setHudActive(false);
135
137
    Q_EMIT focusChanged();
136
138
}
137
139
 
177
179
void
178
180
ShellDeclarativeView::setDashActive(bool value)
179
181
{
180
 
    if (value != m_active) {
181
 
        m_active = value;
182
 
        Q_EMIT dashActiveChanged(m_active);
 
182
    if (value != m_dashActive) {
 
183
        /* If HUD is open, close it */
 
184
        if (value && m_hudActive) {
 
185
            setHudActive(false);
 
186
        }
 
187
 
 
188
        m_dashActive = value;
 
189
        Q_EMIT dashActiveChanged(m_dashActive);
183
190
    }
184
191
}
185
192
 
186
193
bool
187
194
ShellDeclarativeView::dashActive() const
188
195
{
189
 
    return m_active;
 
196
    return m_dashActive;
190
197
}
191
198
 
192
199
bool
279
286
    }
280
287
}
281
288
 
 
289
void
 
290
ShellDeclarativeView::setHudActive(bool value)
 
291
{
 
292
    if (value != m_hudActive) {
 
293
        /* If Dash is open, close it */
 
294
        if (value && m_dashActive) {
 
295
            setDashActive(false);
 
296
        }
 
297
 
 
298
        m_hudActive = value;
 
299
        Q_EMIT hudActiveChanged(m_hudActive);
 
300
    }
 
301
}
 
302
 
 
303
bool
 
304
ShellDeclarativeView::hudActive() const
 
305
{
 
306
    return m_hudActive;
 
307
}
 
308
 
282
309
/* ----------------- super key handling ---------------- */
283
310
 
284
311
void