Skip to content
Snippets Groups Projects
Commit 9845979c authored by dxtwjb's avatar dxtwjb
Browse files

Use Layouts 1.2 rather than 1.3

See github issue 3.
Also tidied up some whitespace.
parent 1de389a8
No related branches found
No related tags found
No related merge requests found
......@@ -17,20 +17,20 @@
import QtQuick 2.1
import QtQuick.Controls 1.2 as QtControls
import QtQuick.Layouts 1.3 as QtLayouts
import QtQuick.Layouts 1.2 as QtLayouts
Item {
id: generalPage
property alias cfg_hemisphere: hemisphere.currentIndex // 0=North 1=South
property alias cfg_showBackground: showBackground.checked // boolean
property alias cfg_dateFormat: dateFormat.currentIndex // code: 0= 1= 2=...
property alias cfg_dateFormat: dateFormat.currentIndex // code: 0= 1= 2=...
property alias cfg_dateFormatString: dateFormatString.text
QtLayouts.GridLayout {
columns: 2
rowSpacing: 15
QtControls.Label {
text: i18n("Hemisphere")
}
......@@ -42,7 +42,7 @@ Item {
ListElement { key : "Southern"; value: 1 }
}
}
QtControls.Label {
text: i18n("Date Format")
}
......@@ -57,7 +57,7 @@ Item {
ListElement { key: "Custom"; value: 4 }
}
}
QtControls.Label {
text: i18n("Date Format String")
visible: dateFormat.currentIndex == 4
......
......@@ -22,7 +22,7 @@
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.plasmoid 2.0
import QtQuick.Layouts 1.3 as QtLayouts
import QtQuick.Layouts 1.2 as QtLayouts
import QtQuick.Controls 1.2 as QtControls
import org.kde.plasma.components 2.0 as PlasmaComponents
......@@ -38,15 +38,15 @@ Item {
property int preferredWidth
property int preferredHeight
property var currentPhase
property bool showBackground: Plasmoid.configuration.showBackground
property int hemisphere: Plasmoid.configuration.hemisphere
property int dateFormat: Plasmoid.configuration.dateFormat
property string dateFormatString: Plasmoid.configuration.dateFormatString
Plasmoid.backgroundHints: showBackground ? "DefaultBackground" : "NoBackground"
Plasmoid.preferredRepresentation: Plasmoid.compactRepresentation
Plasmoid.toolTipItem: Item {
width: 160
height: 50
......@@ -65,22 +65,21 @@ Item {
}
}
}
Plasmoid.compactRepresentation: Item {
id: compact
property int hemisphere: main.hemisphere
property bool showBackground: main.showBackground
Component.onCompleted: updateDetails()
onHemisphereChanged: updateDetails()
function updateDetails() {
// set the correct image for the moon
currentPhase = LunaCalc.getCurrentPhase();
lunaIcon.phaseNumber = currentPhase.number;
lunaIcon.hemisphere = hemisphere;
}
......@@ -89,14 +88,14 @@ Item {
interval: 60 * 60 * 1000 // 60 minutes
repeat: true
running: true
onTriggered: updateDetails()
onTriggered: updateDetails()
}
LunaIcon {
id: lunaIcon
hemisphere: hemisphere
anchors.fill: parent
MouseArea {
anchors.fill: parent
onClicked: plasmoid.expanded = !plasmoid.expanded
......@@ -104,18 +103,18 @@ Item {
}
}
Plasmoid.fullRepresentation: Rectangle {
id: full
property alias lw_width: lunaWidget.width
property alias lw_height: lunaWidget.height
/* I cannot figure out ANY way to change the size of this
* object AFTER it has been created. The lw_width value
* DOES get changed, it just has no effect on setting this
* width value.
*
*
* I would settle for making this a type that adjusts its
* size to enclose its content - and as far as I can see,
* it can't do it either. The size it appears at is the
......@@ -126,17 +125,17 @@ Item {
property int dateFormat: main.dateFormat
property string dateFormatString: main.dateFormatString
//onLw_widthChanged: width = lw_width //console.log("It changed! " + lw_width.toString())
onDateFormatChanged: {
lunaWidget.dateFormat = dateFormat;
}
onDateFormatStringChanged: {
lunaWidget.dateFormatString = dateFormatString;
}
LunaWidget {
id: lunaWidget
dateFormat: dateFormat
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment