Commit d3b41afc authored by Marco Martin's avatar Marco Martin

redesign widget explorer as suggested by the VDG

parent bab5d7d9
......@@ -31,29 +31,47 @@ Item {
readonly property string pluginName: model.pluginName
width: list.width
height: iconContainer.height + units.largeSpacing
width: list.cellWidth
height: list.cellHeight
RowLayout {
ColumnLayout {
id: mainLayout
spacing: units.smallSpacing
anchors {
fill: parent
margins: units.smallSpacing
left: parent.left
right: parent.right
//bottom: parent.bottom
margins: units.smallSpacing * 2
rightMargin: units.smallSpacing * 2 // don't cram the text to the border too much
verticalCenter: parent.verticalCenter
}
spacing: units.largeSpacing
Item {
id: iconContainer
width: units.iconSizes.huge
width: units.iconSizes.enormous
height: width
anchors.horizontalCenter: parent.horizontalCenter
QIconItem {
Item {
id: iconWidget
anchors.fill: parent
icon: model.decoration
QIconItem {
anchors.fill: parent
icon: model.decoration
visible: model.screenshot == ""
}
Image {
width: units.iconSizes.enormous
height: width
anchors.fill: parent
fillMode: Image.PreserveAspectFit
source: model.screenshot
}
}
Item {
id: badgeMask
anchors.fill: parent
......@@ -82,7 +100,6 @@ Item {
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: theme.backgroundColor
text: running
}
}
......@@ -114,31 +131,27 @@ Item {
"
}
}
ColumnLayout {
PlasmaExtras.Heading {
id: heading
Layout.fillWidth: true
spacing: units.smallSpacing
PlasmaExtras.Heading {
id: heading
Layout.fillWidth: true
level: 4
text: model.name
elide: Text.ElideRight
wrapMode: Text.WordWrap
maximumLineCount: 2
lineHeight: 0.95
}
PlasmaComponents.Label {
Layout.fillWidth: true
// otherwise causes binding loop due to the way the Plasma sets the height
height: implicitHeight
text: model.description
font.pointSize: theme.smallestFont.pointSize
wrapMode: Text.WordWrap
elide: Text.ElideRight
maximumLineCount: heading.lineCount === 1 ? 3 : 2
}
level: 4
text: model.name
elide: Text.ElideRight
wrapMode: Text.WordWrap
maximumLineCount: 2
lineHeight: 0.95
horizontalAlignment: Text.AlignHCenter
}
PlasmaComponents.Label {
Layout.fillWidth: true
// otherwise causes binding loop due to the way the Plasma sets the height
height: implicitHeight
text: model.description
font.pointSize: theme.smallestFont.pointSize
wrapMode: Text.WordWrap
elide: Text.ElideRight
maximumLineCount: heading.lineCount === 1 ? 3 : 2
horizontalAlignment: Text.AlignHCenter
}
}
......@@ -148,7 +161,10 @@ Item {
hoverEnabled: true
onClicked: {
widgetExplorer.addApplet(pluginName);
main.closed();
main.closed()
}
onEntered: list.currentIndex = index
onExited: list.currentIndex = -1
}
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment