different paint for flat toolbuttons in touchscreens

This commit is contained in:
Marco Martin 2011-11-08 20:48:33 +01:00
parent 5a00c8ec01
commit 869afade06
4 changed files with 6 additions and 2 deletions

View File

@ -24,7 +24,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore
Item {
id: main
state: parent.state
property bool hasOverState: false
PlasmaCore.FrameSvgItem {
id: shadow

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
* Copyright (C) 2011 by Mark Gaiser <markg85@gmail.com>
* Copyright (C) 2011 by Marco Martin <mart@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as

View File

@ -24,6 +24,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore
Item {
id: main
state: parent.state
property bool hasOverState: true
PlasmaCore.FrameSvgItem {
id: hover

View File

@ -1,5 +1,6 @@
/*
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
* Copyright (C) 2011 by Marco Martin <mart@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -102,7 +103,8 @@ Item {
anchors.fill: parent
imagePath: "widgets/button"
prefix: (internal.userPressed || checked) ? "pressed" : "normal"
opacity: (internal.userPressed || checked || !flat || mouse.containsMouse) ? 1 : 0
//internal: if there is no hover status, don't paint on mouse over in touchscreens
opacity: (internal.userPressed || checked || !flat || (shadow.hasOverState && mouse.containsMouse)) ? 1 : 0
Behavior on opacity {
PropertyAnimation { duration: 250 }
}