diff --git a/include/ignition/gui/qml/IgnCard.qml b/include/ignition/gui/qml/IgnCard.qml index d74728fbb..c9af52dc8 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. Default: transparent + */ + property string cardBackground: "#00000000" + /** * */ @@ -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 2951b649e..e28ba7159 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: cardBackground + border.color: "#000000" + border.width: 2 + } + } + } + + GridLayout { width: parent.width columns: 2 @@ -167,4 +193,19 @@ Dialog { } } } + + ColorDialog { + id: colorDialog + title: "Please choose a color" + showAlphaChannel : true + onAccepted: { + content.color = colorDialog.color + bgColor.color = colorDialog.color + cardBackground = colorDialog.color + } + onRejected: { + console.log("Canceled") + } + Component.onCompleted: visible = false + } }