mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
pressed effect
This commit is contained in:
parent
5efb820769
commit
fc430058bf
3 changed files with 32 additions and 3 deletions
|
|
@ -18,7 +18,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
|
|
@ -39,7 +39,22 @@ PlasmaComponents.Label {
|
|||
property var pressedCallback
|
||||
property var releasedCallback
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
z: -1
|
||||
color: PlasmaCore.ColorScope.highlightColor
|
||||
radius: units.smallSpacing
|
||||
opacity: mouse.pressed ? 0.4 : 0
|
||||
Behavior on opacity {
|
||||
OpacityAnimator {
|
||||
duration: units.longDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouse
|
||||
anchors.fill: parent
|
||||
onPressed: {
|
||||
if (pressedCallback) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
|
|
@ -36,6 +36,20 @@ Item {
|
|||
property alias source: icon.source
|
||||
property alias text: label.text
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
z: -1
|
||||
color: PlasmaCore.ColorScope.highlightColor
|
||||
radius: units.smallSpacing
|
||||
opacity: mouse.pressed ? 0.4 : 0
|
||||
Behavior on opacity {
|
||||
OpacityAnimator {
|
||||
duration: units.longDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
PlasmaCore.IconItem {
|
||||
|
|
@ -54,6 +68,7 @@ Item {
|
|||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouse
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (callback) {
|
||||
|
|
|
|||
|
|
@ -134,7 +134,6 @@ ApplicationWindow {
|
|||
)
|
||||
|
||||
historyModel.remove(index);
|
||||
|
||||
}
|
||||
//END FUNCTIONS
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue