Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add color palette to plugin settings to change background color #62

Merged
merged 3 commits into from May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion include/ignition/gui/qml/IgnCard.qml
Expand Up @@ -74,6 +74,11 @@ Pane {
*/
property string closeIcon: "\u2715"

/**
* The plugin backgroung color. Default: transparent
*/
property string cardBackground: "#00000000"

/**
*
*/
Expand Down Expand Up @@ -446,7 +451,7 @@ Pane {
anchors.fill: parent
anchors.topMargin: card.showTitleBar ? 50 : 0
clip: true
color: "transparent"
color: cardBackground

onChildrenChanged: {
card.syncTheFamily()
Expand Down
41 changes: 41 additions & 0 deletions include/ignition/gui/qml/IgnCardSettings.qml
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}