shift-shell/quicksettings/screenrotation/package/contents/ui/main.qml
Luca Weiss f8aeffa56d quicksettings/screenrotation: hide when not available
On devices where auto-rotate is not (yet) available, make sure not to
show an auto-rotate toggle with no functionality.
2023-02-10 06:28:59 +00:00

18 lines
574 B
QML

// SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: LGPL-2.0-or-later
import QtQuick 2.15
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
import org.kde.plasma.quicksetting.screenrotation 1.0
MobileShell.QuickSetting {
text: i18n("Auto-rotate")
icon: "rotation-allowed"
settingsCommand: "plasma-open-settings kcm_kscreen"
enabled: ScreenRotationUtil.screenRotationEnabled
available: ScreenRotationUtil.available
function toggle() {
ScreenRotationUtil.screenRotationEnabled = !enabled
}
}