import QtQuick
import QtQuick.Window
import org.kde.kirigami as Kirigami
// The live CI wall in a window of its own, for a second screen: F11 for
// full screen, Esc to leave it, R to flip the order. Created by
// store.openWallWindow(); there's one, and closing it destroys it.
Window {
id: wallWindow
required property var store
transientParent: null
flags: Qt.Window
width: Kirigami.Units.gridUnit * 64
height: Kirigami.Units.gridUnit * 36
minimumWidth: Kirigami.Units.gridUnit * 20
minimumHeight: Kirigami.Units.gridUnit * 12
title: i18n("Live CI")
Kirigami.Theme.colorSet: Kirigami.Theme.Window
Kirigami.Theme.inherit: false
// Translucent: the background goes see-through (and the cards
// partly), the text stays solid — unlike KWin's window opacity,
// which fades everything. T toggles it.
readonly property bool translucent: store.wallTranslucent
color: translucent ? Qt.alpha(Kirigami.Theme.backgroundColor, 0.35) : Kirigami.Theme.backgroundColor
readonly property bool fullScreen: visibility === Window.FullScreen
onClosing: {
store.forgetWallWindow(wallWindow)
wallWindow.destroy()
}
function present() {
if (visibility === Window.Minimized) showNormal()
else show()
raise()
requestActivate()
}
function toggleFullScreen() {
if (fullScreen) showNormal()
else showFullScreen()
}
Shortcut { sequences: [StandardKey.FullScreen]; onActivated: wallWindow.toggleFullScreen() }
Shortcut { sequence: "Escape"; enabled: wallWindow.fullScreen; onActivated: wallWindow.showNormal() }
Shortcut { sequence: "T"; onActivated: wallWindow.store.setWallTranslucent(!wallWindow.store.wallTranslucent) }
Shortcut { sequence: "H"; onActivated: wallWindow.store.setWallTint(!wallWindow.store.wallTint) }
Shortcut { sequence: "R"; onActivated: wallWindow.store.setWallNewestFirst(!wallWindow.store.wallNewestFirst) }
WallView {
anchors.fill: parent
store: wallWindow.store
inWindow: true
translucent: wallWindow.translucent
fullScreen: wallWindow.fullScreen
onToggleFullScreen: wallWindow.toggleFullScreen()
}
}
neiam
/gitgud-plasmoid
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
2.2 KiB · text
History
e49521d