Port QtGraphicalEffects

This commit is contained in:
Devin Lin 2023-03-02 21:48:24 -08:00
parent 0fd3ffe275
commit f0c756214a
39 changed files with 182 additions and 180 deletions

View file

@ -8,7 +8,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15 as QQC2
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.kirigami 2.12 as Kirigami

View file

@ -8,7 +8,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15 as QQC2
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.kirigami 2.12 as Kirigami

View file

@ -6,7 +6,7 @@ import QtQuick 2.12
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.kirigami 2.13 as Kirigami

View file

@ -8,7 +8,7 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.taskmanager 0.1 as TaskManager
import org.kde.plasma.core 2.0 as PlasmaCore

View file

@ -8,7 +8,7 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.taskmanager 0.1 as TaskManager
import org.kde.plasma.core 2.0 as PlasmaCore

View file

@ -9,7 +9,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.1 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents

View file

@ -10,7 +10,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.core 2.1 as PlasmaCore

View file

@ -10,7 +10,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtra

View file

@ -10,7 +10,7 @@ import QtQuick 2.12
import QtQuick.Controls 2.12 as Controls
import QtQuick.Layouts 1.3
import QtQml.Models 2.12
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents

View file

@ -9,7 +9,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.15
import QtGraphicalEffects 1.15
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents

View file

@ -5,7 +5,7 @@
*/
import QtQuick 2.15
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore

View file

@ -8,7 +8,7 @@
import QtQuick 2.8
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3

View file

@ -5,7 +5,7 @@
*/
import QtQuick 2.15
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.kirigami 2.12 as Kirigami

View file

@ -8,7 +8,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.2
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.kirigami 2.12 as Kirigami

View file

@ -6,7 +6,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3

View file

@ -7,7 +7,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 as Controls
import QtGraphicalEffects 1.6
import Qt5Compat.GraphicalEffects
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore

View file

@ -7,7 +7,7 @@
import QtQuick 2.14
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 as Controls
import QtGraphicalEffects 1.6
import Qt5Compat.GraphicalEffects
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore

View file

@ -7,7 +7,7 @@
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore

View file

@ -7,7 +7,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 as Controls
import QtGraphicalEffects 1.6
import Qt5Compat.GraphicalEffects
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore

View file

@ -8,7 +8,7 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 as Controls
import QtGraphicalEffects 1.6
import Qt5Compat.GraphicalEffects
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore

View file

@ -7,7 +7,7 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 as Controls
import QtGraphicalEffects 1.6
import Qt5Compat.GraphicalEffects
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore

View file

@ -7,7 +7,7 @@
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore

View file

