Commit bbff2deb authored by Nate Graham's avatar Nate Graham
Browse files

Implement Full Screen feature for non-global-menu users

It was already implemented for global menu users, but incompletely:
there was no visible methods to leave full screen mode, and the way to
enter it wasn't exposed to people without global menus. Now everyone has
it and it's easy to escape from.

BUG: 429730
FIXED-IN: 22.12
parent 9af53fb9
......@@ -6,6 +6,7 @@
*/
import QtQuick 2.7
import QtQuick.Window 2.7
import QtQuick.Controls 2.3
import org.kde.elisa 1.0
import org.kde.kirigami 2.5 as Kirigami
......@@ -51,6 +52,11 @@ Menu {
}
}
Action {
text: mainWindow.visibility == Window.FullScreen ? i18nc("@action:inmenu", "Leave Full Screen") : i18nc("@action:inmenu", "Enter Full Screen")
icon.name: mainWindow.visibility == Window.FullScreen ? "view-restore" : "view-fullscreen"
onTriggered: mainWindow.visibility == Window.FullScreen ? mainWindow.showNormal() : mainWindow.showFullScreen()
}
Action {
text: configureAction.text
shortcut: ElisaApplication.actionShortcut(configureAction)
......
......@@ -116,6 +116,19 @@ FocusScope {
}
}
}
// Not a flat button because we need a background to ensure adequate contrast
// against the HeaderBar's album art background
Button {
anchors.top: parent.top
anchors.right: parent.right
visible: mainWindow.visibility == Window.FullScreen
text: i18nc("@action:button", "Exit Full Screen")
icon.name: "view-restore"
onClicked: mainWindow.showNormal();
}
MediaPlayerControl {
id: playControlItem
......
......@@ -59,8 +59,8 @@ MenuBar {
}
MenuItem {
text: mainWindow.visibility == Window.FullScreen ? i18nc("menu entry", "Leave Fullscreen") : i18nc("menu entry", "Enter Fullscreen")
iconName: "view-fullscreen"
text: mainWindow.visibility == Window.FullScreen ? i18nc("menu entry", "Leave Full Screen") : i18nc("menu entry", "Enter Full Screen")
iconName: mainWindow.visibility == Window.FullScreen ? "view-restore" : "view-fullscreen"
onTriggered: mainWindow.visibility == Window.FullScreen ? mainWindow.showNormal() : mainWindow.showFullScreen()
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment