Commit 50564061 authored by Jan Blackquill's avatar Jan Blackquill 🌈 Committed by Jan Blackquill
Browse files

Port from context properties to singletons

parent 221fc775
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
Item { Item {
property int val property int val
...@@ -33,7 +34,7 @@ Item { ...@@ -33,7 +34,7 @@ Item {
x: 0 x: 0
y: main.dotSize y: main.dotSize
width: main.dotSize width: main.dotSize
height: units.smallSpacing height: PlasmaCore.Units.smallSpacing
color: main.gridColor color: main.gridColor
} }
...@@ -42,8 +43,8 @@ Item { ...@@ -42,8 +43,8 @@ Item {
visible: main.showGrid visible: main.showGrid
x: main.dotSize x: main.dotSize
y: 0 y: 0
width: units.smallSpacing width: PlasmaCore.Units.smallSpacing
height: main.dotSize+units.smallSpacing height: main.dotSize+PlasmaCore.Units.smallSpacing
color: main.gridColor color: main.gridColor
} }
} }
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
Item { Item {
property int val property int val
...@@ -23,19 +24,19 @@ Item { ...@@ -23,19 +24,19 @@ Item {
} }
Dot { Dot {
x: 0 x: 0
y: (dotSize+units.smallSpacing) y: (dotSize+PlasmaCore.Units.smallSpacing)
val: parent.val val: parent.val
bit: 4 bit: 4
} }
Dot { Dot {
x: 0 x: 0
y: 2*(dotSize+units.smallSpacing) y: 2*(dotSize+PlasmaCore.Units.smallSpacing)
val: parent.val val: parent.val
bit: 2 bit: 2
} }
Dot { Dot {
x: 0 x: 0
y: 3*(dotSize+units.smallSpacing) y: 3*(dotSize+PlasmaCore.Units.smallSpacing)
val: parent.val val: parent.val
bit: 1 bit: 1
} }
......
...@@ -39,7 +39,7 @@ ColumnLayout { ...@@ -39,7 +39,7 @@ ColumnLayout {
background: Rectangle { background: Rectangle {
id: highlight id: highlight
implicitWidth: root.width - units.largeSpacing implicitWidth: root.width - Kirigami.Units.largeSpacing
visible: model.id == root.cfg_dictionary visible: model.id == root.cfg_dictionary
color: Kirigami.Theme.highlightColor color: Kirigami.Theme.highlightColor
} }
......
...@@ -103,7 +103,7 @@ Kirigami.FormLayout { ...@@ -103,7 +103,7 @@ Kirigami.FormLayout {
id: comboBox id: comboBox
Kirigami.FormData.label: i18nc("@label:listbox", "Image fill mode:") Kirigami.FormData.label: i18nc("@label:listbox", "Image fill mode:")
// Layout.minimumWidth: units.gridUnit * 10 // Layout.minimumWidth: Kirigami.Units.gridUnit * 10
currentIndex: fillModeToIndex(fillMode) currentIndex: fillModeToIndex(fillMode)
textRole: "text" textRole: "text"
model: [ model: [
......
...@@ -8,6 +8,7 @@ import QtQuick 2.9 ...@@ -8,6 +8,7 @@ import QtQuick 2.9
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
ColumnLayout { ColumnLayout {
...@@ -18,7 +19,7 @@ ColumnLayout { ...@@ -18,7 +19,7 @@ ColumnLayout {
GridLayout { GridLayout {
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
rowSpacing: units.smallSpacing rowSpacing: PlasmaCore.Units.smallSpacing
Repeater { Repeater {
id: labelRepeater id: labelRepeater
......
...@@ -9,12 +9,13 @@ import QtQuick 2.9 ...@@ -9,12 +9,13 @@ import QtQuick 2.9
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
ColumnLayout { ColumnLayout {
id: fullRoot id: fullRoot
Layout.margins: units.smallSpacing Layout.margins: PlasmaCore.Units.smallSpacing
property alias generalModel: topPanel.generalModel property alias generalModel: topPanel.generalModel
property alias observationModel: topPanel.observationModel property alias observationModel: topPanel.observationModel
......
...@@ -9,6 +9,7 @@ import QtQuick 2.9 ...@@ -9,6 +9,7 @@ import QtQuick 2.9
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.extras 2.0 as PlasmaExtras
ColumnLayout { ColumnLayout {
...@@ -17,7 +18,7 @@ ColumnLayout { ...@@ -17,7 +18,7 @@ ColumnLayout {
property alias model: categoryRepeater.model property alias model: categoryRepeater.model
readonly property bool hasContent: model && model.length > 0 && (model[0].length > 0 || model[1].length > 0) readonly property bool hasContent: model && model.length > 0 && (model[0].length > 0 || model[1].length > 0)
spacing: units.largeSpacing spacing: PlasmaCore.Units.largeSpacing
Repeater { Repeater {
id: categoryRepeater id: categoryRepeater
......
...@@ -11,6 +11,7 @@ import QtWebEngine 1.5 ...@@ -11,6 +11,7 @@ import QtWebEngine 1.5
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import org.kde.plasma.components 2.0 as PlasmaComponents // for Menu+MenuItem import org.kde.plasma.components 2.0 as PlasmaComponents // for Menu+MenuItem
import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.extras 2.0 as PlasmaExtras
ColumnLayout { ColumnLayout {
...@@ -85,8 +86,8 @@ ColumnLayout { ...@@ -85,8 +86,8 @@ ColumnLayout {
Layout.fillHeight: true Layout.fillHeight: true
// TODO use contentsSize but that crashes, now mostly for some sane initial size // TODO use contentsSize but that crashes, now mostly for some sane initial size
Layout.preferredWidth: units.gridUnit * 36 Layout.preferredWidth: PlasmaCore.Units.gridUnit * 36
Layout.preferredHeight: units.gridUnit * 18 Layout.preferredHeight: PlasmaCore.Units.gridUnit * 18
// Binding it to e.g. width will be super slow on resizing // Binding it to e.g. width will be super slow on resizing
Timer { Timer {
......
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