mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
move the mobileshell import here, without paged icons
This commit is contained in:
parent
d4879c1ff6
commit
9ae7d849a8
8 changed files with 184 additions and 0 deletions
|
|
@ -54,6 +54,7 @@ add_subdirectory(bin)
|
|||
#add_subdirectory(services)
|
||||
add_subdirectory(applets)
|
||||
add_subdirectory(containments)
|
||||
add_subdirectory(components)
|
||||
add_subdirectory(dialer)
|
||||
add_subdirectory(sounds)
|
||||
add_subdirectory(touchscreentest)
|
||||
|
|
|
|||
14
components/CMakeLists.txt
Normal file
14
components/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
project(mobileshellprivate)
|
||||
|
||||
set(mobileshellprivate_SRCS
|
||||
mobileshellprivateplugin.cpp
|
||||
fullscreenpanel.cpp
|
||||
)
|
||||
|
||||
add_library(plasmamobileshellprivateplugin SHARED ${mobileshellprivate_SRCS})
|
||||
target_link_libraries(plasmamobileshellprivateplugin Qt5::Core Qt5::Qml Qt5::Quick KF5::WindowSystem KF5::WaylandClient)
|
||||
|
||||
install(TARGETS plasmamobileshellprivateplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell)
|
||||
|
||||
|
||||
|
||||
2
components/Messages.sh
Normal file
2
components/Messages.sh
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#! /bin/sh
|
||||
$XGETTEXT *.cpp -o $podir/plasmamobileshellprivateplugin.pot
|
||||
51
components/fullscreenpanel.cpp
Normal file
51
components/fullscreenpanel.cpp
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/***************************************************************************
|
||||
* Copyright 2015 Marco Martin <mart@kde.org> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Library General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
|
||||
***************************************************************************/
|
||||
|
||||
#include "fullscreenpanel.h"
|
||||
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QGuiApplication>
|
||||
|
||||
#include <kwindowsystem.h>
|
||||
|
||||
FullScreenPanel::FullScreenPanel(QQuickWindow *parent)
|
||||
: QQuickWindow(parent)
|
||||
{
|
||||
setFlags(Qt::FramelessWindowHint);
|
||||
setWindowState(Qt::WindowFullScreen);
|
||||
// connect(this, &FullScreenPanel::activeFocusItemChanged, this, [this]() {qWarning()<<"hide()";});
|
||||
connect(this, &QWindow::activeChanged, this, &FullScreenPanel::activeChanged);
|
||||
}
|
||||
|
||||
FullScreenPanel::~FullScreenPanel()
|
||||
{
|
||||
}
|
||||
|
||||
void FullScreenPanel::showEvent(QShowEvent *event)
|
||||
{
|
||||
QQuickWindow::showEvent(event);
|
||||
setWindowState(Qt::WindowFullScreen);
|
||||
KWindowSystem::setState(winId(), NET::SkipTaskbar);
|
||||
}
|
||||
|
||||
|
||||
#include "fullscreenpanel.moc"
|
||||
|
||||
42
components/fullscreenpanel.h
Normal file
42
components/fullscreenpanel.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/***************************************************************************
|
||||
* Copyright 2015 Marco Martin <mart@kde.org> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Library General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
|
||||
***************************************************************************/
|
||||
#ifndef FULLSCREENPANEL_H
|
||||
#define FULLSCREENPANEL_H
|
||||
|
||||
#include <QQuickWindow>
|
||||
|
||||
class FullScreenPanel : public QQuickWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool active READ isActive NOTIFY activeChanged)
|
||||
|
||||
public:
|
||||
FullScreenPanel(QQuickWindow *parent = 0);
|
||||
~FullScreenPanel();
|
||||
|
||||
Q_SIGNALS:
|
||||
void activeChanged();
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *event);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
34
components/mobileshellprivateplugin.cpp
Normal file
34
components/mobileshellprivateplugin.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
Copyright 2015 Marco Martin <mart@kde.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "mobileshellprivateplugin.h"
|
||||
#include "fullscreenpanel.h"
|
||||
|
||||
#include <QtQml>
|
||||
|
||||
|
||||
void PlasmaMobileShellPrivatePlugin::registerTypes(const char *uri)
|
||||
{
|
||||
Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.mobileshell"));
|
||||
|
||||
qmlRegisterType<FullScreenPanel>(uri, 2, 0, "FullScreenPanel");
|
||||
}
|
||||
37
components/mobileshellprivateplugin.h
Normal file
37
components/mobileshellprivateplugin.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Copyright 2015 Marco Martin <mart@kde.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MOBILESHELLPRIVATE_H
|
||||
#define MOBILESHELLPRIVATE_H
|
||||
|
||||
#include <QQmlExtensionPlugin>
|
||||
|
||||
class PlasmaMobileShellPrivatePlugin : public QQmlExtensionPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
|
||||
|
||||
public:
|
||||
void registerTypes(const char *uri);
|
||||
};
|
||||
|
||||
#endif
|
||||
3
components/qmldir
Normal file
3
components/qmldir
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module org.kde.plasma.private.mobileshell
|
||||
plugin plasmamobileshellprivateplugin
|
||||
|
||||
Loading…
Reference in a new issue