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
|
||||
color: ( hover ? colors.textHover : colors.text )
|
||||
|
||||
font
|
||||
{
|
||||
family: config.font
|
||||
pointSize: 28
|
||||
bold: true
|
||||
}
|
||||
font: fonts.listItemMed
|
||||
|
||||
x: 64
|
||||
y: 5
|
||||
|
|
|
|||
|
|
@ -19,12 +19,7 @@ Item
|
|||
text: sessionName
|
||||
color: ( hover ? colors.textHover : colors.text )
|
||||
|
||||
font
|
||||
{
|
||||
family: config.font
|
||||
pointSize: 28
|
||||
bold: true
|
||||
}
|
||||
font: fonts.listItemMed
|
||||
|
||||
x: parent.x + 10
|
||||
y: 5
|
||||
|
|
|
|||
|
|
@ -46,12 +46,7 @@ Item
|
|||
text: userName
|
||||
color: ( hoverEnabled && hover ? colors.textHover : colors.text )
|
||||
|
||||
font
|
||||
{
|
||||
family: config.font
|
||||
pointSize: 28
|
||||
bold: true
|
||||
}
|
||||
font: fonts.listItemMed
|
||||
|
||||
x: 80
|
||||
y: 0
|
||||
|
|
@ -62,12 +57,7 @@ Item
|
|||
text: userLogin
|
||||
color: ( hoverEnabled && hover ? (userName == "" ? colors.textHover : colors.textDimmedHover ) : (userName == "" ? colors.text : colors.textDimmed ) )
|
||||
y: userName == "" ? 6 : 36
|
||||
font
|
||||
{
|
||||
family: config.font
|
||||
pointSize: userName == "" ? 36 : 20
|
||||
bold: userName == ""
|
||||
}
|
||||
font: userName == "" ? fonts.listItemBig : fonts.listItemSub
|
||||
x: 80
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,10 @@ Rectangle
|
|||
return Boolean(Number(str).valueOf()).valueOf();
|
||||
}
|
||||
|
||||
function not_null(str) {
|
||||
return !(str === null || str === undefined);
|
||||
}
|
||||
|
||||
TextConstants { id: localeText }
|
||||
Debug { id: debug }
|
||||
|
||||
|
|
@ -106,6 +110,7 @@ Rectangle
|
|||
}
|
||||
|
||||
ColorScheme { id: colors }
|
||||
FontScheme { id: fonts }
|
||||
|
||||
Item
|
||||
{
|
||||
|
|
@ -127,6 +132,8 @@ Rectangle
|
|||
enabled: debug.canPowerOff || debug.canReboot || debug.canSuspend || debug.canHibernate || debug.canHybridSleep
|
||||
|
||||
onClicked: if (enabled) root.state = "statePower"
|
||||
|
||||
font: fonts.slicesTop
|
||||
}
|
||||
|
||||
SlicedButton
|
||||
|
|
@ -138,6 +145,8 @@ Rectangle
|
|||
text: pageSessions.currentSessionName
|
||||
|
||||
onClicked: root.state = "stateSessions"
|
||||
|
||||
font: fonts.slicesTop
|
||||
}
|
||||
|
||||
SlicedButton
|
||||
|
|
@ -149,6 +158,8 @@ Rectangle
|
|||
text: pageUsers.currentUserLogin
|
||||
|
||||
onClicked: root.state = "stateUsers"
|
||||
|
||||
font: fonts.slicesTop
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -235,6 +246,8 @@ Rectangle
|
|||
highlighted: keyboard.capsLock
|
||||
|
||||
onClicked: keyboard.capsLock = !keyboard.capsLock
|
||||
|
||||
font: fonts.slicesBottomLeft
|
||||
}
|
||||
|
||||
SlicedButton
|
||||
|
|
@ -247,6 +260,8 @@ Rectangle
|
|||
highlighted: keyboard.numLock
|
||||
|
||||
onClicked: keyboard.numLock = !keyboard.numLock
|
||||
|
||||
font: fonts.slicesBottomLeft
|
||||
}
|
||||
|
||||
SlicedButton
|
||||
|
|
@ -256,6 +271,8 @@ Rectangle
|
|||
y: 5
|
||||
|
||||
text: keyboard.layouts[keyboard.currentLayout].longName
|
||||
|
||||
font: fonts.slicesBottomLeft
|
||||
}
|
||||
|
||||
Item
|
||||
|
|
@ -275,6 +292,8 @@ Rectangle
|
|||
text = new Date().toLocaleString(Qt.locale(),
|
||||
"dddd")
|
||||
}
|
||||
|
||||
font: fonts.slicesBottomRight
|
||||
}
|
||||
|
||||
SlicedButton
|
||||
|
|
@ -288,6 +307,8 @@ Rectangle
|
|||
text = new Date().toLocaleString(Qt.locale(),
|
||||
"dd.MM.yyyy")
|
||||
}
|
||||
|
||||
font: fonts.slicesBottomRight
|
||||
}
|
||||
|
||||
SlicedButton
|
||||
|
|
@ -303,6 +324,8 @@ Rectangle
|
|||
text = new Date().toLocaleString(Qt.locale(),
|
||||
"hh:mm:ss")
|
||||
}
|
||||
|
||||
font: fonts.slicesBottomRight
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -239,12 +239,7 @@ Item
|
|||
clip: true
|
||||
selectByMouse: true
|
||||
|
||||
font
|
||||
{
|
||||
family: config.font
|
||||
bold: true
|
||||
pointSize: 18
|
||||
}
|
||||
font: fonts.input
|
||||
|
||||
Component.onCompleted: forceActiveFocus()
|
||||
|
||||
|
|
@ -261,12 +256,7 @@ Item
|
|||
|
||||
color: colors.inputPlaceholderText
|
||||
|
||||
font
|
||||
{
|
||||
family: config.font
|
||||
bold: true
|
||||
pointSize: 18
|
||||
}
|
||||
font: fonts.placeholder
|
||||
|
||||
text: localeText.password
|
||||
}
|
||||
|
|
@ -334,6 +324,8 @@ Item
|
|||
text: localeText.login
|
||||
|
||||
onClicked: select_or_login()
|
||||
|
||||
font: fonts.slicesLoginButtons
|
||||
}
|
||||
|
||||
SlicedButton
|
||||
|
|
@ -347,6 +339,8 @@ Item
|
|||
text: qsTr("Back")
|
||||
|
||||
onClicked: back_to_selection()
|
||||
|
||||
font: fonts.slicesLoginButtons
|
||||
}
|
||||
|
||||
Text
|
||||
|
|
@ -359,12 +353,7 @@ Item
|
|||
|
||||
color: colors.errorText
|
||||
|
||||
font
|
||||
{
|
||||
family: config.font
|
||||
bold: true
|
||||
pointSize: 18
|
||||
}
|
||||
font: fonts.error
|
||||
|
||||
Behavior on opacity { NumberAnimation { duration: userListContainer.scrollDuration } }
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,13 @@ Item
|
|||
id: buttonRoot
|
||||
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 bool hasLeftSlice: true
|
||||
|
|
@ -221,13 +227,7 @@ Item
|
|||
y: paddingTop
|
||||
color: colors.buttonText
|
||||
|
||||
font
|
||||
{
|
||||
family: config.font
|
||||
bold: true
|
||||
pointSize: fontSize
|
||||
capitalization: Font.AllUppercase
|
||||
}
|
||||
font: buttonRoot.font
|
||||
|
||||
text: ""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue