forked from qt-creator/qt-creator
QmlDesigner.propertyEditor: fix buttons for color editing
This commit is contained in:
@@ -1,39 +1,51 @@
|
|||||||
import Qt 4.7
|
import Qt 4.7
|
||||||
import Bauhaus 1.0
|
import Bauhaus 1.0
|
||||||
|
|
||||||
QGroupBox {
|
|
||||||
id: colorTypeButtons
|
|
||||||
layout: HorizontalLayout {
|
|
||||||
topMargin: 6
|
|
||||||
rightMargin: 10;
|
|
||||||
Label {
|
|
||||||
text: "Type"
|
|
||||||
}
|
|
||||||
|
|
||||||
QWidget {
|
QWidget {
|
||||||
fixedHeight: 32
|
property bool showGradientButton
|
||||||
|
|
||||||
QPushButton {
|
property bool gradient: gradientButton.checked
|
||||||
id: noneButton
|
property bool none: noneButton.checked
|
||||||
checkable: true
|
property bool solid: solidButton.checked
|
||||||
fixedWidth: 32
|
|
||||||
fixedHeight: 32
|
|
||||||
styleSheetFile: "nonecolorbutton.css";
|
|
||||||
|
|
||||||
onToggled: {
|
property bool setGradient: false
|
||||||
if (checked) {
|
property bool setNone: false
|
||||||
gradientButton.checked = false;
|
property bool setSolid: false
|
||||||
solidButton.checked = false;
|
|
||||||
|
onSetGradientChanged: {
|
||||||
|
if (setGradient == true) {
|
||||||
|
gradientButton.checked = true;
|
||||||
|
setGradient = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onSetNoneChanged: {
|
||||||
|
if (setNone == true) {
|
||||||
|
noneButton.checked = true;
|
||||||
|
setNone = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onSetSolidChanged: {
|
||||||
|
if (setSolid == true) {
|
||||||
|
solidButton.checked = true;
|
||||||
|
setSolid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fixedHeight: 28
|
||||||
|
fixedWidth: 93
|
||||||
|
width: fixedWidth
|
||||||
|
height: fixedHeight
|
||||||
|
enabled: isBaseState
|
||||||
|
|
||||||
QPushButton {
|
QPushButton {
|
||||||
id: solidButton
|
id: solidButton
|
||||||
x: 32
|
x: 0
|
||||||
checkable: true
|
checkable: true
|
||||||
fixedWidth: 32
|
checked: true
|
||||||
fixedHeight: 32
|
fixedWidth: 31
|
||||||
|
fixedHeight: 28
|
||||||
|
|
||||||
styleSheetFile: "solidcolorbutton.css";
|
styleSheetFile: "solidcolorbutton.css";
|
||||||
|
|
||||||
@@ -43,26 +55,58 @@ QGroupBox {
|
|||||||
noneButton.checked = false;
|
noneButton.checked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
onClicked: {
|
||||||
|
gradientButton.checked = false;
|
||||||
|
noneButton.checked = false;
|
||||||
|
checked = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QPushButton {
|
QPushButton {
|
||||||
|
visible: showGradientButton
|
||||||
id: gradientButton
|
id: gradientButton
|
||||||
x: 64
|
x: 31
|
||||||
checkable: true
|
checkable: true
|
||||||
fixedWidth: 32
|
fixedWidth: 31
|
||||||
fixedHeight: 32
|
fixedHeight: 28
|
||||||
|
|
||||||
styleSheetFile: "gradientcolorbutton.css";
|
styleSheetFile: "gradientcolorbutton.css";
|
||||||
|
|
||||||
|
|
||||||
onToggled: {
|
onToggled: {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
solidButton.checked = false;
|
solidButton.checked = false;
|
||||||
noneButton.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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user