shift-shell/containments/taskpanel/taskpanel.h
Devin Lin 3d9ddbde15 navigationpanel: Add manual screen rotation button
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.
2024-11-09 17:24:23 +00:00

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};
};