on xenial help sign in
Merge lp:~mzanetti/unity8/disable-hud
edb9da4Michał Sawicz
plugins/Utils/CMakeLists.txt−1
@@ -12,7 +12,6 @@ include_directories(
12
12
13set(QMLPLUGIN_SRC
13set(QMLPLUGIN_SRC
14 albumartprovider.cpp
14 albumartprovider.cpp
15− bottombarvisibilitycommunicatorshell.cpp
16 mediaartcache.cpp
15 mediaartcache.cpp
17 qlimitproxymodelqml.cpp
16 qlimitproxymodelqml.cpp
18 qsortfilterproxymodelqml.cpp
17 qsortfilterproxymodelqml.cpp
plugins/Utils/bottombarvisibilitycommunicatorshell.cppdeleted−49
@@ -1,49 +0,0 @@
1−/*
2− * Copyright (C) 2012 Canonical, Ltd.
3− *
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.
7− *
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.
12− *
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/>.
15− */
16−
17−#include "bottombarvisibilitycommunicatorshell.h"
18−
19−BottomBarVisibilityCommunicatorShell::BottomBarVisibilityCommunicatorShell()
20− : m_forceHidden(false),
21− m_position(0)
22−{
23−}
24−
25−bool BottomBarVisibilityCommunicatorShell::forceHidden() const
26−{
27− return m_forceHidden;
28−}
29−
30−double BottomBarVisibilityCommunicatorShell::position() const
31−{
32− return m_position;
33−}
34−
35−void BottomBarVisibilityCommunicatorShell::setForceHidden(bool forceHidden)
36−{
37− if (forceHidden != m_forceHidden) {
38− m_forceHidden = forceHidden;
39− Q_EMIT forceHiddenChanged(forceHidden);
40− }
41−}
42−
43−void BottomBarVisibilityCommunicatorShell::setPosition(double position)
44−{
45− if (position != m_position) {
46− m_position = position;
47− Q_EMIT positionChanged(position);
48− }
49−}
plugins/Utils/bottombarvisibilitycommunicatorshell.hdeleted−59
@@ -1,59 +0,0 @@
1−/*
2− * Copyright (C) 2012 Canonical, Ltd.
3− *
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.
7− *
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.
12− *
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/>.
15− */
16−
17−#ifndef BOTTOMBARVISIBILITYCOMMUNICATORSHELL_H
18−#define BOTTOMBARVISIBILITYCOMMUNICATORSHELL_H
19−
20−#include <QObject>
21−
22−class QDBusInterface;
23−
24−/** This is an internal class used to talk with the bottom bar used by either
25− * applications or the SDK.
26− * There is a method to force the bottom bar to be hidden or otherwise behave as usual
27− */
28−
29−class BottomBarVisibilityCommunicatorShell : public QObject
30−{
31− Q_OBJECT
32− Q_PROPERTY(bool forceHidden READ forceHidden WRITE setForceHidden NOTIFY forceHiddenChanged)
33− Q_PROPERTY(double position READ position WRITE setPosition NOTIFY positionChanged)
34−
35− Q_CLASSINFO("D-Bus Interface", "com.canonical.Shell.BottomBarVisibilityCommunicator")
36−public:
37− static BottomBarVisibilityCommunicatorShell& instance() {
38− static BottomBarVisibilityCommunicatorShell instance;
39− return instance;
40− }
41−
42− bool forceHidden() const;
43− void setForceHidden(bool forceHidden);
44−
45− double position() const;
46− void setPosition(double position);
47−
48−Q_SIGNALS:
49− void forceHiddenChanged(bool forceHidden);
50− void positionChanged(double position);
51−
52−private:
53− BottomBarVisibilityCommunicatorShell();
54−
55− bool m_forceHidden;
56− double m_position;
57−};
58−
59−#endif
plugins/Utils/plugin.cpp−10
@@ -27,15 +27,11 @@
27
27
28// local
28// local
29#include "albumartprovider.h"
29#include "albumartprovider.h"
30−#include "bottombarvisibilitycommunicatorshell.h"
31#include "qlimitproxymodelqml.h"
30#include "qlimitproxymodelqml.h"
32#include "qsortfilterproxymodelqml.h"
31#include "qsortfilterproxymodelqml.h"
33#include "timeformatter.h"
32#include "timeformatter.h"
34#include "unitymenumodelpaths.h"
33#include "unitymenumodelpaths.h"
35
34
36−static const char* BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_PATH = "/BottomBarVisibilityCommunicator";
37−static const char* DBUS_SERVICE = "com.canonical.Shell.BottomBarVisibilityCommunicator";
38−
39void UtilsPlugin::registerTypes(const char *uri)
35void UtilsPlugin::registerTypes(const char *uri)
40{
36{
41 Q_ASSERT(uri == QLatin1String("Utils"));
37 Q_ASSERT(uri == QLatin1String("Utils"));
@@ -45,7 +41,6 @@ void UtilsPlugin::registerTypes(const char *uri)
45 qmlRegisterType<UnityMenuModelPaths>(uri, 0, 1, "UnityMenuModelPaths");
41 qmlRegisterType<UnityMenuModelPaths>(uri, 0, 1, "UnityMenuModelPaths");
46 qmlRegisterType<TimeFormatter>(uri, 0, 1, "TimeFormatter");
42 qmlRegisterType<TimeFormatter>(uri, 0, 1, "TimeFormatter");
47 qmlRegisterType<GDateTimeFormatter>(uri, 0, 1, "GDateTimeFormatter");
43 qmlRegisterType<GDateTimeFormatter>(uri, 0, 1, "GDateTimeFormatter");
48− qmlRegisterUncreatableType<BottomBarVisibilityCommunicatorShell>(uri, 0, 1, "BottomBarVisibilityCommunicatorShell", "Can't create BottomBarVisibilityCommunicatorShell");
49}
44}
50
45
51void UtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
46void UtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
@@ -64,9 +59,4 @@ void UtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
64 {
59 {
65 qWarning() << "Failed to register image provider for albumart (unknown error)";
60 qWarning() << "Failed to register image provider for albumart (unknown error)";
66 }
61 }
67−
68− QDBusConnection::sessionBus().registerService(DBUS_SERVICE);
69− BottomBarVisibilityCommunicatorShell *bottomBarVisibilityCommunicator = &BottomBarVisibilityCommunicatorShell::instance();
70− QDBusConnection::sessionBus().registerObject(BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_PATH, bottomBarVisibilityCommunicator, QDBusConnection::ExportAllContents);
71− engine->rootContext()->setContextProperty("bottomBarVisibilityCommunicatorShell", bottomBarVisibilityCommunicator);
72}
62}
qml/Shell.qml+3−49
@@ -28,9 +28,7 @@ import "Dash"
28import "Greeter"
28import "Greeter"
29import "Launcher"
29import "Launcher"
30import "Panel"
30import "Panel"
31−import "Hud"
32import "Components"
31import "Components"
33−import "Bottombar"
34import "SideStage"
32import "SideStage"
35import "Notifications"
33import "Notifications"
36import Unity.Notifications 1.0 as NotificationBackend
34import Unity.Notifications 1.0 as NotificationBackend
@@ -381,7 +379,7 @@ FocusScope {
381
379
382 readonly property int backgroundTopMargin: -panel.panelHeight
380 readonly property int backgroundTopMargin: -panel.panelHeight
383
381
384− hides: [launcher, panel.indicators, hud]
382+ hides: [launcher, panel.indicators]
385 shown: false
383 shown: false
386 enabled: true
384 enabled: true
387 showAnimation: StandardAnimation { property: "opacity"; to: 1 }
385 showAnimation: StandardAnimation { property: "opacity"; to: 1 }
@@ -436,7 +434,7 @@ FocusScope {
436 objectName: "greeter"
434 objectName: "greeter"
437
435
438 available: true
436 available: true
439− hides: [launcher, panel.indicators, hud]
437+ hides: [launcher, panel.indicators]
440 shown: true
438 shown: true
441
439
442 defaultBackground: shell.background
440 defaultBackground: shell.background
@@ -523,7 +521,7 @@ FocusScope {
523 InputFilterArea {
521 InputFilterArea {
524 anchors.fill: parent
522 anchors.fill: parent
525 blockInput: !applicationFocused || greeter.shown || lockscreen.shown || launcher.shown
523 blockInput: !applicationFocused || greeter.shown || lockscreen.shown || launcher.shown
526− || panel.indicators.shown || hud.shown
524+ || panel.indicators.shown
527 }
525 }
528
526
529 Connections {
527 Connections {
@@ -585,48 +583,6 @@ FocusScope {
585 }
583 }
586 }
584 }
587
585
588− Hud {
589− id: hud
590−
591− width: parent.width > units.gu(60) ? units.gu(40) : parent.width
592− height: parent.height
593−
594− available: !greeter.shown && !panel.indicators.shown && !lockscreen.shown && edgeDemo.dashEnabled
595− shown: false
596− showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
597− hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
598−
599− Connections {
600− target: shell.applicationManager
601− onMainStageFocusedApplicationChanged: hud.hide()
602− onSideStageFocusedApplicationChanged: hud.hide()
603− }
604− }
605−
606− Revealer {
607− id: hudRevealer
608−
609− enabled: hud.shown
610− width: hud.width
611− anchors.left: hud.left
612− height: parent.height
613− target: hud.revealerTarget
614− closedValue: height
615− openedValue: 0
616− direction: Qt.RightToLeft
617− orientation: Qt.Vertical
618− handleSize: hud.handleHeight
619− onCloseClicked: target.hide()
620− }
621−
622− Bottombar {
623− id: bottombar
624− theHud: hud
625− anchors.fill: parent
626− enabled: hud.available
627− applicationIsOnForeground: applicationFocused
628− }
629−
630 InputFilterArea {
586 InputFilterArea {
631 blockInput: launcher.shown
587 blockInput: launcher.shown
632 anchors {
588 anchors {
@@ -671,8 +627,6 @@ FocusScope {
671 onShownChanged: {
627 onShownChanged: {
672 if (shown) {
628 if (shown) {
673 panel.indicators.hide()
629 panel.indicators.hide()
674− hud.hide()
675− bottombar.hide()
676 }
630 }
677 }
631 }
678 }
632 }
tests/autopilot/unity8/shell/tests/test_hud.py → tests/autopilot/unity8/shell/tests/disabled_test_hud.pyrenamed

The content is the same.