Skip to content

Commit

Permalink
Update UI components
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Sep 21, 2022
1 parent 158a262 commit d28e7c3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion qml/MainView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Item {
ButtonWireframeIcon {
fullColor: true
primaryColor: Theme.colorActionbarHighlight
text: "Action 2"
text: "Enable components"

onClicked: flflfl.enabled = !flflfl.enabled
}
Expand Down
5 changes: 3 additions & 2 deletions qml/components_generic/AndroidTextField.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import ThemeEngine 1.0
T.TextField {
id: control


implicitWidth: implicitBackgroundWidth + leftInset + rightInset
|| Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
Expand All @@ -17,8 +16,10 @@ T.TextField {
padding: 12
leftPadding: padding + 4

text: ""
color: colorText
opacity: 1

text: ""
font.pixelSize: Theme.fontSizeComponent
verticalAlignment: Text.AlignVCenter

Expand Down
8 changes: 6 additions & 2 deletions qml/components_generic/ButtonText.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ T.Button {
implicitHeight: Theme.componentHeight

radius: 2
opacity: (control.hovered && !control.highlighted) ? 0.3 : 1
opacity: {
if (!control.enabled) return 0.4
if (control.hovered && !control.highlighted) return 0.3
return 1
}
color: {
if (control.highlighted) return control.colorHighlighted
if (control.hovered) return control.colorHovered
Expand All @@ -45,7 +49,7 @@ T.Button {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter

opacity: 1
opacity: control.enabled ? 1 : 0.66
color: control.highlighted ? "white" : Theme.colorText
}
}
2 changes: 2 additions & 0 deletions qml/components_generic/SelectorMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Item {
id: selectorMenu
implicitWidth: 128
implicitHeight: 32

width: contentRow.width
opacity: enabled ? 1 : 0.4

signal menuSelected(var index)
property int currentSelection: 1
Expand Down
4 changes: 3 additions & 1 deletion qml/components_themed/TextFieldThemed.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ T.TextField {
padding: 8
leftPadding: padding + 4

text: ""
color: colorText
opacity: control.enabled ? 1 : 0.66

text: ""
font.pixelSize: Theme.fontSizeComponent
verticalAlignment: TextInput.AlignVCenter

Expand Down
2 changes: 1 addition & 1 deletion qml/components_themed/TumblerThemed.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Tumbler {
verticalAlignment: Text.AlignVCenter

color: (control.currentIndex === modelData) ? Theme.colorPrimary : Theme.colorText
opacity: 1.0 - (Math.abs(Tumbler.displacement) / (control.visibleItemCount * 0.55))
opacity: (control.enabled ? 1.0 : 0.8) - (Math.abs(Tumbler.displacement) / (control.visibleItemCount * 0.55))
font.pixelSize: (control.currentIndex === modelData) ? Theme.fontSizeComponent+2 : Theme.fontSizeComponent
font.bold: false
}
Expand Down

0 comments on commit d28e7c3

Please sign in to comment.