Skip to content

Commit

Permalink
remove usage of qt5compact grphical effects
Browse files Browse the repository at this point in the history
  • Loading branch information
Camilo Higuita committed Oct 22, 2024
1 parent 9299144 commit 056da8a
Show file tree
Hide file tree
Showing 18 changed files with 200 additions and 219 deletions.
6 changes: 1 addition & 5 deletions caskcore/plugin/src/controls/Dashboard.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import QtQuick.Controls
import org.mauikit.controls as Maui
import org.maui.cask as Cask

import Qt5Compat.GraphicalEffects

Item
{
id: control
Expand Down Expand Up @@ -53,11 +51,11 @@ Item
}
}


Item
{
id: _superOverlay
anchors.fill: parent

Item
{
id: _underneathContent
Expand Down Expand Up @@ -111,6 +109,4 @@ Item
{
console.log("DESTROY DASHBOARD")
}


}
11 changes: 5 additions & 6 deletions caskcore/plugin/src/controls/templates/PanelCard.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import QtQuick
import Qt5Compat.GraphicalEffects
import QtQuick.Effects
import QtQml.Models
import QtQuick.Layouts
import QtQuick.Controls
Expand Down Expand Up @@ -81,12 +81,11 @@ Pane
}

layer.enabled: true
layer.effect: DropShadow
layer.effect: MultiEffect
{
horizontalOffset: 0
verticalOffset: 0
samples: 10
color: Qt.rgba(0,0,0,0.5)
autoPaddingEnabled: true
shadowEnabled: true
shadowColor: "#000000"
}
}

Expand Down
24 changes: 9 additions & 15 deletions caskcore/plugin/src/controls/templates/PanelPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import QtQml
import QtQuick.Window
import QtQuick.Layouts
import QtQuick.Controls

import Qt5Compat.GraphicalEffects
import QtQuick.Effects

import org.mauikit.controls as Maui
import org.maui.cask as Cask
Expand Down Expand Up @@ -69,20 +68,15 @@ Container
active: Maui.Style.enableEffects && control.displayOverlay
anchors.fill: parent

sourceComponent: Item
sourceComponent: MultiEffect
{
FastBlur
{
anchors.fill: parent
radius: 64
source: _cask.superOverlay

layer.enabled: true
layer.effect: Desaturate
{
desaturation: -1.2
}
}
// opacity: 0.2
blurEnabled: true
blurMax: 64
saturation: -0.5
blur: Math.min(0.7, (control.height/(availableGeometry.height* 0.7)))
autoPaddingEnabled: true
source: _cask.superOverlay
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/qml/CaskScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import QtQuick.Layouts

import QtQuick.Window

import Qt5Compat.GraphicalEffects

import QtWayland.Compositor

import org.mauikit.controls as Maui
Expand Down
1 change: 0 additions & 1 deletion src/qml/chrome/Border.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import QtQuick
import QtQuick.Controls

Expand Down
96 changes: 45 additions & 51 deletions src/qml/chrome/Chrome.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
****************************************************************************/

import QtQuick
import QtQml

import QtQuick.Controls
import QtQuick.Layouts
import QtQml
import QtQuick.Effects

import QtWayland.Compositor
import QtWayland.Compositor.XdgShell

import Qt5Compat.GraphicalEffects

import org.mauikit.controls as Maui
import org.maui.cask as Cask
import Zpaces as ZP
Expand Down Expand Up @@ -56,7 +56,6 @@ Cask.StackableItem
property bool resizing : toplevel.resizing
readonly property bool fullscreen : toplevel.fullscreen


property alias moveItem: surfaceItem.moveItem

readonly property bool decorationVisible: win.formFactor === Cask.MauiMan.Desktop && toplevel.decorationMode === XdgToplevel.ServerSideDecoration
Expand All @@ -72,20 +71,6 @@ Cask.StackableItem
x: surfaceItem.moveItem.x
y: surfaceItem.moveItem.y

// Binding on x
// {
// when: rootChrome.moveItem
// value: surfaceItem.moveItem.x - surfaceItem.output.geometry.x
// restoreMode: Binding.RestoreBinding
// }

// Binding on y
// {
// when: rootChrome.moveItem
// value: surfaceItem.moveItem.y - surfaceItem.output.geometry.y
// restoreMode: Binding.RestoreBinding
// }

height: surfaceItem.height + titlebarHeight
width: surfaceItem.width

Expand All @@ -108,7 +93,6 @@ Cask.StackableItem
}
]


Decoration
{
id: _decoration
Expand Down Expand Up @@ -137,7 +121,7 @@ Cask.StackableItem

y: titlebarHeight

// sizeFollowsSurface: false
// sizeFollowsSurface: false
opacity: moving || pinch4.activeScale <= 0.5 ? 0.5 : 1.0

inputEventsEnabled: !rootChrome.overviewMode
Expand Down Expand Up @@ -191,56 +175,66 @@ Cask.StackableItem
valid = !surface.cursorSurface && surface.size.width > 0 && surface.size.height > 0
}

layer.enabled: rootChrome.decorationVisible
layer.effect: OpacityMask
{
maskSource: Maui.ShadowedRectangle
{
width: Math.floor(rootChrome.width)
height: Math.floor(rootChrome.height)

corners
{
topLeftRadius: 0
topRightRadius: 0
bottomLeftRadius: _decoration.radius
bottomRightRadius: _decoration.radius
}
}
}
// layer.enabled: rootChrome.decorationVisible
// layer.effect: MultiEffect
// {
// maskEnabled: true
// maskThresholdMin: 0.5
// maskSpreadAtMin: 1.0
// maskSpreadAtMax: 0.0
// maskThresholdMax: 1.0
// maskSource: ShaderEffectSource
// {
// sourceItem: Maui.ShadowedRectangle
// {
// width: Math.floor(rootChrome.width)
// height: Math.floor(rootChrome.height)

// corners
// {
// topLeftRadius: 0
// topRightRadius: 0
// bottomLeftRadius: _decoration.radius
// bottomRightRadius: _decoration.radius
// }
// }
// }
// }
}

Rectangle
Loader
{
id: _shield
radius: _decoration.radius
visible: Cask.Server.screenshot.blacklisted.indexOf(rootChrome.appId) >= 0 && _screenshotArea.running
color: Maui.Theme.backgroundColor
id: _shieldLoader
anchors.fill: parent
z: surfaceItem.z +1

Maui.Holder
sourceComponent: Rectangle
{
anchors.fill: parent
emoji: "dialog-warning-symbolic"
visible: true
title: i18n("Protected")
body: i18n("This app has requested to not be shown in screenshots.")
}
radius: _decoration.radius
visible: Cask.Server.screenshot.blacklisted.indexOf(rootChrome.appId) >= 0 && _screenshotArea.running
color: Maui.Theme.backgroundColor

Maui.Holder
{
anchors.fill: parent
emoji: "dialog-warning-symbolic"
visible: true
title: i18n("Protected")
body: i18n("This app has requested to not be shown in screenshots.")
}
}
}

Loader
{
asynchronous: true
anchors.fill: parent
active: win.formFactor === Cask.MauiMan.Desktop ? (rootChrome.decorationVisible && !window.maximized && !rootChrome.fullscreen) : (rootChrome.height < availableGeometry.height || rootChrome.width < availableGeometry.width || pinch4.active)
z: surfaceItem.z +9999999999
z: surfaceItem.z + 9999999999

sourceComponent: Border {}
}


Connections
{
target: rootChrome.parent
Expand Down
13 changes: 5 additions & 8 deletions src/qml/chrome/Decoration.qml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Effects

import QtWayland.Compositor
import Qt5Compat.GraphicalEffects

import org.mauikit.controls as Maui
import org.maui.cask as Cask
Expand Down Expand Up @@ -214,14 +214,11 @@ Rectangle
}

layer.enabled: control.showDropShadow
layer.effect: DropShadow
layer.effect: MultiEffect
{
transparentBorder: true
horizontalOffset: 0
verticalOffset: 0
radius: 12
samples: 17
color: "#000000"
autoPaddingEnabled: true
shadowEnabled: true
shadowColor: "#000000"
}
}

47 changes: 26 additions & 21 deletions src/qml/shell/AppsOverview.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import QtQuick.Controls
import QtQuick.Window
import QtQuick.Layouts

import Qt5Compat.GraphicalEffects
import QtQuick.Effects

import QtWayland.Compositor

Expand All @@ -24,13 +24,16 @@ Maui.Page
property alias contentX : _flickable.contentX
headBar.visible: false

background: FastBlur
background: MultiEffect
{
id: fastBlur
source: _cask
radius: 64
transparentBorder: false
cached: true
// opacity: 0.2
blurEnabled: true
blurMax: 64
saturation: -0.5
blur: 1.0
autoPaddingEnabled: true
source: _cask.superOverlay


Rectangle
{
Expand Down Expand Up @@ -190,17 +193,22 @@ Maui.Page
anchors.fill: parent

layer.enabled: true
layer.effect: OpacityMask
layer.effect: MultiEffect
{
maskSource: Item
maskEnabled: true
maskThresholdMin: 0.5
maskSpreadAtMin: 1.0
maskSpreadAtMax: 0.0
maskThresholdMax: 1.0
maskSource: ShaderEffectSource
{
width: _thumbnail.width
height: _thumbnail.height

Rectangle
sourceItem: Rectangle
{
anchors.fill: parent
width: _thumbnail.width
height: _thumbnail.height

radius: Maui.Style.radiusV

}
}
}
Expand All @@ -227,14 +235,11 @@ Maui.Page
}

layer.enabled:true
layer.effect: DropShadow
layer.effect: MultiEffect
{
transparentBorder: true
horizontalOffset: 0
verticalOffset: 0
radius: 8.0
samples: 17
color: Qt.rgba(0,0,0,0.5)
autoPaddingEnabled: true
shadowEnabled: true
shadowColor: "#000000"
}
}
}
Expand Down
Loading

0 comments on commit 056da8a

Please sign in to comment.