diff --git a/qml.qrc b/qml.qrc index fb927cdb..7fa985ce 100644 --- a/qml.qrc +++ b/qml.qrc @@ -2,8 +2,6 @@ qml/overlays/BulletinOverlay.qml qml/overlays/ChatOverlay.qml - qml/overlays/Game1Overlay.qml - qml/overlays/Game2Overlay.qml qml/overlays/ListOverlay.qml qml/overlays/MembershipOverlay.qml qml/main.qml @@ -30,7 +28,7 @@ qml/widgets/MyProfile.qml qml/widgets/ProfileList.qml qml/widgets/RadioButton.qml - qml/widgets/SimpleButton.qml + qml/widgets/Button.qml qml/widgets/StackToolbar.qml qml/widgets/TextField.qml qml/widgets/controls/Loader.qml diff --git a/qml/overlays/BulletinOverlay.qml b/qml/overlays/BulletinOverlay.qml index 47a4a64a..da8668c4 100644 --- a/qml/overlays/BulletinOverlay.qml +++ b/qml/overlays/BulletinOverlay.qml @@ -175,7 +175,7 @@ ColumnLayout { width: parent.width - 50 } - Widgets.SimpleButton { + Widgets.Button { id: replybtn visible: selected text: "reply" @@ -230,7 +230,7 @@ ColumnLayout { } - Widgets.SimpleButton { // SEND MESSAGE BUTTON + Widgets.Button { // SEND MESSAGE BUTTON id: btnSend icon: "regular/paper-plane" text: "post" diff --git a/qml/overlays/ChatOverlay.qml b/qml/overlays/ChatOverlay.qml index ecc7c97b..74796dc3 100644 --- a/qml/overlays/ChatOverlay.qml +++ b/qml/overlays/ChatOverlay.qml @@ -4,7 +4,7 @@ import QtQuick.Controls 2.4 import QtQuick.Controls.Material 2.0 import QtQuick.Layouts 1.3 -import "../widgets" +import "../widgets" as Widgets import "../widgets/controls" as Awesome import "../fonts/Twemoji.js" as T import "../utils.js" as Utils @@ -29,7 +29,7 @@ Item { ScrollBar.vertical: ScrollBar {} maximumFlickVelocity: 1250 - delegate: Message { + delegate: Widgets.Message { handle: _handle from: _from displayName: _displayName @@ -128,7 +128,7 @@ Item { } } - EmojiDrawer { + Widgets.EmojiDrawer { id: emojiDrawer anchors.left: parent.left anchors.right: parent.right @@ -265,7 +265,7 @@ Item { spacing: 1 - SimpleButton { // SEND MESSAGE BUTTON + Widgets.Button { // SEND MESSAGE BUTTON id: btnSend icon: "regular/paper-plane" text: "send" @@ -301,7 +301,7 @@ Item { spacing: 1 - SimpleButton { // EMOJI DRAWER BUTTON + Widgets.Button { // EMOJI DRAWER BUTTON id: btnEmoji icon: "regular/smile" anchors.right: btnAttach.left @@ -310,7 +310,7 @@ Item { onClicked: emojiDrawer.visible ? emojiDrawer.slideclosed() : emojiDrawer.slideopen() } - SimpleButton { + Widgets.Button { id: btnAttach icon: "solid/paperclip" anchors.right: parent.right diff --git a/qml/overlays/Game1Overlay.qml b/qml/overlays/Game1Overlay.qml deleted file mode 100644 index 87b69234..00000000 --- a/qml/overlays/Game1Overlay.qml +++ /dev/null @@ -1,262 +0,0 @@ -import QtGraphicalEffects 1.0 -import QtQuick 2.7 -import QtQuick.Controls 2.4 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Material 2.0 -import QtQuick.Layouts 1.3 - -import "../widgets" -import "../widgets/controls" as Awesome -import "../fonts/Twemoji.js" as T -import "../utils.js" as Utils - -ColumnLayout { - Layout.fillWidth: true - width:parent.width - anchors.horizontalCenter: parent.horizontalCenter - id: puzzleGame - - - Connections { - target: gcd - - onClearMessages: function() { - - } - - onAppendMessage: function(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) { - handler(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) - } - - onPrependMessage: function(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) { - handler(handle, from, displayName, message, image, mid, fromMe, ts, ack, error) - } - - - function handler(handle, from, displayName, message, image, mid, fromMe, ts) { - var msg - try { - msg = JSON.parse(message) - } catch (e) { - return - } - if (msg.o != 3) return - - if (msg.p != undefined && msg.s != undefined) { - - var points = JSON.stringify(msg.s) - var path = JSON.stringify(msg.p) - - var remove = -1 - for(var i=0;i -1) { - solutions.remove(remove) - //console.log("Better solution found for Puzzle " + "Puzzle " + JSON.stringify(msg.s)) - - } - solutions.insert(0,{ - "text": "Puzzle " + JSON.stringify(msg.s), - "points":points, - "path": path, - "from": from, - "displayName": displayName, - "timestamp": ts - }) - - } - } - } - - - ListModel { - id: solutions - } - - RowLayout { - - anchors.right: parent.right - anchors.rightMargin: 2 - - ComboBox { - width: 200 - textRole: "text" - model: solutions - onActivated: { - //console.log("Loading puzzle " + index) - var solution = solutions.get(index) - //console.log("Loading puzzle " + JSON.parse(solution.path)) - canvas.points = JSON.parse(solution.points) - canvas.path = JSON.parse(solution.path) - gameScore.text = Utils.scorePath(canvas.path) - canvas.requestPaint() - } - } - - Slider { - id: gameDifficulty - value: 5 - stepSize: 1.0 - minimumValue: 4.0 - maximumValue: 16.0 - anchors.rightMargin: 2 - } - - SimpleButton { // New Game - id: btnNewGame - icon: "regular/paper-plane" - text: "new game" - - anchors.rightMargin: 2 - - property int nextMessageID: 1 - - onClicked: { - canvas.points = [] - canvas.path = [] - gameScore.text = 0 - for(var i=0;i