mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-01-18 20:20:45 +00:00
Fix bad behaving color dialog on some platforms.
This commit is contained in:
parent
a63135045e
commit
d10bf29493
@ -22,8 +22,10 @@ import QtQuick 2.2
|
|||||||
import QtQuick.Dialogs 1.1
|
import QtQuick.Dialogs 1.1
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
id: rootItem
|
||||||
|
|
||||||
signal colorSelected (color color)
|
signal colorSelected (color color)
|
||||||
property color button_color
|
property color color
|
||||||
property string name
|
property string name
|
||||||
|
|
||||||
ColorDialog {
|
ColorDialog {
|
||||||
@ -33,13 +35,13 @@ Item {
|
|||||||
visible: false
|
visible: false
|
||||||
|
|
||||||
//This is a workaround to a Qt 5.2 bug.
|
//This is a workaround to a Qt 5.2 bug.
|
||||||
onCurrentColorChanged: colorDialog.color = colorDialog.currentColor;
|
onColorChanged: if (Qt.platform.os !== "osx") colorSelected(color)
|
||||||
onAccepted: colorSelected(color)
|
onAccepted: if (Qt.platform.os === "osx") colorSelected(color)
|
||||||
}
|
}
|
||||||
Rectangle{
|
Rectangle{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: 10
|
radius: 10
|
||||||
color: button_color
|
color: rootItem.color
|
||||||
border.color: "black"
|
border.color: "black"
|
||||||
Glossy {}
|
Glossy {}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@ -52,7 +54,7 @@ Item {
|
|||||||
Text{
|
Text{
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
z: parent.z + 1
|
z: parent.z + 1
|
||||||
text: name + ": " + button_color
|
text: name + ": " + rootItem.color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
@ -125,14 +125,14 @@ Tab{
|
|||||||
height: 50
|
height: 50
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onColorSelected: appSettings._fontColor = color;
|
onColorSelected: appSettings._fontColor = color;
|
||||||
button_color: appSettings._fontColor
|
color: appSettings._fontColor
|
||||||
}
|
}
|
||||||
ColorButton{
|
ColorButton{
|
||||||
name: qsTr("Background")
|
name: qsTr("Background")
|
||||||
height: 50
|
height: 50
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onColorSelected: appSettings._backgroundColor = color;
|
onColorSelected: appSettings._backgroundColor = color;
|
||||||
button_color: appSettings._backgroundColor
|
color: appSettings._backgroundColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user