diff --git a/contents/config/config.qml b/contents/config/config.qml index e69de29..be2bd42 100644 --- a/contents/config/config.qml +++ b/contents/config/config.qml @@ -0,0 +1,10 @@ +import QtQuick 2.0 +import org.kde.plasma.configuration 2.0 + +ConfigModel { + ConfigCategory { + name: i18n("General") + icon: "configure" + source: "configGeneral.qml" + } +} \ No newline at end of file diff --git a/contents/config/main.xml b/contents/config/main.xml index 8b13789..8013df4 100644 --- a/contents/config/main.xml +++ b/contents/config/main.xml @@ -1 +1,10 @@ + + + + + + black + + + \ No newline at end of file diff --git a/contents/images/hello/0.png b/contents/images/black/hello/0.png similarity index 100% rename from contents/images/hello/0.png rename to contents/images/black/hello/0.png diff --git a/contents/images/hello/1.png b/contents/images/black/hello/1.png similarity index 100% rename from contents/images/hello/1.png rename to contents/images/black/hello/1.png diff --git a/contents/images/hello/2.png b/contents/images/black/hello/2.png similarity index 100% rename from contents/images/hello/2.png rename to contents/images/black/hello/2.png diff --git a/contents/images/hello/3.png b/contents/images/black/hello/3.png similarity index 100% rename from contents/images/hello/3.png rename to contents/images/black/hello/3.png diff --git a/contents/images/idle/0.png b/contents/images/black/idle/0.png similarity index 100% rename from contents/images/idle/0.png rename to contents/images/black/idle/0.png diff --git a/contents/images/idle/1.png b/contents/images/black/idle/1.png similarity index 100% rename from contents/images/idle/1.png rename to contents/images/black/idle/1.png diff --git a/contents/images/idle/2.png b/contents/images/black/idle/2.png similarity index 100% rename from contents/images/idle/2.png rename to contents/images/black/idle/2.png diff --git a/contents/images/idle/3.png b/contents/images/black/idle/3.png similarity index 100% rename from contents/images/idle/3.png rename to contents/images/black/idle/3.png diff --git a/contents/images/idle/4.png b/contents/images/black/idle/4.png similarity index 100% rename from contents/images/idle/4.png rename to contents/images/black/idle/4.png diff --git a/contents/images/idle/5.png b/contents/images/black/idle/5.png similarity index 100% rename from contents/images/idle/5.png rename to contents/images/black/idle/5.png diff --git a/contents/images/idle/6.png b/contents/images/black/idle/6.png similarity index 100% rename from contents/images/idle/6.png rename to contents/images/black/idle/6.png diff --git a/contents/images/idle/7.png b/contents/images/black/idle/7.png similarity index 100% rename from contents/images/idle/7.png rename to contents/images/black/idle/7.png diff --git a/contents/images/talk/0.png b/contents/images/black/talk/0.png similarity index 100% rename from contents/images/talk/0.png rename to contents/images/black/talk/0.png diff --git a/contents/images/black/talk/1.png b/contents/images/black/talk/1.png new file mode 100644 index 0000000..6f5c31a Binary files /dev/null and b/contents/images/black/talk/1.png differ diff --git a/contents/images/talk/1.png b/contents/images/talk/1.png deleted file mode 100644 index 5e8d64d..0000000 Binary files a/contents/images/talk/1.png and /dev/null differ diff --git a/contents/images/talk/1.png~ b/contents/images/talk/1.png~ deleted file mode 100644 index ca1e020..0000000 Binary files a/contents/images/talk/1.png~ and /dev/null differ diff --git a/contents/images/white/hello/0.png b/contents/images/white/hello/0.png new file mode 100644 index 0000000..d533e00 Binary files /dev/null and b/contents/images/white/hello/0.png differ diff --git a/contents/images/white/hello/1.png b/contents/images/white/hello/1.png new file mode 100644 index 0000000..e717047 Binary files /dev/null and b/contents/images/white/hello/1.png differ diff --git a/contents/images/white/hello/2.png b/contents/images/white/hello/2.png new file mode 100644 index 0000000..caee6eb Binary files /dev/null and b/contents/images/white/hello/2.png differ diff --git a/contents/images/white/hello/3.png b/contents/images/white/hello/3.png new file mode 100644 index 0000000..0d526ac Binary files /dev/null and b/contents/images/white/hello/3.png differ diff --git a/contents/images/white/idle/0.png b/contents/images/white/idle/0.png new file mode 100644 index 0000000..06161d4 Binary files /dev/null and b/contents/images/white/idle/0.png differ diff --git a/contents/images/white/idle/1.png b/contents/images/white/idle/1.png new file mode 100644 index 0000000..d0cd998 Binary files /dev/null and b/contents/images/white/idle/1.png differ diff --git a/contents/images/white/idle/2.png b/contents/images/white/idle/2.png new file mode 100644 index 0000000..217704b Binary files /dev/null and b/contents/images/white/idle/2.png differ diff --git a/contents/images/white/idle/3.png b/contents/images/white/idle/3.png new file mode 100644 index 0000000..9643a2f Binary files /dev/null and b/contents/images/white/idle/3.png differ diff --git a/contents/images/white/idle/4.png b/contents/images/white/idle/4.png new file mode 100644 index 0000000..60fdbdf Binary files /dev/null and b/contents/images/white/idle/4.png differ diff --git a/contents/images/white/idle/5.png b/contents/images/white/idle/5.png new file mode 100644 index 0000000..61287f3 Binary files /dev/null and b/contents/images/white/idle/5.png differ diff --git a/contents/images/white/idle/6.png b/contents/images/white/idle/6.png new file mode 100644 index 0000000..8c92a6b Binary files /dev/null and b/contents/images/white/idle/6.png differ diff --git a/contents/images/white/idle/7.png b/contents/images/white/idle/7.png new file mode 100644 index 0000000..e2a4189 Binary files /dev/null and b/contents/images/white/idle/7.png differ diff --git a/contents/images/white/talk/0.png b/contents/images/white/talk/0.png new file mode 100644 index 0000000..11aad22 Binary files /dev/null and b/contents/images/white/talk/0.png differ diff --git a/contents/images/white/talk/1.png b/contents/images/white/talk/1.png new file mode 100644 index 0000000..9df95e3 Binary files /dev/null and b/contents/images/white/talk/1.png differ diff --git a/contents/ui/configGeneral.qml b/contents/ui/configGeneral.qml index e69de29..b0b73cd 100644 --- a/contents/ui/configGeneral.qml +++ b/contents/ui/configGeneral.qml @@ -0,0 +1,22 @@ +// configGeneral.qml +import QtQuick 2.0 +import QtQuick.Controls 2.5 +import QtQuick.Layouts 1.12 +import org.kde.kirigami 2.4 as Kirigami + +Item { + id: page + property alias cfg_sharkleColor: sharkleColor.currentText + + + Kirigami.FormLayout { + anchors.left: parent.left + anchors.right: parent.right + + ComboBox { + id: sharkleColor + Kirigami.FormData.label: "Sharkle Color:" + model: ["Black", "White"] + } + } +} \ No newline at end of file diff --git a/contents/ui/main.qml b/contents/ui/main.qml index cdbb15d..4b13726 100644 --- a/contents/ui/main.qml +++ b/contents/ui/main.qml @@ -5,10 +5,9 @@ import QtMultimedia 5.15 import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 3.0 as PlasmaComponents3 Item { - Plasmoid.backgroundHints: "NoBackground" + Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground Plasmoid.fullRepresentation: Item { Layout.minimumWidth: 100 Layout.minimumHeight: 100 @@ -19,74 +18,79 @@ Item { property int talkIndex: 0 property int soundIndex: 0 property bool isIdle: true + property string sharkleColor: Plasmoid.configuration.sharkleColor.toLowerCase() + + Timer { + id: animationTimer + interval: 100 + running: true + repeat: true + onTriggered: { + // Loop frame 0 to 7 + imageIndex = (imageIndex + 1) % 8 + + // Loop frame 0 to 1, every 8 iterations + talkIndex = imageIndex == 0 ? !talkIndex : talkIndex + } + } + + Timer { + id: idleTimer + interval: 1600 + running: false + repeat: false + onTriggered: { + // Set animation to idle + imageIndex = 0 + isIdle = true + } + } + + MediaPlayer { + id: mediaplayer + source: "../sounds/" + soundIndex + ".wav" + } + MouseArea { + anchors.fill: parent + onClicked: { + // Set animation to hello + isIdle = false + idleTimer.restart() + + // Play sound + soundIndex = (soundIndex + 1) % 8 + mediaplayer.play() + } + } Item { + id: imageContainer width: Math.min(parent.width, parent.height) height: Math.min(parent.width, parent.height) Image { - id: idle + id: idleImage anchors.fill: parent - source: "../images/idle/" + imageIndex + ".png" + source: "../images/" + sharkleColor + "/idle/" + imageIndex + ".png" visible: isIdle } Image { - id: hello + id: helloImage anchors.fill: parent - source: "../images/hello/" + (imageIndex%4) + ".png" + source: "../images/" + sharkleColor + "/hello/" + (imageIndex%4) + ".png" visible: !isIdle } Image { - id: talk + id: talkImage width: parent.width height: parent.height - anchors.right: idle.left + anchors.right: idleImage.left anchors.rightMargin: -60 - anchors.bottom: idle.top + anchors.bottom: idleImage.top anchors.bottomMargin: -60 - source: "../images/talk/" + (talkIndex) + ".png" + source: "../images/" + sharkleColor + "/talk/" + (talkIndex) + ".png" visible: !isIdle } - Timer { - interval: 100 - running: true - repeat: true - onTriggered: { - // Loop 0 to 7 - imageIndex = (imageIndex + 1) % 8 - - // Loop 0 to 1, change every 8 frames - talkIndex = imageIndex == 0 ? !talkIndex : talkIndex - } - } - Timer { - id: idleTimer - interval: 1600 - running: false - repeat: false - onTriggered: { - // Set to idle - imageIndex = 0 - isIdle = true - } - } - MediaPlayer { - id: mediaplayer - source: "../sounds/" + soundIndex + ".wav" - } - MouseArea { - anchors.fill: parent - onClicked: { - // Set to hello - isIdle = false - idleTimer.restart() - - // Play sound - soundIndex = (soundIndex + 1) % 8 - mediaplayer.play() - } - } } } } -