# HG changeset patch
# User sl
# Date 1401188892 -7200
# Node ID bc046f5187fdb9b4b1bb07ae4c12f5bdec3f70d1
# Parent c0e13d2503b9aae7244aded4e96138048854ad56
Selected font is now persisting.
diff -r c0e13d2503b9 -r bc046f5187fd FontsTab.qml
--- a/FontsTab.qml Tue May 27 12:00:47 2014 +0200
+++ b/FontsTab.qml Tue May 27 13:08:12 2014 +0200
@@ -1,6 +1,8 @@
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Dialogs 1.1
+import QtQuick.Layouts 1.1
+import Qt.labs.settings 1.0
Item {
width: 640
@@ -9,6 +11,12 @@
clip: true
+
+ Settings {
+ property alias font: textFontDemoLowerCase.font;
+ }
+
+
//
FontDialog {
id: fontDialog
@@ -19,78 +27,92 @@
monospacedFonts: fontDialogMonospacedFonts.checked
proportionalFonts: fontDialogProportionalFonts.checked
title: qsTr("Choose a font")
- font: Qt.font({ family: "Arial", pointSize: 24, weight: Font.Normal })
- currentFont: Qt.font({ family: "Arial", pointSize: 24, weight: Font.Normal })
+ font: textFontDemoLowerCase.font
+ currentFont: textFontDemoLowerCase.font
onCurrentFontChanged: { console.log("CurrentFontChanged: " + currentFont) }
- onAccepted: { console.log("Accepted: " + font) }
+ onFontChanged: { console.log("FontChanged: " + font) }
+ onAccepted: {
+ console.log("Accepted: " + font);
+ textFontDemoLowerCase.font = currentFont;
+ //textFontDemoUpperCase.font = currentFont;
+ //textFontDemoDigits.font = currentFont;
+ }
onRejected: { console.log("Rejected") }
}
//
-
- Flow {
+ ColumnLayout {
anchors.fill: parent
- anchors.margins: 12
- spacing: 10
-
- CheckBox {
- id: fontDialogScalableFonts
- text: "Scalable fonts"
- Binding on checked { value: fontDialog.scalableFonts }
- }
- CheckBox {
- id: fontDialogNonScalableFonts
- text: "Non scalable fonts"
- Binding on checked { value: fontDialog.nonScalableFonts }
- }
- CheckBox {
- id: fontDialogMonospacedFonts
- text: "Monospaced fonts"
- Binding on checked { value: fontDialog.monospacedFonts }
- }
- CheckBox {
- id: fontDialogProportionalFonts
- text: "Proportional fonts"
- Binding on checked { value: fontDialog.proportionalFonts }
- }
-
- Text {
- text: "Current font:"
- }
+ anchors.margins: 8
+ spacing: 8
Text {
id: fontLabel
- color: palette.windowText
- text: "" + fontDialog.font.family + " - " + fontDialog.font.pointSize + ""
+ text: "Current font: " + textFontDemoLowerCase.font.family + " - " + textFontDemoLowerCase.font.pointSize +""
MouseArea {
anchors.fill: parent
onClicked: fontDialog.open()
}
}
- Text {
- id: textFontDemoLowerCase
- text: "abcdefghijklmnopqrstyvwxyz"
- font: fontDialog.font
+ ColumnLayout {
+ anchors.margins: 0
+ spacing: 0
+
+ Text {
+ id: textFontDemoLowerCase
+ anchors.margins: 0
+ text: "abcdefghijklmnopqrstyvwxyz"
+ font: Qt.font({ family: "Arial", pointSize: 16, weight: Font.Normal })
+ }
+
+ Text {
+ id: textFontDemoUpperCase
+ anchors.margins: 0
+ text: "ABCDEFGHIJKLMNOPQRSTYVWXYZ"
+ font: textFontDemoLowerCase.font
+ }
+
+ Text {
+ id: textFontDemoDigits
+ anchors.margins: 0
+ text: "0123456789"
+ font: textFontDemoLowerCase.font
+ }
}
- Text {
- id: textFontDemoUpperCase
- text: "ABCDEFGHIJKLMNOPQRSTYVWXYZ"
- font: fontDialog.font
+ //Font selection options
+ GridLayout {
+ anchors.margins: 8
+ columns: 2
+ columnSpacing: 8
+
+ CheckBox {
+ id: fontDialogScalableFonts
+ text: "Scalable fonts"
+ Binding on checked { value: fontDialog.scalableFonts }
+ }
+ CheckBox {
+ id: fontDialogNonScalableFonts
+ text: "Non scalable fonts"
+ Binding on checked { value: fontDialog.nonScalableFonts }
+ }
+ CheckBox {
+ id: fontDialogMonospacedFonts
+ text: "Monospaced fonts"
+ Binding on checked { value: fontDialog.monospacedFonts }
+ }
+ CheckBox {
+ id: fontDialogProportionalFonts
+ text: "Proportional fonts"
+ Binding on checked { value: fontDialog.proportionalFonts }
+ }
}
- Text {
- id: textFontDemoDigits
- text: "0123456789"
- font: fontDialog.font
- }
Button {
- text: qsTr("Select Font")
+ text: qsTr("Change font")
onClicked: fontDialog.open()
}
-
-
- }
-}
+ } //ColumnLayout
+} //Item
diff -r c0e13d2503b9 -r bc046f5187fd MiniDisplayManager.pro.user
--- a/MiniDisplayManager.pro.user Tue May 27 12:00:47 2014 +0200
+++ b/MiniDisplayManager.pro.user Tue May 27 13:08:12 2014 +0200
@@ -1,6 +1,6 @@
-
+
ProjectExplorer.Project.ActiveTarget
@@ -219,8 +219,8 @@
2
MiniDisplayManager
-
- Qt4ProjectManager.Qt4RunConfiguration:D:/Dev/Qt/MiniDisplayManager/MiniDisplayManager.pro
+ MiniDisplayManager2
+ Qt4ProjectManager.Qt4RunConfiguration:D:/Dev/slions.net/MiniDisplayManager/MiniDisplayManager.pro
MiniDisplayManager.pro
false
diff -r c0e13d2503b9 -r bc046f5187fd main.qml
--- a/main.qml Tue May 27 12:00:47 2014 +0200
+++ b/main.qml Tue May 27 13:08:12 2014 +0200
@@ -7,7 +7,6 @@
import Qt.labs.settings 1.0
-
ApplicationWindow {
id: appWindow
visible: true