Skip to content

Commit

Permalink
Update UI
Browse files Browse the repository at this point in the history
  • Loading branch information
vicr123 committed Mar 28, 2024
1 parent 07879b3 commit c645278
Show file tree
Hide file tree
Showing 5 changed files with 222 additions and 91 deletions.
2 changes: 1 addition & 1 deletion controls/com/vicr123/Contemporary/CoreStyles/Tumbler.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ T.Tumbler {

delegate: Text {
text: modelData
color: Contemporary.foreground
color: control.enabled ? Contemporary.foreground : Contemporary.disabled(Contemporary.foreground)
font: control.font
opacity: 1.0 - Math.abs(Tumbler.displacement) / (control.visibleItemCount / 2)
horizontalAlignment: Text.AlignHCenter
Expand Down
158 changes: 95 additions & 63 deletions playground/components/CheckboxesRadioButtons.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,87 +21,119 @@ Control {
color: Contemporary.calculateLayer(2).value
}

RowLayout {
ColumnLayout {
anchors.top: grandstand.bottom
anchors.topMargin: 6
anchors.left: parent.left
anchors.right: parent.right
anchors.bottomMargin: SafeZone.bottom
anchors.topMargin: 6

ColumnLayout {
CheckBox {
text: qsTr("Off")
GroupBox {
title: qsTr("Checkboxes")
implicitWidth: Math.min(600, parent.width - 12)

Layout.alignment: Qt.AlignHCenter | Qt.AlignTop

Grid {
anchors.fill: parent
columns: 3

CheckBox {
text: qsTr("Off")
}

CheckBox {
checked: true
text: qsTr("On")
}

CheckBox {
checkState: Qt.PartiallyChecked
tristate: true
text: qsTr("Indeterminate")
}

CheckBox {
enabled: false
text: qsTr("Disabled Off")
}

CheckBox {
enabled: false
checked: true
text: qsTr("Disabled On")
}

CheckBox {
checkState: Qt.PartiallyChecked
tristate: true
enabled: false
text: qsTr("Disabled Indeterminate")
}
}
}

CheckBox {
checked: true
text: qsTr("On")
}
GroupBox {
title: qsTr("Radio Buttons")
implicitWidth: Math.min(600, parent.width - 12)

CheckBox {
enabled: false
text: qsTr("Disabled Off")
}
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop

CheckBox {
enabled: false
checked: true
text: qsTr("Disabled On")
}
Grid {
anchors.fill: parent
columns: 2

CheckBox {
checkState: Qt.PartiallyChecked
tristate: true
text: qsTr("Indeterminate")
}
RadioButton {
text: qsTr("Off")
}

CheckBox {
checkState: Qt.PartiallyChecked
tristate: true
enabled: false
text: qsTr("Disabled Indeterminate")
}
}
RadioButton {
checked: true
text: qsTr("On")
}

ColumnLayout {
Switch {
text: qsTr("Off")
}
RadioButton {
enabled: false
text: qsTr("Disabled Off")
}

Switch {
checked: true
text: qsTr("On")
RadioButton {
enabled: false
checked: true
text: qsTr("Disabled On")
}
}
}

Switch {
enabled: false
text: qsTr("Disabled Off")
}
GroupBox {
title: qsTr("Switches")
implicitWidth: Math.min(600, parent.width - 12)

Switch {
enabled: false
checked: true
text: qsTr("Disabled On")
}
}
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop

ColumnLayout {
RadioButton {
text: qsTr("Off")
}
Grid {
anchors.fill: parent
columns: 2

RadioButton {
checked: true
text: qsTr("On")
}
Switch {
text: qsTr("Off")
}

RadioButton {
enabled: false
text: qsTr("Disabled Off")
}
Switch {
checked: true
text: qsTr("On")
}

Switch {
enabled: false
text: qsTr("Disabled Off")
}

RadioButton {
enabled: false
checked: true
text: qsTr("Disabled On")
Switch {
enabled: false
checked: true
text: qsTr("Disabled On")
}
}
}
}
Expand Down
49 changes: 44 additions & 5 deletions playground/components/TextInput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,55 @@ Control {

ColumnLayout {
anchors.top: grandstand.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottomMargin: SafeZone.bottom
anchors.topMargin: 6

TextField {
placeholderText: qsTr("Text Field")
GroupBox {
title: qsTr("Text Fields")
implicitWidth: Math.min(600, parent.width - 12)

Layout.alignment: Qt.AlignHCenter | Qt.AlignTop

ColumnLayout {
anchors.fill: parent

TextField {
Layout.fillWidth: true
placeholderText: qsTr("Text Field")
}

TextField {
Layout.fillWidth: true
enabled: false
placeholderText: qsTr("Disabled")
}
}
}

TextField {
enabled: false
placeholderText: qsTr("Disabled")
GroupBox {
title: qsTr("Text Areas")
implicitWidth: Math.min(600, parent.width - 12)

Layout.alignment: Qt.AlignHCenter | Qt.AlignTop

ColumnLayout {
anchors.fill: parent

TextArea {
Layout.fillWidth: true
Layout.preferredHeight: 100
placeholderText: qsTr("Text Area")
}

TextArea {
Layout.fillWidth: true
Layout.preferredHeight: 100
enabled: false
placeholderText: qsTr("Disabled")
}
}
}
}
}
35 changes: 28 additions & 7 deletions playground/components/TumblerPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,39 @@ Control {
color: Contemporary.calculateLayer(2).value
}

RowLayout {
ColumnLayout {
anchors.top: grandstand.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottomMargin: SafeZone.bottom
anchors.topMargin: 6

Tumbler {
model: 100
}
GroupBox {
title: qsTr("Tumblers")
implicitWidth: Math.min(600, parent.width - 12)

Layout.alignment: Qt.AlignHCenter | Qt.AlignTop

RowLayout {
anchors.fill: parent

Item {
Layout.fillWidth: true
}

Tumbler {
model: 100
}

Tumbler {
enabled: false
model: 100
}

Tumbler {
enabled: false
model: 100
Item {
Layout.fillWidth: true
}
}
}
}
}
Loading

0 comments on commit c645278

Please sign in to comment.