try to make the sliding panel fullscreen

This commit is contained in:
Marco Martin 2015-03-18 13:49:28 +01:00
parent 6aafa9329a
commit d0756040ad
2 changed files with 13 additions and 14 deletions

View file

@ -18,7 +18,7 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Window 2.0 import QtQuick.Window 2.2
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
Window { Window {

View file

@ -177,17 +177,17 @@ PlasmaCore.ColorScope {
} }
PlasmaWorkspace.BatteryIcon { PlasmaWorkspace.BatteryIcon {
id: batteryIcon id: batteryIcon
anchors { anchors {
right: parent.right right: parent.right
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
width: height width: height
height: parent.height height: parent.height
hasBattery: pmSource.data["Battery"]["Has Battery"] hasBattery: pmSource.data["Battery"]["Has Battery"]
// batteryType: "Phone" // batteryType: "Phone"
percent: pmSource.data["Battery0"] ? pmSource.data["Battery0"]["Percent"] : 0 percent: pmSource.data["Battery0"] ? pmSource.data["Battery0"]["Percent"] : 0
PlasmaCore.DataSource { PlasmaCore.DataSource {
id: pmSource id: pmSource
@ -218,12 +218,11 @@ PlasmaCore.ColorScope {
anchors.fill: parent anchors.fill: parent
onPressed: { onPressed: {
oldMouseY = mouse.y; oldMouseY = mouse.y;
slidingPanel.visible = true; slidingPanel.visibility = Qt.WindowFullScreen;
} }
onPositionChanged: { onPositionChanged: {
//var factor = (mouse.y - oldMouseY > 0) ? (1 - Math.max(0, (slidingArea.y + slidingPanel.overShoot) / slidingPanel.overShoot)) : 1 //var factor = (mouse.y - oldMouseY > 0) ? (1 - Math.max(0, (slidingArea.y + slidingPanel.overShoot) / slidingPanel.overShoot)) : 1
var factor = 1; var factor = 1;
print(slidingPanel.offset +" "+ slidingPanel.height)
slidingPanel.offset = slidingPanel.offset + (mouse.y - oldMouseY) * factor; slidingPanel.offset = slidingPanel.offset + (mouse.y - oldMouseY) * factor;
oldMouseY = mouse.y; oldMouseY = mouse.y;
} }