Commit 6b52b396 authored by Marco Martin's avatar Marco Martin
Browse files

remove Hack

parent 165aa9b1
/*
* Copyright 2019 Aditya Mehra <aix.m@outlook.com>
* Copyright 2019 Marco Martin <mart@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, 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 General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
*/
import QtQuick 2.9
pragma Singleton
QtObject {
property bool coloredTiles: false
property bool compactTiles: true
}
......@@ -77,7 +77,7 @@ AbstractDelegate {
visible: text.length > 0
Layout.fillWidth: true
wrapMode: Text.WordWrap
horizontalAlignment: delegate.isCurrent || !Hack.compactTiles ? Text.AlignLeft : Text.AlignHCenter
horizontalAlignment: delegate.isCurrent ? Text.AlignLeft : Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
maximumLineCount: 2
elide: Text.ElideRight
......@@ -103,10 +103,10 @@ AbstractDelegate {
states: [
State {
name: "selected"
when: delegate.isCurrent || !Hack.compactTiles
when: delegate.isCurrent
PropertyChanges {
target: delegate
implicitWidth: Hack.compactTiles ? listView.cellWidth * 2 : listView.cellWidth
implicitWidth: listView.cellWidth * 2
}
PropertyChanges {
target: iconItem
......@@ -125,7 +125,7 @@ AbstractDelegate {
},
State {
name: "normal"
when: !delegate.isCurrent || !Hack.compactTiles
when: !delegate.isCurrent
PropertyChanges {
target: delegate
implicitWidth: listView.cellWidth
......
......@@ -84,8 +84,8 @@ FocusScope {
topMargin: Kirigami.Units.largeSpacing*2
leftMargin: -Kirigami.Units.largeSpacing
}
readonly property int cellWidth: (Kirigami.Units.iconSizes.huge + Kirigami.Units.largeSpacing*4) * (BigScreen.Hack.compactTiles ? 1 : 2)
property int cellHeight: (BigScreen.Hack.compactTiles ? cellWidth : cellWidth/2) + units.gridUnit * 3
readonly property int cellWidth: (Kirigami.Units.iconSizes.huge + Kirigami.Units.largeSpacing*4)
property int cellHeight: cellWidth + units.gridUnit * 3
property int currentIndex: 0
property alias count: repeater.count
property alias model: repeater.model
......
......@@ -5,4 +5,3 @@ TileView 1.0 TileView.qml
TileRepeater 1.0 TileRepeater.qml
AbstractDelegate 1.0 AbstractDelegate.qml
IconDelegate 1.0 IconDelegate.qml
singleton Hack 1.0 Hack.qml
......@@ -38,24 +38,6 @@ Item {
Layout.minimumHeight: Screen.desktopAvailableHeight * 0.6
property Item wallpaper
Column {
anchors {
top: topBar.bottom
right: parent.right
}
Controls.CheckBox {
z: 999
text: "Use Colored Tiles"
checked: BigScreen.Hack.coloredTiles
onCheckedChanged: BigScreen.Hack.coloredTiles = checked
}
Controls.CheckBox {
z: 999
text: "Use Compact Tiles"
checked: BigScreen.Hack.compactTiles
onCheckedChanged: BigScreen.Hack.compactTiles = checked
}
}
Containment.onAppletAdded: {
addApplet(applet, x, y);
......
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