mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
This change allows scaling of the statusbar (the top panel). As we have to accommodate for a wide variety of devices with different physical pixel sizes, we need a way to scale the top panel / status bar. This change introduces a config value (in plasmamobilerc, such as other shell settings) that controls this size. For example (plasmamobilerc): [General] statusBarScaleFactor=1.5 (Config UI in kcm mobileshell in separate patch) Signed-off-by: Sebastian Kügler <sebas@kde.org>
25 lines
1.3 KiB
QML
25 lines
1.3 KiB
QML
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
import QtQuick
|
|
|
|
import org.kde.kirigami 2.20 as Kirigami
|
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
|
|
|
// NOTE: This is a singleton in the mobileshell library, so we need to be careful to
|
|
// make this load as fast as possible (since it may be loaded in other processes ex. lockscreen).
|
|
|
|
pragma Singleton
|
|
|
|
QtObject {
|
|
readonly property real topPanelHeight: Math.round(Kirigami.Units.gridUnit * ShellSettings.Settings.statusBarScaleFactor / 2) * 2 + Kirigami.Units.smallSpacing
|
|
readonly property real navigationPanelThickness: ShellSettings.Settings.navigationPanelEnabled ? Kirigami.Units.gridUnit * 2 : 0
|
|
|
|
function navigationPanelOnSide(screenWidth: real, screenHeight: real): bool {
|
|
// TODO: we have this disabled for now, we might consider just removing this feature entirely due to it causing several issues:
|
|
// (the feature being the navigation panel being moved to the right when the screen height is small)
|
|
// => the keyboard dimensions are incorrect
|
|
// => shell seems to crash randomly (attempted hotfixes with just delay timers, but not great and also doesn't work now)
|
|
return false; // screenWidth > screenHeight && screenHeight < 500;
|
|
}
|
|
}
|