• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

PlasmaComponents

  • sources
  • kde-4.14
  • kde-runtime
  • plasma
  • declarativeimports
  • plasmacomponents
  • qml
Highlight.qml
Go to the documentation of this file.
1  /*
2  * Copyright 2011 Daker Fernandes Pinheiro <dakerfp@gmail.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Library General Public License as
6  * published by the Free Software Foundation; either version 2, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 import QtQuick 1.0
21 import org.kde.plasma.core 0.1 as PlasmaCore
22 
33 Item {
34  id: highlight
35 
37  //in the case we are the highlight of a listview, it follows the mouse, so hover = true
38  property bool hover: ListView ? true : false
39 
41  property bool pressed: false
42  width: ListView.view ? ListView.view.width : undefined
43 
44  property alias marginHints: background.margins;
45 
46  Connections {
47  target: highlight.ListView.view
48  onCurrentIndexChanged: {
49  if (highlight.ListView.view.currentIndex >= 0) {
50  background.opacity = 1
51  } else {
52  background.opacity = 0
53  }
54  }
55  }
56 
57  Behavior on opacity {
58  NumberAnimation {
59  duration: 250
60  easing.type: Easing.OutQuad
61  }
62  }
63 
64  PlasmaCore.FrameSvgItem {
65  id: background
66  imagePath: "widgets/viewitem"
67  prefix: {
68  if (pressed)
69  return hover ? "selected+hover" : "selected";
70 
71  if (hover)
72  return "hover";
73 
74  return "normal";
75  }
76 
77  Behavior on opacity {
78  NumberAnimation {
79  duration: 250
80  easing.type: Easing.OutQuad
81  }
82  }
83 
84  anchors {
85  fill: parent
86  //FIXME: breaks listviews and highlight item
87  // topMargin: -background.margins.top
88  // leftMargin: -background.margins.left
89  // bottomMargin: -background.margins.bottom
90  // rightMargin: -background.margins.right
91  }
92  }
93 }
Item
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

PlasmaComponents

Skip menu "PlasmaComponents"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal