mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
When the device is rotated and autorotate is off, a button will appear on the navigation panel to manually rotate. This is specific to the navigation panel, perhaps we can have a floating button in gesture-only mode similar to Android? TODO: PoC, I haven't yet actually tested this on device. I also need to make sure that I check for whether autorotation is enabled on the output.
39 lines
900 B
C++
39 lines
900 B
C++
/*
|
|
* SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <Plasma/Containment>
|
|
#include <QOrientationSensor>
|
|
|
|
#include <kscreen/config.h>
|
|
|
|
class TaskPanel : public Plasma::Containment
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(bool showRotationButton READ showRotationButton NOTIFY showRotationButtonChanged)
|
|
|
|
public:
|
|
TaskPanel(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
|
|
|
|
Q_INVOKABLE void triggerTaskSwitcher() const;
|
|
|
|
bool showRotationButton() const;
|
|
Q_INVOKABLE void rotateToSuggestedRotation();
|
|
|
|
Q_SIGNALS:
|
|
void showRotationButtonChanged();
|
|
|
|
private Q_SLOTS:
|
|
void updateShowRotationButton();
|
|
|
|
private:
|
|
bool m_showRotationButton{false};
|
|
KScreen::Output::Rotation m_rotateTo;
|
|
|
|
KScreen::ConfigPtr m_config{nullptr};
|
|
QOrientationSensor *m_sensor{nullptr};
|
|
};
|