Commit 0ffb029a authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: cleanup of FontGroupBox



Creating a proper interface for all the single dot properties.
This is easier to read and allows usage in items with a different
name for the font property.

Same fix for FontStyleButtons

Change-Id: I3d6b9ab6c9ccd5ffc1f7d06bf3f528df7ddb030d
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@digia.com>
parent e93f3e4c
......@@ -34,6 +34,16 @@ GroupBox {
id: fontGroupBox
caption: qsTr("Font")
property variant showStyle: false
property variant fontFamily: backendValues.font_family
property variant pointSize: backendValues.font_pointSize
property variant pixelSize: backendValues.font_pixelSize
property variant boldStyle: backendValues.font_bold
property variant italicStyle: backendValues.font_italic
property variant underlineStyle: backendValues.font_underline
property variant strikeoutStyle: backendValues.font_strikeout
layout: VerticalLayout {
QWidget {
......@@ -43,7 +53,7 @@ GroupBox {
}
FontComboBox {
backendValue: backendValues.font_family
backendValue: fontFamily
baseStateFlag: isBaseState
}
}
......@@ -58,7 +68,7 @@ GroupBox {
onSelectionFlagChanged: {
isSetup = true;
sizeType.currentText = "points";
if (backendValues.font_pixelSize.isInModel)
if (pixelSize.isInModel)
sizeType.currentText = "pixels";
isSetup = false;
}
......@@ -70,14 +80,14 @@ GroupBox {
minimum: 0
maximum: 400
visible: !sizeWidget.pixelSize
backendValue: backendValues.font_pointSize
backendValue: pointSize
baseStateFlag: isBaseState;
}
SpinBox {
minimum: 0
maximum: 400
visible: sizeWidget.pixelSize
backendValue: backendValues.font_pixelSize
backendValue: pixelSize
baseStateFlag: isBaseState;
}
QComboBox {
......@@ -88,11 +98,11 @@ GroupBox {
if (sizeWidget.isSetup)
return;
if (currentText == "pixels") {
backendValues.font_pointSize.resetValue();
backendValues.font_pixelSize.value = 8;
pointSize.resetValue();
pixelSize.value = 8;
} else {
backendValues.font_pixelSize.resetValue();
}
pixelSize.resetValue();
}
}
}
}
......@@ -102,7 +112,12 @@ GroupBox {
Label {
text: qsTr("Font style")
}
FontStyleButtons {}
FontStyleButtons {
bold: boldStyle
italic: italicStyle
underline: underlineStyle
strikeout: strikeoutStyle
}
}
}
QWidget {
......
......@@ -34,6 +34,12 @@ QGroupBox {
id: fontStyleButtons
property int buttonWidth: 46
property variant bold: backendValues.font_bold
property variant italic: backendValues.font_italic
property variant underline: backendValues.font_underline
property variant strikeout: backendValues.font_strikeout
layout: HorizontalLayout {
QWidget {
......@@ -48,17 +54,17 @@ QGroupBox {
fixedHeight: 28
height: fixedHeight
styleSheetFile: "styledbuttonleft.css";
checked: backendValues.font_bold.value;
backendValue: backendValues.font_bold;
checked: bold.value;
backendValue: bold;
iconFromFile: flagActive ? "images/bold-h-icon.png" : "images/bold-icon.png"
onClicked: {
backendValues.font_bold.value = checked;
bold.value = checked;
}
ExtendedFunctionButton {
backendValue: backendValues.font_bold;
backendValue: bold
y: 7
x: 2
}
......@@ -75,15 +81,15 @@ QGroupBox {
iconFromFile: flagActive ? "images/italic-h-icon.png" : "images/italic-icon.png"
styleSheetFile: "styledbuttonmiddle.css";
checked: backendValues.font_italic.value;
backendValue: backendValues.font_italic;
checked: italic.value;
backendValue: italic;
onClicked: {
backendValues.font_italic.value = checked;
italic.value = checked;
}
ExtendedFunctionButton {
backendValue: backendValues.font_italic
backendValue: italic
y: 7
x: 2
}
......@@ -100,15 +106,15 @@ QGroupBox {
iconFromFile: flagActive ? "images/underline-h-icon.png" : "images/underline-icon.png"
styleSheetFile: "styledbuttonmiddle.css";
checked: backendValues.font_underline.value;
backendValue: backendValues.font_underline;
checked: underline.value;
backendValue: underline;
onClicked: {
backendValues.font_underline.value = checked;
underline.value = checked;
}
ExtendedFunctionButton {
backendValue: backendValues.font_underline;
backendValue: underline;
y: 7
x: 2
}
......@@ -125,15 +131,15 @@ QGroupBox {
iconFromFile: flagActive ? "images/strikeout-h-icon.png" : "images/strikeout-icon.png"
styleSheetFile: "styledbuttonright.css";
checked: backendValues.font_strikeout.value;
backendValue: backendValues.font_strikeout;
checked: strikeout.value;
backendValue: strikeout;
onClicked: {
backendValues.font_strikeout.value = checked;
strikeout.value = checked;
}
ExtendedFunctionButton {
backendValue: backendValues.font_strikeout;
backendValue: strikeout;
y: 7
x: 2
}
......
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