Skip to content

Commit

Permalink
Update QML components
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Oct 9, 2023
1 parent f74ae01 commit 2c4ec88
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 31 deletions.
2 changes: 1 addition & 1 deletion qml/PageDialogs.qml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Flickable {

PopupTime {
id: popupTime
onUpdateTime: (newtime) => { savethedate = newtime }
//onUpdateTime: (newtime) => { savethedate = newtime }
}

onClicked: popupTime.openTime(savethedate)
Expand Down
89 changes: 63 additions & 26 deletions qml/PageSelectors.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,75 +28,112 @@ Flickable {
icon: ""
}

ListModel {
id: lmSelectorMenuTxt
ListElement { idx: 1; txt: "4/3"; src: ""; sz: 0; }
ListElement { idx: 2; txt: "16/9"; src: ""; sz: 0; }
ListElement { idx: 3; txt: "21/9"; src: ""; sz: 0; }
}
ListModel {
id: lmSelectorMenuImg
ListElement { idx: 1; src: "qrc:/assets/icons_material/baseline-accessibility-24px.svg"; sz: 20; }
ListElement { idx: 2; src: "qrc:/assets/icons_material/baseline-accessibility-24px.svg"; sz: 26; }
ListElement { idx: 3; src: "qrc:/assets/icons_material/baseline-accessibility-24px.svg"; sz: 32; }
}
ListModel {
id: lmSelectorMenuImgTxt
ListElement { idx: 1; txt: "4/3"; src: "qrc:/assets/icons_material/baseline-accessibility-24px.svg"; sz: 20; }
ListElement { idx: 2; txt: "16/9"; src: "qrc:/assets/icons_material/baseline-accessibility-24px.svg"; sz: 26; }
ListElement { idx: 3; txt: "21/9"; src: "qrc:/assets/icons_material/baseline-accessibility-24px.svg"; sz: 32; }
}

////

SelectorMenuThemed {
anchors.horizontalCenter: parent.horizontalCenter
height: 40
height: 32

currentSelection: 1
model: ListModel {
id: lmSelectorMenuImg1
ListElement { idx: 1; src: "qrc:/assets/icons_material/baseline-accessibility-24px.svg"; sz: 20; }
ListElement { idx: 2; src: "qrc:/assets/icons_material/baseline-accessibility-24px.svg"; sz: 26; }
ListElement { idx: 3; src: "qrc:/assets/icons_material/baseline-accessibility-24px.svg"; sz: 32; }
}
model: lmSelectorMenuTxt

onMenuSelected: (index) => {
//console.log("SelectorMenu clicked #" + index)
currentSelection = index
}
}

////

SelectorMenuThemed {
anchors.horizontalCenter: parent.horizontalCenter
height: 32
height: 40

currentSelection: 1
model: ListModel {
id: lmSelectorMenuTxt1
ListElement { idx: 1; txt: "4/3"; src: ""; sz: 0; }
ListElement { idx: 2; txt: "16/9"; src: ""; sz: 0; }
ListElement { idx: 3; txt: "21/9"; src: ""; sz: 0; }
model: lmSelectorMenuImg

onMenuSelected: (index) => {
//console.log("SelectorMenu clicked #" + index)
currentSelection = index
}
}

////

SelectorMenuThemed {
anchors.horizontalCenter: parent.horizontalCenter
height: 36

model: lmSelectorMenuImgTxt

onMenuSelected: (index) => {
//console.log("SelectorMenu clicked #" + index)
currentSelection = index
}
}

////

SelectorMenu {
anchors.horizontalCenter: parent.horizontalCenter
height: 40
height: 32

currentSelection: 1
model: ListModel {
id: lmSelectorMenuImg2
ListElement { idx: 1; src: "qrc:/assets/icons_material/baseline-accessibility-24px.svg"; sz: 20; }
ListElement { idx: 2; src: "qrc:/assets/icons_material/baseline-accessibility-24px.svg"; sz: 26; }
ListElement { idx: 3; src: "qrc:/assets/icons_material/baseline-accessibility-24px.svg"; sz: 32; }
}
model: lmSelectorMenuTxt

onMenuSelected: (index) => {
//console.log("SelectorMenu clicked #" + index)
currentSelection = index
}
}

////

SelectorMenu {
anchors.horizontalCenter: parent.horizontalCenter
height: 32
height: 40

model: ListModel {
id: lmSelectorMenuTxt2
ListElement { idx: 1; txt: "4/3"; src: ""; sz: 0; }
ListElement { idx: 2; txt: "16/9"; src: ""; sz: 0; }
ListElement { idx: 3; txt: "21/9"; src: ""; sz: 0; }
model: lmSelectorMenuImg

onMenuSelected: (index) => {
//console.log("SelectorMenu clicked #" + index)
currentSelection = index
}
}

////

SelectorMenu {
anchors.horizontalCenter: parent.horizontalCenter
height: 36

model: lmSelectorMenuImgTxt

onMenuSelected: (index) => {
//console.log("SelectorMenu clicked #" + index)
currentSelection = index
}
}

////
}
}
3 changes: 3 additions & 0 deletions qml/ScreenDesktopComponents.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import QtQuick
import QtQuick.Controls

import QtQuick.Effects
import Qt5Compat.GraphicalEffects

import ThemeEngine

Loader {
Expand Down
4 changes: 3 additions & 1 deletion qml/components_generic/SelectorMenuItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ T.Button {
////////////////

contentItem: Row {
spacing: 4

IconSvg { // contentImage
anchors.verticalCenter: parent.verticalCenter
visible: control.source.toString().length
Expand All @@ -65,7 +67,7 @@ T.Button {

text: control.text
textFormat: Text.PlainText
font.pixelSize: Theme.componentFontSize
font: control.font
verticalAlignment: Text.AlignVCenter

color: control.highlighted ? control.colorContentHighlight : control.colorContent
Expand Down
4 changes: 3 additions & 1 deletion qml/components_themed/PageIndicatorThemed.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ T.PageIndicator {
count: 1
currentIndex: 1

property color color: "white"

////////////////

delegate: Rectangle {
implicitWidth: 12
implicitHeight: 12
radius: (width / 2)

color: Theme.colorHeaderContent
color: control.color
opacity: (index === control.currentIndex) ? (0.95) : (control.pressed ? 0.7 : 0.45)

required property int index
Expand Down
16 changes: 14 additions & 2 deletions qml/components_themed/ProgressBarThemed.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import QtQuick 2.15
import QtQuick.Controls.impl 2.15
import QtQuick.Templates 2.15 as T

//import QtGraphicalEffects 1.15 // Qt5
import Qt5Compat.GraphicalEffects // Qt6

import ThemeEngine 1.0

T.ProgressBar {
Expand All @@ -21,7 +24,6 @@ T.ProgressBar {
implicitWidth: 200
implicitHeight: 12
y: (control.height - height) / 2
height: 12

radius: (Theme.componentRadius / 2)
color: control.colorBackground
Expand All @@ -33,9 +35,19 @@ T.ProgressBar {
Rectangle {
width: control.visualPosition * control.width
height: control.height
radius: (Theme.componentRadius / 2)
color: control.colorForeground
}

layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle {
x: contentItem.x
y: contentItem.y
width: contentItem.width
height: contentItem.height
radius: contentItem.height
}
}
}

////////////////
Expand Down
2 changes: 2 additions & 0 deletions qml/components_themed/SelectorMenuThemedItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ T.Button {
////////////////

contentItem: Row {
spacing: 4

IconSvg { // contentImage
anchors.verticalCenter: parent.verticalCenter
visible: control.source.toString().length
Expand Down

0 comments on commit 2c4ec88

Please sign in to comment.