Commit d59bd4f2 authored by Marco Martin's avatar Marco Martin
Browse files

default to expanded tiles, config option for behavior

parent 5d5b7e9e
......@@ -35,6 +35,7 @@ AbstractDelegate {
property var iconImage
property string comment
property bool useIconColors: true
property bool compactMode: false
Kirigami.Theme.inherit: !imagePalette.useColors
Kirigami.Theme.textColor: imagePalette.textColor
......@@ -89,7 +90,7 @@ AbstractDelegate {
PlasmaComponents.Label {
id: commentLabel
// keeps commentLabel from affecting the vertical center of label when not selected
visible: text.length > 0 && (toSelectedTransition.running || toNormalTransition.running || delegate.isCurrent)
visible: !delegate.compactMode || (text.length > 0 && (toSelectedTransition.running || toNormalTransition.running || delegate.isCurrent))
Layout.fillWidth: true
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
......@@ -104,10 +105,10 @@ AbstractDelegate {
states: [
State {
name: "selected"
when: delegate.isCurrent
when: delegate.isCurrent || !delegate.compactMode
PropertyChanges {
target: delegate
implicitWidth: listView.cellWidth * 2
implicitWidth: delegate.compactMode ? (listView.cellWidth * 2) : listView.cellWidth
}
PropertyChanges {
target: iconItem
......@@ -131,7 +132,7 @@ AbstractDelegate {
},
State {
name: "normal"
when: !delegate.isCurrent
when: !delegate.isCurrent && delegate.compactMode
PropertyChanges {
target: delegate
implicitWidth: listView.cellWidth
......
......@@ -44,6 +44,7 @@ FocusScope {
property alias cellHeight: view.cellHeight
readonly property real screenRatio: view.Window.window ? view.Window.window.width / view.Window.window.height : 1.6
property bool compactMode: false
property Item navigationUp
property Item navigationDown
......@@ -84,8 +85,8 @@ FocusScope {
topMargin: Kirigami.Units.largeSpacing*2
leftMargin: -Kirigami.Units.largeSpacing
}
readonly property int cellWidth: (Kirigami.Units.iconSizes.huge + Kirigami.Units.largeSpacing*4)
property int cellHeight: cellWidth + units.gridUnit * 3
readonly property int cellWidth: (Kirigami.Units.iconSizes.huge + Kirigami.Units.largeSpacing*4) * (root.compactMode ? 1 : 2)
property int cellHeight: root.compactMode ? cellWidth + units.gridUnit * 3 : cellWidth / 1.6
property int currentIndex: 0
property alias count: repeater.count
property alias model: repeater.model
......
......@@ -27,5 +27,8 @@
<entry name="coloredTiles" type="Bool">
<default>true</default>
</entry>
<entry name="expandingTiles" type="Bool">
<default>false</default>
</entry>
</group>
</kcfg>
......@@ -38,16 +38,26 @@ Window {
fill: parent
margins: Kirigami.Units.largeSpacing
}
Controls.CheckBox {
id: backgroundCheckbox
z: 999
text: i18n("Use Colored Tiles")
checked: plasmoid.configuration.coloredTiles
onCheckedChanged: plasmoid.configuration.coloredTiles = checked
focus: true
Keys.onEnterPressed: checked = !checked
Keys.onReturnPressed: checked = !checked
KeyNavigation.down: closeButton
ColumnLayout {
Controls.CheckBox {
id: backgroundCheckbox
text: i18n("Use Colored Tiles")
checked: plasmoid.configuration.coloredTiles
onCheckedChanged: plasmoid.configuration.coloredTiles = checked
focus: true
Keys.onEnterPressed: checked = !checked
Keys.onReturnPressed: checked = !checked
KeyNavigation.down: expandingCheckbox
}
Controls.CheckBox {
id: expandingCheckbox
text: i18n("Use Expanding Tiles")
checked: plasmoid.configuration.expandingTiles
onCheckedChanged: plasmoid.configuration.expandingTiles = checked
Keys.onEnterPressed: checked = !checked
Keys.onReturnPressed: checked = !checked
KeyNavigation.down: closeButton
}
}
}
Controls.Button {
......
......@@ -63,6 +63,7 @@ FocusScope {
BigScreen.TileRepeater {
id: recentView
title: i18n("Recent Apps")
compactMode: plasmoid.configuration.expandingTiles
model: Kicker.RecentUsageModel {
shownItems: Kicker.RecentUsageModel.OnlyApps
}
......@@ -86,6 +87,7 @@ FocusScope {
BigScreen.TileRepeater {
id: voiceAppsView
title: i18n("Voice Apps")
compactMode: plasmoid.configuration.expandingTiles
model: KItemModels.KSortFilterProxyModel {
sourceModel: plasmoid.nativeInterface.applicationListModel
filterRole: "ApplicationCategoriesRole"
......@@ -109,6 +111,7 @@ FocusScope {
BigScreen.TileRepeater {
id: appsView
title: i18n("Applications")
compactMode: plasmoid.configuration.expandingTiles
model: KItemModels.KSortFilterProxyModel {
sourceModel: plasmoid.nativeInterface.applicationListModel
filterRole: "ApplicationCategoriesRole"
......@@ -133,6 +136,7 @@ FocusScope {
BigScreen.TileRepeater {
id: gamesView
title: i18n("Games")
compactMode: plasmoid.configuration.expandingTiles
model: KItemModels.KSortFilterProxyModel {
sourceModel: plasmoid.nativeInterface.applicationListModel
filterRole: "ApplicationCategoriesRole"
......@@ -156,6 +160,7 @@ FocusScope {
id: settingsView
title: i18n("Settings")
model: actions
compactMode: plasmoid.configuration.expandingTiles
property list<Controls.Action> actions: [
Controls.Action {
......
......@@ -26,6 +26,7 @@ BigScreen.IconDelegate {
icon.name: modelData ? modelData.ApplicationIconRole : ""
text: modelData ? modelData.ApplicationNameRole : ""
useIconColors: plasmoid.configuration.coloredTiles
compactMode: plasmoid.configuration.expandingTiles
onClicked: {
feedbackWindow.open(modelData.ApplicationNameRole, modelData.ApplicationIconRole);
......
......@@ -23,6 +23,7 @@ BigScreen.IconDelegate {
icon.name: model.icon.name
text: model.text
useIconColors: plasmoid.configuration.coloredTiles
compactMode: plasmoid.configuration.expandingTiles
onClicked: {
//feedbackWindow.open(model.text, model.icon.name);
......
......@@ -26,6 +26,7 @@ BigScreen.IconDelegate {
icon.name: modelData && modelData.ApplicationIconRole ? modelData.ApplicationIconRole : ""
text: modelData ? modelData.ApplicationNameRole : ""
useIconColors: plasmoid.configuration.coloredTiles
compactMode: plasmoid.configuration.expandingTiles
onClicked: {
plasmoid.nativeInterface.applicationListModel.runApplication(modelData.ApplicationStorageIdRole)
......
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