Change the minimize animation

pull/3/head
reionwong 4 years ago
parent d8405ea29f
commit ce3ede07bb

@ -45,7 +45,7 @@ var squashEffect = {
window.minimizeAnimation = animate({ window.minimizeAnimation = animate({
window: window, window: window,
curve: QEasingCurve.InOutQuad, curve: QEasingCurve.OutQuad,
duration: squashEffect.duration, duration: squashEffect.duration,
animations: [ animations: [
{ {
@ -111,7 +111,7 @@ var squashEffect = {
window.unminimizeAnimation = animate({ window.unminimizeAnimation = animate({
window: window, window: window,
curve: QEasingCurve.InOutQuad, curve: QEasingCurve.OutQuad,
duration: squashEffect.duration, duration: squashEffect.duration,
animations: [ animations: [
{ {

@ -11,6 +11,7 @@ import org.kde.kwin 2.0 as KWin
import FishUI 1.0 as FishUI import FishUI 1.0 as FishUI
// https://techbase.kde.org/Development/Tutorials/KWin/WindowSwitcher // https://techbase.kde.org/Development/Tutorials/KWin/WindowSwitcher
KWin.Switcher { KWin.Switcher {
id: tabBox id: tabBox
currentIndex: thumbnailGridView.currentIndex currentIndex: thumbnailGridView.currentIndex
@ -18,8 +19,8 @@ KWin.Switcher {
Window { Window {
id: dialog id: dialog
visible: tabBox.visible visible: tabBox.visible
flags: Qt.BypassWindowManagerHint | Qt.FramelessWindowHint
color: "transparent" color: "transparent"
flags: Qt.X11BypassWindowManagerHint
property int maxWidth: tabBox.screenGeometry.width * 0.9 property int maxWidth: tabBox.screenGeometry.width * 0.9
property int maxHeight: tabBox.screenGeometry.height * 0.7 property int maxHeight: tabBox.screenGeometry.height * 0.7
@ -32,8 +33,8 @@ KWin.Switcher {
width: Math.min(Math.max(thumbnailGridView.cellWidth, optimalWidth), maxWidth) width: Math.min(Math.max(thumbnailGridView.cellWidth, optimalWidth), maxWidth)
height: Math.min(Math.max(thumbnailGridView.cellHeight, optimalHeight), maxHeight) height: Math.min(Math.max(thumbnailGridView.cellHeight, optimalHeight), maxHeight)
x: (tabBox.screenGeometry.width - dialog.width) / 2 x: tabBox.screenGeometry.x + (tabBox.screenGeometry.width - dialog.width) / 2
y: (tabBox.screenGeometry.height - dialog.height) / 2 y: tabBox.screenGeometry.y + (tabBox.screenGeometry.height - dialog.height) / 2
FishUI.WindowBlur { FishUI.WindowBlur {
view: dialog view: dialog
@ -48,24 +49,14 @@ KWin.Switcher {
radius: _background.radius radius: _background.radius
} }
FishUI.RoundedRect { Rectangle {
id: _background id: _background
anchors.fill: parent anchors.fill: parent
radius: _background.height * 0.1 radius: _background.height * 0.1
color: FishUI.Theme.backgroundColor color: FishUI.Theme.backgroundColor
backgroundOpacity: FishUI.Theme.darkMode ? 0.3 : 0.4 opacity: FishUI.Theme.darkMode ? 0.3 : 0.4
} }
// Rectangle {
// id: _background
// anchors.fill: parent
// radius: _background.height * 0.1
// color: FishUI.Theme.backgroundColor
// border.width: 1
// border.color: FishUI.Theme.disabledTextColor
// opacity: 0.5
// }
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
dialogMainItem.calculateColumnCount(); dialogMainItem.calculateColumnCount();
@ -211,9 +202,10 @@ KWin.Switcher {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
anchors.margins: _background.radius / 2 anchors.margins: FishUI.Units.largeSpacing
radius: FishUI.Theme.bigRadius radius: _background.radius
color: FishUI.Theme.highlightColor color: FishUI.Theme.highlightColor
opacity: 0.8
} }
} }

Loading…
Cancel
Save