Commit e59d0134 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: fix buttons for color editing

parent d87471af
import Qt 4.7
import Bauhaus 1.0
QGroupBox {
id: colorTypeButtons
layout: HorizontalLayout {
topMargin: 6
rightMargin: 10;
Label {
text: "Type"
QWidget {
property bool showGradientButton
property bool gradient: gradientButton.checked
property bool none: noneButton.checked
property bool solid: solidButton.checked
property bool setGradient: false
property bool setNone: false
property bool setSolid: false
onSetGradientChanged: {
if (setGradient == true) {
gradientButton.checked = true;
setGradient = false;
}
}
QWidget {
fixedHeight: 32
onSetNoneChanged: {
if (setNone == true) {
noneButton.checked = true;
setNone = false;
}
}
QPushButton {
id: noneButton
checkable: true
fixedWidth: 32
fixedHeight: 32
styleSheetFile: "nonecolorbutton.css";
onSetSolidChanged: {
if (setSolid == true) {
solidButton.checked = true;
setSolid = false;
}
}
onToggled: {
if (checked) {
gradientButton.checked = false;
solidButton.checked = false;
}
}
fixedHeight: 28
fixedWidth: 93
width: fixedWidth
height: fixedHeight
enabled: isBaseState
}
QPushButton {
id: solidButton
x: 32
checkable: true
fixedWidth: 32
fixedHeight: 32
styleSheetFile: "solidcolorbutton.css";
onToggled: {
if (checked) {
gradientButton.checked = false;
noneButton.checked = false;
}
}
QPushButton {
id: solidButton
x: 0
checkable: true
checked: true
fixedWidth: 31
fixedHeight: 28
styleSheetFile: "solidcolorbutton.css";
onToggled: {
if (checked) {
gradientButton.checked = false;
noneButton.checked = false;
}
QPushButton {
id: gradientButton
x: 64
checkable: true
fixedWidth: 32
fixedHeight: 32
styleSheetFile: "gradientcolorbutton.css";
onToggled: {
if (checked) {
solidButton.checked = false;
noneButton.checked = false;
}
}
}
onClicked: {
gradientButton.checked = false;
noneButton.checked = false;
checked = true;
}
}
QPushButton {
visible: showGradientButton
id: gradientButton
x: 31
checkable: true
fixedWidth: 31
fixedHeight: 28
styleSheetFile: "gradientcolorbutton.css";
onToggled: {
if (checked) {
solidButton.checked = false;
noneButton.checked = false;
}
}
onClicked: {
solidButton.checked = false;
noneButton.checked = false;
checked = true;
}
}
QPushButton {
id: noneButton
x: showGradientButton ? 62 : 31;
checkable: true
fixedWidth: 31
fixedHeight: 28
styleSheetFile: "nonecolorbutton.css";
onToggled: {
if (checked) {
gradientButton.checked = false;
solidButton.checked = false;
}
}
onClicked: {
gradientButton.checked = false;
solidButton.checked = false;
checked = true;
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment