Remove ListItemView supports

- ListItemView, ListItem were removed because could be easily built using ScrollBar
- ListHighlight was renamed into Highlight

Signed-off-by: Daker Fernandes Pinheiro <dakerfp@gmail.com>
This commit is contained in:
Daker Fernandes Pinheiro 2011-07-08 18:49:40 -03:00
parent 30889de6e7
commit 363e341f66
5 changed files with 7 additions and 153 deletions

View File

@ -20,13 +20,13 @@ import QtQuick 1.1
import org.kde.plasma.core 0.1 as PlasmaCore import org.kde.plasma.core 0.1 as PlasmaCore
Item { Item {
id: listHighlight id: highlight
property bool hover: false property bool hover: false
property bool pressed: false property bool pressed: false
PlasmaCore.FrameSvgItem { PlasmaCore.FrameSvgItem {
id : background id: background
imagePath: "widgets/viewitem" imagePath: "widgets/viewitem"
prefix: { prefix: {
if (pressed) if (pressed)

View File

@ -1,47 +0,0 @@
/*
* Copyright 2010 Marco Martin <notmart@gmail.com>
* Copyright 2011 Daker Fernandes Pinheiro <dakerfp@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 1.1
import org.kde.plasma.core 0.1 as PlasmaCore
Item {
id: listItem
// Plasma API
property Item view: null
property alias hoverEnabled: mouse.hoverEnabled
property alias hover: mouse.containsMouse
property alias pressed: mouse.pressed
signal selected(int index)
implicitWidth: view.width
implicitHeight: childrenRect.height + 4
MouseArea {
id: mouse
anchors.fill: parent
hoverEnabled: false
onEntered: { view.currentIndex = index; }
onClicked: {
view.currentIndex = index;
listItem.selected(index);
}
}
}

View File

@ -1,54 +0,0 @@
/*
* Copyright 2011 Daker Fernandes Pinheiro <dakerfp@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 1.1
ListView {
id: list
// Plasma API
property alias scrollVisible: scrollBar.visible
// Convinience API
property bool __isVertical: orientation == Qt.Vertical
orientation: Qt.Vertical
highlightFollowsCurrentItem: true
highlight: ListHighlight {
width: ListView.view.width
height: ListView.view.currentItem.height
pressed: ListView.view.currentItem.pressed
hover: ListView.view.currentItem.hover
}
ScrollBar {
id: scrollBar
anchors {
top: __isVertical ? parent.top : undefined
left: __isVertical ? undefined : parent.left
right: parent.right
bottom: parent.bottom
}
animated: true
stepSize: highlightItem.height
orientation: parent.orientation
flickableItem: parent
}
}

View File

@ -5,9 +5,7 @@ DualStateButton 0.1 DualStateButton.qml
FlashingLabel 0.1 FlashingLabel.qml FlashingLabel 0.1 FlashingLabel.qml
Frame 0.1 Frame.qml Frame 0.1 Frame.qml
IconWidget 0.1 IconWidget.qml IconWidget 0.1 IconWidget.qml
ListHighlight 0.1 ListHighlight.qml Highlight 0.1 Highlight.qml
ListItem 0.1 ListItem.qml
ListItemView 0.1 ListItemView.qml
PushButton 0.1 PushButton.qml PushButton 0.1 PushButton.qml
RadioButton 0.1 RadioButton.qml RadioButton 0.1 RadioButton.qml
ScrollBar 0.1 ScrollBar.qml ScrollBar 0.1 ScrollBar.qml

View File

@ -230,11 +230,12 @@ Rectangle {
width: 200 width: 200
height: 200 height: 200
clip: true clip: true
model: 100 model: 20
delegate: Text { delegate: Text {
width: 200 width: 200
height: 18 height: 30
text: index text: index
font.pixelSize: 18
} }
Rectangle { Rectangle {
@ -244,6 +245,7 @@ Rectangle {
} }
PlasmaComponents.ScrollBar { PlasmaComponents.ScrollBar {
id: scrollBar
orientation: Qt.Vertical orientation: Qt.Vertical
flickableItem: scrollList flickableItem: scrollList
animated: true animated: true
@ -257,51 +259,6 @@ Rectangle {
} }
} }
} }
Column {
id: listColumn
spacing: 20
Text {
font.pixelSize: 20
text: "ListItemView"
}
PlasmaComponents.ListItemView {
id: listItemView
property bool hoverEnabled: hoverCheck.checked
width: 200
height: 200
clip: true
model: 15
scrollVisible: false
delegate: PlasmaComponents.ListItem {
view: listItemView
height: 30
hoverEnabled: view.hoverEnabled
Text {
id: label
anchors.fill: parent
anchors.margins: 4
text: index
font.pixelSize: 14
}
onSelected: {
listItemView.currentIndex = index;
}
}
Component.onCompleted: currentIndex = 3;
}
PlasmaComponents.CheckBox {
id: hoverCheck
text: "Hover Enabled"
checked: true
}
}
} }
} }