different paint for flat toolbuttons in touchscreens
This commit is contained in:
parent
5a00c8ec01
commit
869afade06
@ -24,7 +24,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore
|
|||||||
Item {
|
Item {
|
||||||
id: main
|
id: main
|
||||||
state: parent.state
|
state: parent.state
|
||||||
|
property bool hasOverState: false
|
||||||
|
|
||||||
PlasmaCore.FrameSvgItem {
|
PlasmaCore.FrameSvgItem {
|
||||||
id: shadow
|
id: shadow
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
|
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
|
||||||
* Copyright (C) 2011 by Mark Gaiser <markg85@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
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -24,6 +24,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore
|
|||||||
Item {
|
Item {
|
||||||
id: main
|
id: main
|
||||||
state: parent.state
|
state: parent.state
|
||||||
|
property bool hasOverState: true
|
||||||
|
|
||||||
PlasmaCore.FrameSvgItem {
|
PlasmaCore.FrameSvgItem {
|
||||||
id: hover
|
id: hover
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
|
* 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
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
@ -102,7 +103,8 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
imagePath: "widgets/button"
|
imagePath: "widgets/button"
|
||||||
prefix: (internal.userPressed || checked) ? "pressed" : "normal"
|
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 {
|
Behavior on opacity {
|
||||||
PropertyAnimation { duration: 250 }
|
PropertyAnimation { duration: 250 }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user