Added responsiveness for user select and login
This commit is contained in:
parent
b8aff863c8
commit
27b3e95d97
3 changed files with 98 additions and 108 deletions
|
|
@ -51,7 +51,7 @@ Item
|
|||
|
||||
property font slices: Qt.font({
|
||||
family: config.font_slices ? config.font_slices : config.font,
|
||||
pointSize: config.font_slices_size ? config.font_slices_size : 13,
|
||||
pointSize: config.font_slices_size ? Number(config.font_slices_size) : 13,
|
||||
bold: not_null(config.font_slices_bold) ? bool(config.font_slices_bold) : true,
|
||||
italic: not_null(config.font_slices_italic) ? bool(config.font_slices_italic) : false,
|
||||
underline: not_null(config.font_slices_underline) ? bool(config.font_slices_underline) : false,
|
||||
|
|
@ -60,7 +60,7 @@ Item
|
|||
|
||||
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,
|
||||
pointSize: config.font_input_group_size ? Number(config.font_input_group_size) : 18,
|
||||
bold: not_null(config.font_input_group_bold) ? bool(config.font_input_group_bold) : false,
|
||||
italic: not_null(config.font_input_group_italic) ? bool(config.font_input_group_italic) : false,
|
||||
underline: not_null(config.font_input_group_underline) ? bool(config.font_input_group_underline) : false,
|
||||
|
|
@ -69,7 +69,7 @@ Item
|
|||
|
||||
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,
|
||||
pointSize: config.font_list_item_big_size ? Number(config.font_list_item_big_size) : 36,
|
||||
bold: not_null(config.font_list_item_big_bold) ? bool(config.font_list_item_big_bold) : true,
|
||||
italic: not_null(config.font_list_item_big_italic) ? bool(config.font_list_item_big_italic) : false,
|
||||
underline: not_null(config.font_list_item_big_underline) ? bool(config.font_list_item_big_underline) : false,
|
||||
|
|
@ -78,7 +78,7 @@ Item
|
|||
|
||||
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,
|
||||
pointSize: config.font_list_item_med_size ? Number(config.font_list_item_med_size) : 28,
|
||||
bold: not_null(config.font_list_item_med_bold) ? bool(config.font_list_item_med_bold) : true,
|
||||
italic: not_null(config.font_list_item_med_italic) ? bool(config.font_list_item_med_italic) : false,
|
||||
underline: not_null(config.font_list_item_med_underline) ? bool(config.font_list_item_med_underline) : false,
|
||||
|
|
@ -87,7 +87,7 @@ Item
|
|||
|
||||
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,
|
||||
pointSize: config.font_list_item_sub_size ? Number(config.font_list_item_sub_size) : 20,
|
||||
bold: not_null(config.font_list_item_sub_bold) ? bool(config.font_list_item_sub_bold) : false,
|
||||
italic: not_null(config.font_list_item_sub_italic) ? bool(config.font_list_item_sub_italic) : false,
|
||||
underline: not_null(config.font_list_item_sub_underline) ? bool(config.font_list_item_sub_underline) : false,
|
||||
|
|
@ -96,7 +96,7 @@ Item
|
|||
|
||||
property font error: Qt.font({
|
||||
family: config.font_error ? config.font_error : config.font,
|
||||
pointSize: config.font_error_size ? config.font_error_size : 18,
|
||||
pointSize: config.font_error_size ? Number(config.font_error_size) : 18,
|
||||
bold: not_null(config.font_error_bold) ? bool(config.font_error_bold) : true,
|
||||
italic: not_null(config.font_error_italic) ? bool(config.font_error_italic) : false,
|
||||
underline: not_null(config.font_error_underline) ? bool(config.font_error_underline) : false,
|
||||
|
|
@ -113,7 +113,7 @@ Item
|
|||
// 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,
|
||||
pointSize: config.font_slices_top_size ? Number(config.font_slices_top_size) : slices.pointSize,
|
||||
bold: not_null(config.font_slices_top_bold) ? bool(config.font_slices_top_bold) : slices.bold,
|
||||
italic: not_null(config.font_slices_top_italic) ? bool(config.font_slices_top_italic) : slices.italic,
|
||||
underline: not_null(config.font_slices_top_underline) ? bool(config.font_slices_top_underline) : slices.underline,
|
||||
|
|
@ -122,7 +122,7 @@ Item
|
|||
|
||||
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,
|
||||
pointSize: config.font_slices_bottom_left_size ? Number(config.font_slices_bottom_left_size) : slices.pointSize,
|
||||
bold: not_null(config.font_slices_bottom_left_bold) ? bool(config.font_slices_bottom_left_bold) : slices.bold,
|
||||
italic: not_null(config.font_slices_bottom_left_italic) ? bool(config.font_slices_bottom_left_italic) : slices.italic,
|
||||
underline: not_null(config.font_slices_bottom_left_underline) ? bool(config.font_slices_bottom_left_underline) : slices.underline,
|
||||
|
|
@ -131,7 +131,7 @@ Item
|
|||
|
||||
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,
|
||||
pointSize: config.font_slices_bottom_right_size ? Number(config.font_slices_bottom_right_size) : slices.pointSize,
|
||||
bold: not_null(config.font_slices_bottom_right_bold) ? bool(config.font_slices_bottom_right_bold) : slices.bold,
|
||||
italic: not_null(config.font_slices_bottom_right_italic) ? bool(config.font_slices_bottom_right_italic) : slices.italic,
|
||||
underline: not_null(config.font_slices_bottom_right_underline) ? bool(config.font_slices_bottom_right_underline) : slices.underline,
|
||||
|
|
@ -140,7 +140,7 @@ Item
|
|||
|
||||
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,
|
||||
pointSize: config.font_slices_login_buttons_size ? Number(config.font_slices_login_buttons_size) : slices.pointSize,
|
||||
bold: not_null(config.font_slices_login_buttons_bold) ? bool(config.font_slices_login_buttons_bold) : slices.bold,
|
||||
italic: not_null(config.font_slices_login_buttons_italic) ? bool(config.font_slices_login_buttons_italic) : slices.italic,
|
||||
underline: not_null(config.font_slices_login_buttons_underline) ? bool(config.font_slices_login_buttons_underline) : slices.underline,
|
||||
|
|
@ -150,7 +150,7 @@ Item
|
|||
// 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,
|
||||
pointSize: config.font_input_size ? Number(config.font_input_size) : inputGroup.pointSize,
|
||||
bold: not_null(config.font_input_bold) ? bool(config.font_input_bold) : inputGroup.bold,
|
||||
italic: not_null(config.font_input_italic) ? bool(config.font_input_italic) : inputGroup.italic,
|
||||
underline: not_null(config.font_input_underline) ? bool(config.font_input_underline) : inputGroup.underline,
|
||||
|
|
@ -159,7 +159,7 @@ Item
|
|||
|
||||
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,
|
||||
pointSize: config.font_placeholder_size ? Number(config.font_placeholder_size) : inputGroup.pointSize,
|
||||
bold: not_null(config.font_placeholder_bold) ? bool(config.font_placeholder_bold) : inputGroup.bold,
|
||||
italic: not_null(config.font_placeholder_italic) ? bool(config.font_placeholder_italic) : inputGroup.italic,
|
||||
underline: not_null(config.font_placeholder_underline) ? bool(config.font_placeholder_underline) : inputGroup.underline,
|
||||
|
|
|
|||
|
|
@ -7,13 +7,14 @@ Item
|
|||
id: itemRoot
|
||||
opacity: distance
|
||||
width: parent.width
|
||||
height: userName == "" ? userLoginText.height + 14 : userNameText.height + userLoginText.height - 4
|
||||
|
||||
property bool hover: false
|
||||
property bool hoverEnabled: true
|
||||
|
||||
transform: Scale
|
||||
{
|
||||
origin.x: 80
|
||||
origin.x: itemRoot.height + 12
|
||||
xScale: distance
|
||||
yScale: distance
|
||||
}
|
||||
|
|
@ -27,46 +28,48 @@ Item
|
|||
{
|
||||
id: profilePicture
|
||||
source: userAvatar
|
||||
sourceSize.width: 60
|
||||
sourceSize.height: 60
|
||||
sourceSize.width: itemRoot.height - 8
|
||||
sourceSize.height: itemRoot.height - 8
|
||||
x: 4
|
||||
y: 4
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
width: 68
|
||||
height: 68
|
||||
width: itemRoot.height
|
||||
height: itemRoot.height
|
||||
color: ( hoverEnabled && hover ? colors.iconBgHover : colors.iconBg )
|
||||
}
|
||||
|
||||
|
||||
Text
|
||||
{
|
||||
id: userNameText
|
||||
text: userName
|
||||
color: ( hoverEnabled && hover ? colors.textHover : colors.text )
|
||||
|
||||
font: fonts.listItemMed
|
||||
|
||||
x: 80
|
||||
x: itemRoot.height + 12
|
||||
y: 0
|
||||
}
|
||||
|
||||
Text
|
||||
{
|
||||
id: userLoginText
|
||||
text: userLogin
|
||||
color: ( hoverEnabled && hover ? (userName == "" ? colors.textHover : colors.textDimmedHover ) : (userName == "" ? colors.text : colors.textDimmed ) )
|
||||
y: userName == "" ? 6 : 36
|
||||
y: userName == "" ? 7 : userNameText.height * 0.8
|
||||
font: userName == "" ? fonts.listItemBig : fonts.listItemSub
|
||||
x: 80
|
||||
x: itemRoot.height + 12
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
x: 70
|
||||
x: itemRoot.height + 2
|
||||
y: 0
|
||||
width: parent.width - 70
|
||||
height: 68
|
||||
width: parent.width - itemRoot.height - 2
|
||||
height: itemRoot.height
|
||||
color: ( hoverEnabled && hover ? colors.textBgHover : colors.textBg )
|
||||
}
|
||||
}
|
||||
|
|
@ -187,7 +187,7 @@ Item
|
|||
LoopListUserItem
|
||||
{
|
||||
id: middleItem
|
||||
y: hasLoginShown ? pageRoot.height / 2.3 - 40 : pageRoot.height / 2.3
|
||||
y: hasLoginShown ? pageRoot.height / 2.3 - (middleItem.height / 2 + passwordFieldBg.height + progressBar.height + 2 + buttonUserLogin.height) / 2 : pageRoot.height / 2.3
|
||||
userName: get_name(0)
|
||||
userLogin: get_login(0)
|
||||
userAvatar: get_avatar(0)
|
||||
|
|
@ -227,9 +227,8 @@ Item
|
|||
{
|
||||
id: passwordField
|
||||
x: 10
|
||||
y: hasLoginShown ? pageRoot.height / 2.3 + 37 : pageRoot.height / 2.3 + 62
|
||||
y: (passwordFieldBg.height - height) / 2 + passwordFieldBg.y
|
||||
width: parent.width - 20
|
||||
height: 25
|
||||
opacity: hasLoginShown ? 1 : 0
|
||||
color: colors.inputText
|
||||
selectionColor: colors.inputSelectionBg
|
||||
|
|
@ -249,7 +248,7 @@ Item
|
|||
{
|
||||
id: passwordFieldPlaceholder
|
||||
x: passwordField.x
|
||||
y: passwordField.y
|
||||
y: (passwordFieldBg.height - height) / 2 + passwordFieldBg.y
|
||||
width: passwordField.width
|
||||
opacity: hasLoginShown ? 1 : 0
|
||||
visible: passwordField.text.length <= 0
|
||||
|
|
@ -263,9 +262,9 @@ Item
|
|||
|
||||
Rectangle {
|
||||
id: passwordFieldBg
|
||||
y: hasLoginShown ? pageRoot.height / 2.3 + 30 : pageRoot.height / 2.3 + 55
|
||||
y: middleItem.y + middleItem.height + 2
|
||||
width: parent.width
|
||||
height: 40
|
||||
height: Math.max(fonts.input.pointSize, fonts.placeholder.pointSize) + 20
|
||||
opacity: hasLoginShown ? 1 : 0
|
||||
color: colors.inputBg
|
||||
}
|
||||
|
|
@ -273,7 +272,7 @@ Item
|
|||
Rectangle
|
||||
{
|
||||
id: progressBar
|
||||
y: hasLoginShown ? pageRoot.height / 2.3 + 70 : pageRoot.height / 2.3 + 105
|
||||
y: passwordFieldBg.y + passwordFieldBg.height
|
||||
width: parent.width
|
||||
height: 2
|
||||
opacity: hasLoginShown ? 1 : 0
|
||||
|
|
@ -316,7 +315,7 @@ Item
|
|||
{
|
||||
id: buttonUserLogin
|
||||
x: userListContainer.width - widthFull
|
||||
y: hasLoginShown ? pageRoot.height / 2.3 + 74 : pageRoot.height / 2.3 + 109
|
||||
y: progressBar.y + progressBar.height + 2
|
||||
paddingTop: 2
|
||||
highlighted: true
|
||||
opacity: hasLoginShown ? 1 : 0
|
||||
|
|
@ -332,7 +331,7 @@ Item
|
|||
{
|
||||
id: buttonUserBack
|
||||
x: userListContainer.width - widthFull - buttonUserLogin.widthPartial - 3
|
||||
y: hasLoginShown ? pageRoot.height / 2.3 + 74 : pageRoot.height / 2.3 + 109
|
||||
y: buttonUserLogin.y
|
||||
paddingTop: 2
|
||||
opacity: hasLoginShown ? 1 : 0
|
||||
|
||||
|
|
@ -417,7 +416,7 @@ Item
|
|||
NumberAnimation { target: botMidItem; property: "distance"; to: 0; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: botFarItem; property: "distance"; to: 0; duration: userListContainer.scrollDuration }
|
||||
|
||||
NumberAnimation { target: middleItem; property: "y"; to: pageRoot.height / 2.3 - 40; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: middleItem; property: "y"; to: pageRoot.height / 2.3 - (middleItem.height / 2 + passwordFieldBg.height + progressBar.height + 2 + buttonUserLogin.height) / 2; duration: userListContainer.scrollDuration }
|
||||
|
||||
NumberAnimation { target: passwordField; property: "opacity"; to: 1; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: passwordFieldPlaceholder; property: "opacity"; to: 1; duration: userListContainer.scrollDuration }
|
||||
|
|
@ -426,12 +425,6 @@ Item
|
|||
NumberAnimation { target: buttonUserBack; property: "opacity"; to: 1; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: buttonUserLogin; property: "opacity"; to: 1; duration: userListContainer.scrollDuration }
|
||||
|
||||
NumberAnimation { target: passwordField; property: "y"; to: pageRoot.height / 2.3 + 37; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: passwordFieldBg; property: "y"; to: pageRoot.height / 2.3 + 30; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: progressBar; property: "y"; to: pageRoot.height / 2.3 + 70; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: buttonUserBack; property: "y"; to: pageRoot.height / 2.3 + 74; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: buttonUserLogin; property: "y"; to: pageRoot.height / 2.3 + 74; duration: userListContainer.scrollDuration }
|
||||
|
||||
onStopped:
|
||||
{
|
||||
hasLoginShown = true
|
||||
|
|
@ -456,12 +449,6 @@ Item
|
|||
NumberAnimation { target: buttonUserBack; property: "opacity"; to: 0; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: buttonUserLogin; property: "opacity"; to: 0; duration: userListContainer.scrollDuration }
|
||||
|
||||
NumberAnimation { target: passwordField; property: "y"; to: pageRoot.height / 2.3 + 62; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: passwordFieldBg; property: "y"; to: pageRoot.height / 2.3 + 55; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: progressBar; property: "y"; to: pageRoot.height / 2.3 + 105; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: buttonUserBack; property: "y"; to: pageRoot.height / 2.3 + 109; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: buttonUserLogin; property: "y"; to: pageRoot.height / 2.3 + 109; duration: userListContainer.scrollDuration }
|
||||
|
||||
onStopped:
|
||||
{
|
||||
hasLoginShown = false
|
||||
|
|
@ -550,7 +537,7 @@ Item
|
|||
id: loginEnterAnimation
|
||||
NumberAnimation { target: passwordField; property: "opacity"; to: 0; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: passwordFieldBg; property: "height"; to: 0; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: passwordFieldBg; property: "y"; to: pageRoot.height / 2.3 + 70; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: passwordFieldBg; property: "y"; to: pageRoot.height / 2.3 - (middleItem.height / 2 + progressBar.height + 2) / 2; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: passwordFieldPlaceholder; property: "opacity"; to: 0; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: buttonUserBack; property: "opacity"; to: 0; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: buttonUserLogin; property: "opacity"; to: 0; duration: userListContainer.scrollDuration }
|
||||
|
|
@ -567,7 +554,7 @@ Item
|
|||
id: loginExitAnimation
|
||||
NumberAnimation { target: passwordField; property: "opacity"; to: 1; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: passwordFieldBg; property: "height"; to: 40; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: passwordFieldBg; property: "y"; to: pageRoot.height / 2.3 + 30; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: passwordFieldBg; property: "y"; to: pageRoot.height / 2.3 - (middleItem.height / 2 + passwordFieldBg.height + progressBar.height + 2 + buttonUserLogin.height) / 2; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: passwordFieldPlaceholder; property: "opacity"; to: 1; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: buttonUserBack; property: "opacity"; to: 1; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: buttonUserLogin; property: "opacity"; to: 1; duration: userListContainer.scrollDuration }
|
||||
|
|
@ -575,7 +562,7 @@ Item
|
|||
NumberAnimation { target: progressBarSlider1; property: "opacity"; to: 0; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: progressBarSlider2; property: "opacity"; to: 0; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: progressBarBg; property: "opacity"; to: 0; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: middleItem; property: "y"; to: pageRoot.height / 2.3 - 40; duration: userListContainer.scrollDuration }
|
||||
NumberAnimation { target: middleItem; property: "y"; to: pageRoot.height / 2.3 - (middleItem.height / 2 + passwordFieldBg.height + progressBar.height + 2 + buttonUserLogin.height) / 2; duration: userListContainer.scrollDuration }
|
||||
|
||||
onStopped:
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue