From a43c08f81d1aa12f707fb7a082e167c32f0d9976 Mon Sep 17 00:00:00 2001 From: Sarathkrishnan Ramesh Date: Tue, 12 May 2020 12:58:11 +0530 Subject: [PATCH 1/3] Add color palette to plugin settings to change background color Signed-off-by: Sarathkrishnan Ramesh --- include/ignition/gui/qml/IgnCardSettings.qml | 40 ++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/include/ignition/gui/qml/IgnCardSettings.qml b/include/ignition/gui/qml/IgnCardSettings.qml index 2951b649e..85a763251 100644 --- a/include/ignition/gui/qml/IgnCardSettings.qml +++ b/include/ignition/gui/qml/IgnCardSettings.qml @@ -18,6 +18,7 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import QtQuick.Window 2.2 +import QtQuick.Dialogs 1.0 import "qrc:/qml" Dialog { @@ -72,6 +73,31 @@ Dialog { } } + GridLayout { + width: parent.width + columns: 3 + visible: !card.standalone + + Label { + text: "Background Color " + } + + Button { + Layout.preferredWidth: parent.width * 0.4 + onClicked: colorDialog.open() + background: Rectangle { + y: 8 + width: 50 + height: 30 + id: "bgColor" + color: "transparent" + border.color: "#000000" + border.width: 2 + } + } + } + + GridLayout { width: parent.width columns: 2 @@ -167,4 +193,18 @@ Dialog { } } } + + ColorDialog { + id: colorDialog + title: "Please choose a color" + showAlphaChannel : true + onAccepted: { + content.color = colorDialog.color + bgColor.color = colorDialog.color + } + onRejected: { + console.log("Canceled") + } + Component.onCompleted: visible = false + } } From 1df5e7852843240ba5a2fdadf5e62d7eb01c063e Mon Sep 17 00:00:00 2001 From: Sarathkrishnan Ramesh Date: Wed, 13 May 2020 00:31:25 +0530 Subject: [PATCH 2/3] Save plugin background color information in config file * Save plugin background color information in config file * Change default background color to white Signed-off-by: Sarathkrishnan Ramesh --- include/ignition/gui/qml/IgnCard.qml | 7 ++++++- include/ignition/gui/qml/IgnCardSettings.qml | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/ignition/gui/qml/IgnCard.qml b/include/ignition/gui/qml/IgnCard.qml index d74728fbb..3fc55703a 100644 --- a/include/ignition/gui/qml/IgnCard.qml +++ b/include/ignition/gui/qml/IgnCard.qml @@ -74,6 +74,11 @@ Pane { */ property string closeIcon: "\u2715" + /** + * The plugin backgroung color + */ + property string cardBackground: "#ffffff" + /** * */ @@ -446,7 +451,7 @@ Pane { anchors.fill: parent anchors.topMargin: card.showTitleBar ? 50 : 0 clip: true - color: "transparent" + color: cardBackground onChildrenChanged: { card.syncTheFamily() diff --git a/include/ignition/gui/qml/IgnCardSettings.qml b/include/ignition/gui/qml/IgnCardSettings.qml index 85a763251..e28ba7159 100644 --- a/include/ignition/gui/qml/IgnCardSettings.qml +++ b/include/ignition/gui/qml/IgnCardSettings.qml @@ -90,7 +90,7 @@ Dialog { width: 50 height: 30 id: "bgColor" - color: "transparent" + color: cardBackground border.color: "#000000" border.width: 2 } @@ -201,6 +201,7 @@ Dialog { onAccepted: { content.color = colorDialog.color bgColor.color = colorDialog.color + cardBackground = colorDialog.color } onRejected: { console.log("Canceled") From 1e91dcccc3639b77547186fd3ebcd620ea58ca6f Mon Sep 17 00:00:00 2001 From: Sarathkrishnan Ramesh Date: Wed, 13 May 2020 14:00:30 +0530 Subject: [PATCH 3/3] Change default background back to transparent Signed-off-by: Sarathkrishnan Ramesh --- include/ignition/gui/qml/IgnCard.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ignition/gui/qml/IgnCard.qml b/include/ignition/gui/qml/IgnCard.qml index 3fc55703a..c9af52dc8 100644 --- a/include/ignition/gui/qml/IgnCard.qml +++ b/include/ignition/gui/qml/IgnCard.qml @@ -75,9 +75,9 @@ Pane { property string closeIcon: "\u2715" /** - * The plugin backgroung color + * The plugin backgroung color. Default: transparent */ - property string cardBackground: "#ffffff" + property string cardBackground: "#00000000" /** *