@ -5,7 +5,7 @@
*/
import QtQuick 2.4
import QtGraphicalEffects 1.6
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
PlasmaCore.SvgItem {

View file

@ -4,7 +4,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.15
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore

View file

@ -4,7 +4,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 as Controls
import QtGraphicalEffects 1.6
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents

View file

@ -5,7 +5,7 @@ import QtQuick 2.12
import QtQuick.Controls 2.15 as QQC2
import QtQuick.Layouts 1.1
import QtQml.Models 2.15
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras

View file

@ -5,7 +5,7 @@ import QtQuick 2.12
import QtQuick.Controls 2.15 as QQC2
import QtQuick.Layouts 1.1
import QtQml.Models 2.15
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras

View file

@ -7,7 +7,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.15 as Controls
import QtGraphicalEffects 1.6
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents

View file

@ -13,6 +13,8 @@ import org.kde.plasma.private.mobileshell 1.0 as MobileShell
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
import org.kde.phone.homescreen.halcyon 1.0 as Halcyon
Item {}
/*
MobileShell.HomeScreen {
id: root
@ -104,6 +106,6 @@ MobileShell.HomeScreen {
}
}
}
}
}*/

View file

@ -25,7 +25,7 @@ import org.kde.notificationmanager 1.0 as NotificationManager
Item {
id: root
/*
// only opaque if there are no maximized windows on this screen
readonly property bool showingApp: visibleMaximizedWindowsModel.count > 0
readonly property color backgroundColor: topPanel.colorScopeColor
@ -160,5 +160,5 @@ Item {
return urgencies;
}
}
}
}*/
}

View file

@ -8,7 +8,7 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import QtQuick.Window 2.15
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.taskmanager 0.1 as TaskManager
import org.kde.plasma.plasmoid 2.0
@ -21,144 +21,144 @@ import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
PlasmaCore.ColorScope {
id: root
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
width: 480
height: PlasmaCore.Units.gridUnit * 2
// toggle visibility of navigation bar (show, or use gestures only)
Binding {
target: plasmoid.Window.window // assumed to be plasma-workspace "PanelView" component
property: "visibilityMode"
// 0 - VisibilityMode.NormalPanel
// 3 - VisibilityMode.WindowsGoBelow
value: MobileShell.MobileShellSettings.navigationPanelEnabled ? 0 : 3
}
// we have the following scenarios:
// - system is in landscape orientation & nav panel is enabled (panel on right)
// - system is in landscape orientation & gesture mode is enabled (panel on bottom)
// - system is in portrait orientation (panel on bottom)
readonly property bool inLandscape: Screen.width > Screen.height;
readonly property bool isInLandscapeNavPanelMode: inLandscape && MobileShell.MobileShellSettings.navigationPanelEnabled
readonly property real navigationPanelHeight: PlasmaCore.Units.gridUnit * 2
readonly property real gesturePanelHeight: 8
readonly property real intendedWindowThickness: MobileShell.MobileShellSettings.navigationPanelEnabled ? navigationPanelHeight : gesturePanelHeight
readonly property real intendedWindowLength: isInLandscapeNavPanelMode ? Screen.height : Screen.width
readonly property real intendedWindowOffset: isInLandscapeNavPanelMode ? MobileShellState.TopPanelControls.panelHeight : 0; // offset for top panel
readonly property int intendedWindowLocation: isInLandscapeNavPanelMode ? PlasmaCore.Types.RightEdge : PlasmaCore.Types.BottomEdge
onIntendedWindowThicknessChanged: plasmoid.Window.window.thickness = intendedWindowThickness
onIntendedWindowLengthChanged: maximizeTimer.restart() // ensure it always takes up the full length of the screen
onIntendedWindowOffsetChanged: plasmoid.Window.window.offset = intendedWindowOffset
onIntendedWindowLocationChanged: locationChangeTimer.restart()
// use a timer so we don't have to maximize for every single pixel
// - improves performance if the shell is run in a window, and can be resized
Timer {
id: maximizeTimer
running: false
interval: 100
onTriggered: {
// maximize first, then we can apply offsets (otherwise they are overridden)
plasmoid.Window.window.maximize()
plasmoid.Window.window.offset = intendedWindowOffset;
}
}
// use a timer so that rotation events are faster (offload the panel movement to later, after everything is figured out)
Timer {
id: locationChangeTimer
running: false
interval: 100
onTriggered: plasmoid.Window.window.location = intendedWindowLocation
}
function setWindowProperties() {
// plasmoid.Window.window is assumed to be plasma-workspace "PanelView" component
plasmoid.Window.window.maximize(); // maximize first, then we can apply offsets (otherwise they are overridden)
plasmoid.Window.window.offset = intendedWindowOffset;
plasmoid.Window.window.thickness = intendedWindowThickness;
plasmoid.Window.window.location = intendedWindowLocation;
}
Connections {
target: plasmoid.Window.window
// HACK: There seems to be some component that overrides our initial bindings for the panel,
// which is particularly problematic on first start (since the panel is misplaced)
// - We set an event to override any attempts to override our bindings.
function onLocationChanged() {
if (plasmoid.Window.window.location !== root.intendedWindowLocation) {
root.setWindowProperties();
}
}
function onThicknessChanged() {
if (plasmoid.Window.window.thickness !== root.intendedWindowThickness) {
root.setWindowProperties();
}
}
}
Component.onCompleted: setWindowProperties();
TaskManager.VirtualDesktopInfo {
id: virtualDesktopInfo
}
TaskManager.ActivityInfo {
id: activityInfo
}
PlasmaCore.SortFilterModel {
id: visibleMaximizedWindowsModel
filterRole: 'IsMinimized'
filterRegExp: 'false'
sourceModel: TaskManager.TasksModel {
id: tasksModel
filterByVirtualDesktop: true
filterByActivity: true
filterNotMaximized: true
filterByScreen: true
filterHidden: true
virtualDesktop: virtualDesktopInfo.currentDesktop
activity: activityInfo.currentActivity
groupMode: TaskManager.TasksModel.GroupDisabled
}
}
// only opaque if there are no maximized windows on this screen
readonly property bool opaqueBar: visibleMaximizedWindowsModel.count > 0
// contrasting colour
colorGroup: opaqueBar ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
// bottom navigation panel component
Component {
id: navigationPanel
NavigationPanelComponent {
taskSwitcher: MobileShellState.HomeScreenControls.taskSwitcher
opaqueBar: root.opaqueBar
}
}
// bottom navigation gesture area component
Component {
id: navigationGesture
MobileShell.NavigationGestureArea {
taskSwitcher: MobileShellState.HomeScreenControls.taskSwitcher
}
}
// load appropriate system navigation component
Loader {
id: navigationLoader
anchors.fill: parent
sourceComponent: MobileShell.MobileShellSettings.navigationPanelEnabled ? navigationPanel : navigationGesture
}
// Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
//
// width: 480
// height: PlasmaCore.Units.gridUnit * 2
//
// // toggle visibility of navigation bar (show, or use gestures only)
// Binding {
// target: plasmoid.Window.window // assumed to be plasma-workspace "PanelView" component
// property: "visibilityMode"
// // 0 - VisibilityMode.NormalPanel
// // 3 - VisibilityMode.WindowsGoBelow
// value: MobileShell.MobileShellSettings.navigationPanelEnabled ? 0 : 3
// }
//
// // we have the following scenarios:
// // - system is in landscape orientation & nav panel is enabled (panel on right)
// // - system is in landscape orientation & gesture mode is enabled (panel on bottom)
// // - system is in portrait orientation (panel on bottom)
// readonly property bool inLandscape: Screen.width > Screen.height;
// readonly property bool isInLandscapeNavPanelMode: inLandscape && MobileShell.MobileShellSettings.navigationPanelEnabled
//
// readonly property real navigationPanelHeight: PlasmaCore.Units.gridUnit * 2
// readonly property real gesturePanelHeight: 8
//
// readonly property real intendedWindowThickness: MobileShell.MobileShellSettings.navigationPanelEnabled ? navigationPanelHeight : gesturePanelHeight
// readonly property real intendedWindowLength: isInLandscapeNavPanelMode ? Screen.height : Screen.width
// readonly property real intendedWindowOffset: isInLandscapeNavPanelMode ? MobileShellState.TopPanelControls.panelHeight : 0; // offset for top panel
// readonly property int intendedWindowLocation: isInLandscapeNavPanelMode ? PlasmaCore.Types.RightEdge : PlasmaCore.Types.BottomEdge
//
// onIntendedWindowThicknessChanged: plasmoid.Window.window.thickness = intendedWindowThickness
// onIntendedWindowLengthChanged: maximizeTimer.restart() // ensure it always takes up the full length of the screen
// onIntendedWindowOffsetChanged: plasmoid.Window.window.offset = intendedWindowOffset
// onIntendedWindowLocationChanged: locationChangeTimer.restart()
//
// // use a timer so we don't have to maximize for every single pixel
// // - improves performance if the shell is run in a window, and can be resized
// Timer {
// id: maximizeTimer
// running: false
// interval: 100
// onTriggered: {
// // maximize first, then we can apply offsets (otherwise they are overridden)
// plasmoid.Window.window.maximize()
// plasmoid.Window.window.offset = intendedWindowOffset;
// }
// }
//
// // use a timer so that rotation events are faster (offload the panel movement to later, after everything is figured out)
// Timer {
// id: locationChangeTimer
// running: false
// interval: 100
// onTriggered: plasmoid.Window.window.location = intendedWindowLocation
// }
//
// function setWindowProperties() {
// // plasmoid.Window.window is assumed to be plasma-workspace "PanelView" component
// plasmoid.Window.window.maximize(); // maximize first, then we can apply offsets (otherwise they are overridden)
// plasmoid.Window.window.offset = intendedWindowOffset;
// plasmoid.Window.window.thickness = intendedWindowThickness;
// plasmoid.Window.window.location = intendedWindowLocation;
// }
//
// Connections {
// target: plasmoid.Window.window
//
// // HACK: There seems to be some component that overrides our initial bindings for the panel,
// // which is particularly problematic on first start (since the panel is misplaced)
// // - We set an event to override any attempts to override our bindings.
// function onLocationChanged() {
// if (plasmoid.Window.window.location !== root.intendedWindowLocation) {
// root.setWindowProperties();
// }
// }
//
// function onThicknessChanged() {
// if (plasmoid.Window.window.thickness !== root.intendedWindowThickness) {
// root.setWindowProperties();
// }
// }
// }
//
// Component.onCompleted: setWindowProperties();
//
// TaskManager.VirtualDesktopInfo {
// id: virtualDesktopInfo
// }
//
// TaskManager.ActivityInfo {
// id: activityInfo
// }
//
// PlasmaCore.SortFilterModel {
// id: visibleMaximizedWindowsModel
// filterRole: 'IsMinimized'
// filterRegExp: 'false'
// sourceModel: TaskManager.TasksModel {
// id: tasksModel
// filterByVirtualDesktop: true
// filterByActivity: true
// filterNotMaximized: true
// filterByScreen: true
// filterHidden: true
//
// virtualDesktop: virtualDesktopInfo.currentDesktop
// activity: activityInfo.currentActivity
//
// groupMode: TaskManager.TasksModel.GroupDisabled
// }
// }
//
// // only opaque if there are no maximized windows on this screen
// readonly property bool opaqueBar: visibleMaximizedWindowsModel.count > 0
//
// // contrasting colour
// colorGroup: opaqueBar ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
//
// // bottom navigation panel component
// Component {
// id: navigationPanel
// NavigationPanelComponent {
// taskSwitcher: MobileShellState.HomeScreenControls.taskSwitcher
// opaqueBar: root.opaqueBar
// }
// }
//
// // bottom navigation gesture area component
// Component {
// id: navigationGesture
// MobileShell.NavigationGestureArea {
// taskSwitcher: MobileShellState.HomeScreenControls.taskSwitcher
// }
// }
//
// // load appropriate system navigation component
// Loader {
// id: navigationLoader
// anchors.fill: parent
// sourceComponent: MobileShell.MobileShellSettings.navigationPanelEnabled ? navigationPanel : navigationGesture
// }
}

View file

@ -7,7 +7,7 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PC3

View file

@ -7,7 +7,7 @@
import QtQuick 2.12
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.core 2.0 as PlasmaCore

View file

@ -8,7 +8,7 @@
import QtQuick 2.12
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.notificationmanager 1.1 as Notifications

View file

@ -6,7 +6,7 @@
import QtQuick 2.12
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.notificationmanager 1.1 as Notifications

View file

@ -6,7 +6,7 @@
import QtQuick 2.12
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.workspace.keyboardlayout 1.0

View file

@ -4,7 +4,7 @@
*/
import QtQuick 2.12
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
FastBlur {
id: fastBlur

View file

@ -8,7 +8,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.kirigami 2.18 as Kirigami
import "private" as Private

View file

@ -8,7 +8,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.2
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import org.kde.kirigami 2.18 as Kirigami
AbstractButton {