fantastico! full decoupled parabolic effect

--This is the first commit that demonstrates also
a beautiful and easy way to gain properties from
multiple applets that support specific activities
pull/15/head
Michail Vourlakos 5 years ago
parent d26b189bfa
commit e3e4ee4c5a

@ -29,5 +29,5 @@ import "./privates" as Ability
Ability.ParabolicEffectPrivate { Ability.ParabolicEffectPrivate {
factor.zoom: LatteCore.WindowSystem.compositingActive && animations.active ? ( 1 + (plasmoid.configuration.zoomLevel / 20) ) : 1 factor.zoom: LatteCore.WindowSystem.compositingActive && animations.active ? ( 1 + (plasmoid.configuration.zoomLevel / 20) ) : 1
factor.maxZoom: Math.max(factor.zoom, appletsRecords.maxInnerZoomFactor) factor.maxZoom: Math.max(factor.zoom, appletsRecords.maxInnerZoomFactor)
restoreZoomIsBlocked: view && view.contextMenuIsShown restoreZoomIsBlocked: (view && view.contextMenuIsShown) || (layouts.ability.parabolic.restoreZoomIsBlocked)
} }

@ -31,6 +31,7 @@ ContainerAbility.ParabolicEffect {
property Item animations: null property Item animations: null
property Item appletsRecords: null property Item appletsRecords: null
property Item layouts: null
property QtObject view: null property QtObject view: null
readonly property bool horizontal: plasmoid.formFactor === PlasmaCore.Types.Horizontal readonly property bool horizontal: plasmoid.formFactor === PlasmaCore.Types.Horizontal
@ -52,11 +53,6 @@ ContainerAbility.ParabolicEffect {
ignoreUnknownSignals : true ignoreUnknownSignals : true
onContainsMouseChanged: { onContainsMouseChanged: {
if (!parabolic.view.visibility.containsMouse && !restoreZoomTimer.running) { if (!parabolic.view.visibility.containsMouse && !restoreZoomTimer.running) {
//! applets context menus is a good example that restoreZoomIsBlocked of host should track down
//! all clients restoreZoomIsBlocked properties ??
//! OR it must be tracked down why in multi-clients environment releasing
//! parabolic effect is not applied when the user rapid moves the mouse
//! between multiple parabolic clients/applets
parabolic.startRestoreZoomTimer() parabolic.startRestoreZoomTimer()
} }
} }

@ -23,7 +23,9 @@ import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.latte.core 0.2 as LatteCore import org.kde.latte.core 0.2 as LatteCore
Grid { import "./abilities" as Abilities
Abilities.AbilityGrid {
id: appletsContainer id: appletsContainer
columns: root.isVertical ? 1 : 0 columns: root.isVertical ? 1 : 0

@ -28,6 +28,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.latte.core 0.2 as LatteCore import org.kde.latte.core 0.2 as LatteCore
import org.kde.latte.private.containment 0.1 as LatteContainment import org.kde.latte.private.containment 0.1 as LatteContainment
import "./abilities" as AbilitiesTypes
import "../../code/HeuristicTools.js" as HeuristicTools import "../../code/HeuristicTools.js" as HeuristicTools
Item{ Item{
@ -43,9 +44,15 @@ Item{
readonly property int fillApplets: _startLayout.fillApplets + _mainLayout.fillApplets + _endLayout.fillApplets readonly property int fillApplets: _startLayout.fillApplets + _mainLayout.fillApplets + _endLayout.fillApplets
property Item startLayout : _startLayout readonly property alias startLayout : _startLayout
property Item mainLayout: _mainLayout readonly property alias mainLayout: _mainLayout
property Item endLayout: _endLayout readonly property alias endLayout: _endLayout
readonly property AbilitiesTypes.AbilityLayouts ability: AbilitiesTypes.AbilityLayouts{
startLayout: _startLayout
mainLayout: _mainLayout
endLayout: _endLayout
}
Binding { Binding {
target: layoutsContainer target: layoutsContainer

@ -0,0 +1,41 @@
/*
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
import org.kde.plasma.core 2.0 as PlasmaCore
AbilityGridPrivate {
id: grid
ability.parabolic.restoreZoomIsBlocked: {
var cnts = 0;
for (var i=0; i<grid.children.length; ++i){
var appletItem = grid.children[i];
if (appletItem
&& appletItem.communicator.parabolicEffectIsSupported
&& appletItem.communicator.bridge.parabolic.client.restoreZoomIsBlocked) {
return true;
}
}
return false;
}
}

@ -0,0 +1,28 @@
/*
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
import org.kde.plasma.core 2.0 as PlasmaCore
import "./types" as AbilityTypes
Grid {
readonly property AbilityTypes.AbilitiesHost ability: AbilityTypes.AbilitiesHost{}
}

@ -0,0 +1,26 @@
/*
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
AbilityLayoutsPrivate {
parabolic.restoreZoomIsBlocked: startLayout.ability.parabolic.restoreZoomIsBlocked
|| mainLayout.ability.parabolic.restoreZoomIsBlocked
|| endLayout.ability.parabolic.restoreZoomIsBlocked
}

@ -0,0 +1,32 @@
/*
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
import org.kde.plasma.core 2.0 as PlasmaCore
import "./types" as AbilityTypes
Item {
property Item startLayout: null
property Item mainLayout: null
property Item endLayout: null
readonly property AbilityTypes.ParabolicEffect parabolic: AbilityTypes.ParabolicEffect{}
}

@ -0,0 +1,24 @@
/*
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
Item {
readonly property ParabolicEffect parabolic: ParabolicEffect{}
}

@ -0,0 +1,25 @@
/*
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
Item {
property bool restoreZoomIsBlocked: false
property int lastIndex: -1
}

@ -1580,6 +1580,7 @@ Item {
id: _parabolic id: _parabolic
animations: _animations animations: _animations
appletsRecords: _appletsRecords appletsRecords: _appletsRecords
layouts: layoutsContainer
view: latteView view: latteView
} }

Loading…
Cancel
Save