Font configuration options
Slightly tested, but still not recommended for release.
This commit is contained in:
parent
645d39df5f
commit
c242ab9daf
7 changed files with 181 additions and 50 deletions
139
slice/FontScheme.qml
Normal file
139
slice/FontScheme.qml
Normal file
|
|
@ -0,0 +1,139 @@
|
||||||
|
import QtQuick 2.7
|
||||||
|
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
/* * * * * * * * * * * * * * * * * *
|
||||||
|
*
|
||||||
|
* Layer 1 options
|
||||||
|
* Required
|
||||||
|
*
|
||||||
|
* * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
property string main: config.font
|
||||||
|
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * *
|
||||||
|
*
|
||||||
|
* Layer 2 options
|
||||||
|
* Common
|
||||||
|
*
|
||||||
|
* * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
property font slices: Qt.font({
|
||||||
|
family: config.font_slices ? config.font_slices : config.font,
|
||||||
|
pointSize: config.font_slices_size ? config.font_slices_size : 13,
|
||||||
|
bold: bool(config.font_slices_bold) ? bool(config.font_slices_bold) : true,
|
||||||
|
italic: bool(config.font_slices_italic) ? bool(config.font_slices_italic) : false,
|
||||||
|
underline: bool(config.font_slices_underline) ? bool(config.font_slices_underline) : false,
|
||||||
|
capitalization: not_null(config.font_slices_capitalize) ? bool(config.font_slices_capitalize) : Font.AllUppercase
|
||||||
|
});
|
||||||
|
|
||||||
|
property font inputGroup: Qt.font({
|
||||||
|
family: config.font_input_group ? config.font_input_group : config.font,
|
||||||
|
pointSize: config.font_input_group_size ? config.font_input_group_size : 18,
|
||||||
|
bold: bool(config.font_input_group_bold) ? bool(config.font_input_group_bold) : false,
|
||||||
|
italic: bool(config.font_input_group_italic) ? bool(config.font_input_group_italic) : false,
|
||||||
|
underline: bool(config.font_input_group_underline) ? bool(config.font_input_group_underline) : false,
|
||||||
|
capitalization: not_null(config.font_input_group_capitalize) ? bool(config.font_input_group_capitalize) : Font.MixedCase
|
||||||
|
});
|
||||||
|
|
||||||
|
property font listItemBig: Qt.font({
|
||||||
|
family: config.font_list_item_big ? config.font_list_item_big : config.font,
|
||||||
|
pointSize: config.font_list_item_big_size ? config.font_list_item_big_size : 36,
|
||||||
|
bold: bool(config.font_list_item_big_bold) ? bool(config.font_list_item_big_bold) : true,
|
||||||
|
italic: bool(config.font_list_item_big_italic) ? bool(config.font_list_item_big_italic) : false,
|
||||||
|
underline: bool(config.font_list_item_big_underline) ? bool(config.font_list_item_big_underline) : false,
|
||||||
|
capitalization: not_null(config.font_list_item_big_capitalize) ? bool(config.font_list_item_big_capitalize) : Font.MixedCase
|
||||||
|
});
|
||||||
|
|
||||||
|
property font listItemMed: Qt.font({
|
||||||
|
family: config.font_list_item_med ? config.font_list_item_med : config.font,
|
||||||
|
pointSize: config.font_list_item_med_size ? config.font_list_item_med_size : 28,
|
||||||
|
bold: bool(config.font_list_item_med_bold) ? bool(config.font_list_item_med_bold) : true,
|
||||||
|
italic: bool(config.font_list_item_med_italic) ? bool(config.font_list_item_med_italic) : false,
|
||||||
|
underline: bool(config.font_list_item_med_underline) ? bool(config.font_list_item_med_underline) : false,
|
||||||
|
capitalization: not_null(config.font_list_item_med_capitalize) ? bool(config.font_list_item_med_capitalize) : Font.MixedCase
|
||||||
|
});
|
||||||
|
|
||||||
|
property font listItemSub: Qt.font({
|
||||||
|
family: config.font_list_item_sub ? config.font_list_item_sub : config.font,
|
||||||
|
pointSize: config.font_list_item_sub_size ? config.font_list_item_sub_size : 20,
|
||||||
|
bold: bool(config.font_list_item_sub_bold) ? bool(config.font_list_item_sub_bold) : false,
|
||||||
|
italic: bool(config.font_list_item_sub_italic) ? bool(config.font_list_item_sub_italic) : false,
|
||||||
|
underline: bool(config.font_list_item_sub_underline) ? bool(config.font_list_item_sub_underline) : false,
|
||||||
|
capitalization: not_null(config.font_list_item_sub_capitalize) ? bool(config.font_list_item_sub_capitalize) : Font.MixedCase
|
||||||
|
});
|
||||||
|
|
||||||
|
property font error: Qt.font({
|
||||||
|
family: config.font_error ? config.font_error : config.font,
|
||||||
|
pointSize: config.font_error_size ? config.font_error_size : 18,
|
||||||
|
bold: bool(config.font_error_bold) ? bool(config.font_error_bold) : bold,
|
||||||
|
italic: bool(config.font_error_italic) ? bool(config.font_error_italic) : false,
|
||||||
|
underline: bool(config.font_error_underline) ? bool(config.font_error_underline) : false,
|
||||||
|
capitalization: not_null(config.font_error_capitalize) ? bool(config.font_error_capitalize) : Font.MixedCase
|
||||||
|
});
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * *
|
||||||
|
*
|
||||||
|
* Layer 3 options
|
||||||
|
* Control types
|
||||||
|
*
|
||||||
|
* * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
// Slices
|
||||||
|
property font slicesTop: Qt.font({
|
||||||
|
family: config.font_slices_top ? config.font_slices_top : slices.family,
|
||||||
|
pointSize: config.font_slices_top_size ? config.font_slices_top_size : slices.pointSize,
|
||||||
|
bold: bool(config.font_slices_top_bold) ? bool(config.font_slices_top_bold) : slices.bold,
|
||||||
|
italic: bool(config.font_slices_top_italic) ? bool(config.font_slices_top_italic) : slices.italic,
|
||||||
|
underline: bool(config.font_slices_top_underline) ? bool(config.font_slices_top_underline) : slices.underline,
|
||||||
|
capitalization: not_null(config.font_slices_top_capitalize) ? bool(config.font_slices_top_capitalize) : slices.capitalization
|
||||||
|
});
|
||||||
|
|
||||||
|
property font slicesBottomLeft: Qt.font({
|
||||||
|
family: config.font_slices_bottom_left ? config.font_slices_bottom_left : slices.family,
|
||||||
|
pointSize: config.font_slices_bottom_left_size ? config.font_slices_bottom_left_size : slices.pointSize,
|
||||||
|
bold: bool(config.font_slices_bottom_left_bold) ? bool(config.font_slices_bottom_left_bold) : slices.bold,
|
||||||
|
italic: bool(config.font_slices_bottom_left_italic) ? bool(config.font_slices_bottom_left_italic) : slices.italic,
|
||||||
|
underline: bool(config.font_slices_bottom_left_underline) ? bool(config.font_slices_bottom_left_underline) : slices.underline,
|
||||||
|
capitalization: not_null(config.font_slices_bottom_left_capitalize) ? bool(config.font_slices_bottom_left_capitalize) : slices.capitalization
|
||||||
|
});
|
||||||
|
|
||||||
|
property font slicesBottomRight: Qt.font({
|
||||||
|
family: config.font_slices_bottom_right ? config.font_slices_bottom_right : slices.family,
|
||||||
|
pointSize: config.font_slices_bottom_right_size ? config.font_slices_bottom_right_size : slices.pointSize,
|
||||||
|
bold: bool(config.font_slices_bottom_right_bold) ? bool(config.font_slices_bottom_right_bold) : slices.bold,
|
||||||
|
italic: bool(config.font_slices_bottom_right_italic) ? bool(config.font_slices_bottom_right_italic) : slices.italic,
|
||||||
|
underline: bool(config.font_slices_bottom_right_underline) ? bool(config.font_slices_bottom_right_underline) : slices.underline,
|
||||||
|
capitalization: not_null(config.font_slices_bottom_right_capitalize) ? bool(config.font_slices_bottom_right_capitalize) : slices.capitalization
|
||||||
|
});
|
||||||
|
|
||||||
|
property font slicesLoginButtons: Qt.font({
|
||||||
|
family: config.font_slices_login_buttons ? config.font_slices_login_buttons : slices.family,
|
||||||
|
pointSize: config.font_slices_login_buttons_size ? config.font_slices_login_buttons_size : slices.pointSize,
|
||||||
|
bold: bool(config.font_slices_login_buttons_bold) ? bool(config.font_slices_login_buttons_bold) : slices.bold,
|
||||||
|
italic: bool(config.font_slices_login_buttons_italic) ? bool(config.font_slices_login_buttons_italic) : slices.italic,
|
||||||
|
underline: bool(config.font_slices_login_buttons_underline) ? bool(config.font_slices_login_buttons_underline) : slices.underline,
|
||||||
|
capitalization: not_null(config.font_slices_login_buttons_capitalize) ? bool(config.font_slices_login_buttons_capitalize) : slices.capitalization
|
||||||
|
});
|
||||||
|
|
||||||
|
// Input group
|
||||||
|
property font input: Qt.font({
|
||||||
|
family: config.font_input ? config.font_input : inputGroup.family,
|
||||||
|
pointSize: config.font_input_size ? config.font_input_size : inputGroup.pointSize,
|
||||||
|
bold: bool(config.font_input_bold) ? bool(config.font_input_bold) : inputGroup.bold,
|
||||||
|
italic: bool(config.font_input_italic) ? bool(config.font_input_italic) : inputGroup.italic,
|
||||||
|
underline: bool(config.font_input_underline) ? bool(config.font_input_underline) : inputGroup.underline,
|
||||||
|
capitalization: not_null(config.font_input_capitalize) ? bool(config.font_input_capitalize) : inputGroup.capitalization
|
||||||
|
});
|
||||||
|
|
||||||
|
property font placeholder: Qt.font({
|
||||||
|
family: config.font_placeholder ? config.font_placeholder : inputGroup.family,
|
||||||
|
pointSize: config.font_placeholder_size ? config.font_placeholder_size : inputGroup.pointSize,
|
||||||
|
bold: bool(config.font_placeholder_bold) ? bool(config.font_placeholder_bold) : inputGroup.bold,
|
||||||
|
italic: bool(config.font_placeholder_italic) ? bool(config.font_placeholder_italic) : inputGroup.italic,
|
||||||
|
underline: bool(config.font_placeholder_underline) ? bool(config.font_placeholder_underline) : inputGroup.underline,
|
||||||
|
capitalization: not_null(config.font_placeholder_capitalize) ? bool(config.font_placeholder_capitalize) : inputGroup.capitalization
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -60,12 +60,7 @@ Item
|
||||||
text: itemRoot.title
|
text: itemRoot.title
|
||||||
color: ( hover ? colors.textHover : colors.text )
|
color: ( hover ? colors.textHover : colors.text )
|
||||||
|
|
||||||
font
|
font: fonts.listItemMed
|
||||||
{
|
|
||||||
family: config.font
|
|
||||||
pointSize: 28
|
|
||||||
bold: true
|
|
||||||
}
|
|
||||||
|
|
||||||
x: 64
|
x: 64
|
||||||
y: 5
|
y: 5
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,7 @@ Item
|
||||||
text: sessionName
|
text: sessionName
|
||||||
color: ( hover ? colors.textHover : colors.text )
|
color: ( hover ? colors.textHover : colors.text )
|
||||||
|
|
||||||
font
|
font: fonts.listItemMed
|
||||||
{
|
|
||||||
family: config.font
|
|
||||||
pointSize: 28
|
|
||||||
bold: true
|
|
||||||
}
|
|
||||||
|
|
||||||
x: parent.x + 10
|
x: parent.x + 10
|
||||||
y: 5
|
y: 5
|
||||||
|
|
|
||||||
|
|
@ -46,12 +46,7 @@ Item
|
||||||
text: userName
|
text: userName
|
||||||
color: ( hoverEnabled && hover ? colors.textHover : colors.text )
|
color: ( hoverEnabled && hover ? colors.textHover : colors.text )
|
||||||
|
|
||||||
font
|
font: fonts.listItemMed
|
||||||
{
|
|
||||||
family: config.font
|
|
||||||
pointSize: 28
|
|
||||||
bold: true
|
|
||||||
}
|
|
||||||
|
|
||||||
x: 80
|
x: 80
|
||||||
y: 0
|
y: 0
|
||||||
|
|
@ -62,12 +57,7 @@ Item
|
||||||
text: userLogin
|
text: userLogin
|
||||||
color: ( hoverEnabled && hover ? (userName == "" ? colors.textHover : colors.textDimmedHover ) : (userName == "" ? colors.text : colors.textDimmed ) )
|
color: ( hoverEnabled && hover ? (userName == "" ? colors.textHover : colors.textDimmedHover ) : (userName == "" ? colors.text : colors.textDimmed ) )
|
||||||
y: userName == "" ? 6 : 36
|
y: userName == "" ? 6 : 36
|
||||||
font
|
font: userName == "" ? fonts.listItemBig : fonts.listItemSub
|
||||||
{
|
|
||||||
family: config.font
|
|
||||||
pointSize: userName == "" ? 36 : 20
|
|
||||||
bold: userName == ""
|
|
||||||
}
|
|
||||||
x: 80
|
x: 80
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,10 @@ Rectangle
|
||||||
return Boolean(Number(str).valueOf()).valueOf();
|
return Boolean(Number(str).valueOf()).valueOf();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function not_null(str) {
|
||||||
|
return !(str === null || str === undefined);
|
||||||
|
}
|
||||||
|
|
||||||
TextConstants { id: localeText }
|
TextConstants { id: localeText }
|
||||||
Debug { id: debug }
|
Debug { id: debug }
|
||||||
|
|
||||||
|
|
@ -106,6 +110,7 @@ Rectangle
|
||||||
}
|
}
|
||||||
|
|
||||||
ColorScheme { id: colors }
|
ColorScheme { id: colors }
|
||||||
|
FontScheme { id: fonts }
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
|
|
@ -127,6 +132,8 @@ Rectangle
|
||||||
enabled: debug.canPowerOff || debug.canReboot || debug.canSuspend || debug.canHibernate || debug.canHybridSleep
|
enabled: debug.canPowerOff || debug.canReboot || debug.canSuspend || debug.canHibernate || debug.canHybridSleep
|
||||||
|
|
||||||
onClicked: if (enabled) root.state = "statePower"
|
onClicked: if (enabled) root.state = "statePower"
|
||||||
|
|
||||||
|
font: fonts.slicesTop
|
||||||
}
|
}
|
||||||
|
|
||||||
SlicedButton
|
SlicedButton
|
||||||
|
|
@ -138,6 +145,8 @@ Rectangle
|
||||||
text: pageSessions.currentSessionName
|
text: pageSessions.currentSessionName
|
||||||
|
|
||||||
onClicked: root.state = "stateSessions"
|
onClicked: root.state = "stateSessions"
|
||||||
|
|
||||||
|
font: fonts.slicesTop
|
||||||
}
|
}
|
||||||
|
|
||||||
SlicedButton
|
SlicedButton
|
||||||
|
|
@ -149,6 +158,8 @@ Rectangle
|
||||||
text: pageUsers.currentUserLogin
|
text: pageUsers.currentUserLogin
|
||||||
|
|
||||||
onClicked: root.state = "stateUsers"
|
onClicked: root.state = "stateUsers"
|
||||||
|
|
||||||
|
font: fonts.slicesTop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -235,6 +246,8 @@ Rectangle
|
||||||
highlighted: keyboard.capsLock
|
highlighted: keyboard.capsLock
|
||||||
|
|
||||||
onClicked: keyboard.capsLock = !keyboard.capsLock
|
onClicked: keyboard.capsLock = !keyboard.capsLock
|
||||||
|
|
||||||
|
font: fonts.slicesBottomLeft
|
||||||
}
|
}
|
||||||
|
|
||||||
SlicedButton
|
SlicedButton
|
||||||
|
|
@ -247,6 +260,8 @@ Rectangle
|
||||||
highlighted: keyboard.numLock
|
highlighted: keyboard.numLock
|
||||||
|
|
||||||
onClicked: keyboard.numLock = !keyboard.numLock
|
onClicked: keyboard.numLock = !keyboard.numLock
|
||||||
|
|
||||||
|
font: fonts.slicesBottomLeft
|
||||||
}
|
}
|
||||||
|
|
||||||
SlicedButton
|
SlicedButton
|
||||||
|
|
@ -256,6 +271,8 @@ Rectangle
|
||||||
y: 5
|
y: 5
|
||||||
|
|
||||||
text: keyboard.layouts[keyboard.currentLayout].longName
|
text: keyboard.layouts[keyboard.currentLayout].longName
|
||||||
|
|
||||||
|
font: fonts.slicesBottomLeft
|
||||||
}
|
}
|
||||||
|
|
||||||
Item
|
Item
|
||||||
|
|
@ -275,6 +292,8 @@ Rectangle
|
||||||
text = new Date().toLocaleString(Qt.locale(),
|
text = new Date().toLocaleString(Qt.locale(),
|
||||||
"dddd")
|
"dddd")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
font: fonts.slicesBottomRight
|
||||||
}
|
}
|
||||||
|
|
||||||
SlicedButton
|
SlicedButton
|
||||||
|
|
@ -288,6 +307,8 @@ Rectangle
|
||||||
text = new Date().toLocaleString(Qt.locale(),
|
text = new Date().toLocaleString(Qt.locale(),
|
||||||
"dd.MM.yyyy")
|
"dd.MM.yyyy")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
font: fonts.slicesBottomRight
|
||||||
}
|
}
|
||||||
|
|
||||||
SlicedButton
|
SlicedButton
|
||||||
|
|
@ -303,6 +324,8 @@ Rectangle
|
||||||
text = new Date().toLocaleString(Qt.locale(),
|
text = new Date().toLocaleString(Qt.locale(),
|
||||||
"hh:mm:ss")
|
"hh:mm:ss")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
font: fonts.slicesBottomRight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -239,12 +239,7 @@ Item
|
||||||
clip: true
|
clip: true
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
|
|
||||||
font
|
font: fonts.input
|
||||||
{
|
|
||||||
family: config.font
|
|
||||||
bold: true
|
|
||||||
pointSize: 18
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: forceActiveFocus()
|
Component.onCompleted: forceActiveFocus()
|
||||||
|
|
||||||
|
|
@ -261,12 +256,7 @@ Item
|
||||||
|
|
||||||
color: colors.inputPlaceholderText
|
color: colors.inputPlaceholderText
|
||||||
|
|
||||||
font
|
font: fonts.placeholder
|
||||||
{
|
|
||||||
family: config.font
|
|
||||||
bold: true
|
|
||||||
pointSize: 18
|
|
||||||
}
|
|
||||||
|
|
||||||
text: localeText.password
|
text: localeText.password
|
||||||
}
|
}
|
||||||
|
|
@ -334,6 +324,8 @@ Item
|
||||||
text: localeText.login
|
text: localeText.login
|
||||||
|
|
||||||
onClicked: select_or_login()
|
onClicked: select_or_login()
|
||||||
|
|
||||||
|
font: fonts.slicesLoginButtons
|
||||||
}
|
}
|
||||||
|
|
||||||
SlicedButton
|
SlicedButton
|
||||||
|
|
@ -347,6 +339,8 @@ Item
|
||||||
text: qsTr("Back")
|
text: qsTr("Back")
|
||||||
|
|
||||||
onClicked: back_to_selection()
|
onClicked: back_to_selection()
|
||||||
|
|
||||||
|
font: fonts.slicesLoginButtons
|
||||||
}
|
}
|
||||||
|
|
||||||
Text
|
Text
|
||||||
|
|
@ -359,12 +353,7 @@ Item
|
||||||
|
|
||||||
color: colors.errorText
|
color: colors.errorText
|
||||||
|
|
||||||
font
|
font: fonts.error
|
||||||
{
|
|
||||||
family: config.font
|
|
||||||
bold: true
|
|
||||||
pointSize: 18
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity { NumberAnimation { duration: userListContainer.scrollDuration } }
|
Behavior on opacity { NumberAnimation { duration: userListContainer.scrollDuration } }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,13 @@ Item
|
||||||
id: buttonRoot
|
id: buttonRoot
|
||||||
height: 25
|
height: 25
|
||||||
|
|
||||||
property real fontSize: 13
|
property font font: Qt.font({
|
||||||
|
family: config.font,
|
||||||
|
bold: true,
|
||||||
|
pointSize: 13,
|
||||||
|
capitalization: Font.AllUppercase
|
||||||
|
});
|
||||||
|
|
||||||
property string text: ""
|
property string text: ""
|
||||||
|
|
||||||
property bool hasLeftSlice: true
|
property bool hasLeftSlice: true
|
||||||
|
|
@ -221,13 +227,7 @@ Item
|
||||||
y: paddingTop
|
y: paddingTop
|
||||||
color: colors.buttonText
|
color: colors.buttonText
|
||||||
|
|
||||||
font
|
font: buttonRoot.font
|
||||||
{
|
|
||||||
family: config.font
|
|
||||||
bold: true
|
|
||||||
pointSize: fontSize
|
|
||||||
capitalization: Font.AllUppercase
|
|
||||||
}
|
|
||||||
|
|
||||||
text: ""
|
text: ""
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue