Skip to content

Commit

Permalink
Update shared components
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Aug 7, 2024
1 parent 2e52ae4 commit ee4c2a9
Show file tree
Hide file tree
Showing 40 changed files with 313 additions and 144 deletions.
1 change: 1 addition & 0 deletions assets/icons.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
<file>icons/material-icons/duotone/settings_bluetooth.svg</file>
<file>icons/material-icons/duotone/settings_overscan.svg</file>
<file>icons/material-icons/duotone/shutter_speed.svg</file>
<file>icons/material-icons/duotone/speak.svg</file>
<file>icons/material-icons/duotone/speaker.svg</file>
<file>icons/material-icons/duotone/speed.svg</file>
<file>icons/material-icons/duotone/spherical.svg</file>
Expand Down
8 changes: 8 additions & 0 deletions assets/icons/material-icons/duotone/speak.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions qml/ComponentLibrary/ThemeEngine.qml
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ Item {

colorActionbar = "#eaeaea"
colorActionbarContent = "#444"
colorActionbarHighlight = "#f6e148"
colorActionbarHighlight = "#dadada"

colorTabletmenu = "#ffffff"
colorTabletmenuContent = "#9d9d9d"
Expand All @@ -569,7 +569,7 @@ Item {
colorComponentText = "black"
colorComponentContent = "black"
colorComponentBorder = "#ddd"
colorComponentDown = "#d0d0d0"
colorComponentDown = "#dadada"
colorComponentBackground = "#fcfcfc"

componentRadius = 6
Expand Down
5 changes: 2 additions & 3 deletions qml/ComponentLibrary/buttons/ButtonImpl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ T.Button {
}

RippleThemed {
width: parent.width
height: parent.height

anchors.fill: parent
anchor: control

pressed: control.pressed
active: control.enabled && (control.down || control.hovered || control.visualFocus)
color: control.colorRipple
Expand Down
5 changes: 2 additions & 3 deletions qml/ComponentLibrary/buttons/RoundButtonImpl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ T.Button {
}

RippleThemed {
width: parent.width
height: parent.height

anchors.fill: parent
anchor: control

pressed: control.pressed
active: control.enabled && (control.down || control.hovered || control.visualFocus)
color: control.colorRipple
Expand Down
5 changes: 2 additions & 3 deletions qml/ComponentLibrary/buttons/SquareButtonImpl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ T.Button {
}

RippleThemed {
width: parent.width
height: parent.height

anchors.fill: parent
anchor: control

pressed: control.pressed
active: control.enabled && (control.down || control.hovered || control.visualFocus)
color: control.colorRipple
Expand Down
1 change: 0 additions & 1 deletion qml/ComponentLibrary/controls/DialThemed.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ T.Dial {

opacity: control.enabled ? 1 : 0.66
color: control.pressed ? Theme.colorSecondary : Theme.colorPrimary
antialiasing: true

transform: [
Translate { y: -Math.min(control.background.width, control.background.height) * 0.4 + 8; },
Expand Down
5 changes: 2 additions & 3 deletions qml/ComponentLibrary/controls/ItemDelegateThemed.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ T.ItemDelegate {
color: control.highlighted ? control.Material.listHighlightColor : "transparent"

RippleThemed {
width: parent.width
height: parent.height
anchors.fill: parent
anchor: control

clip: visible
anchor: control
pressed: control.pressed
active: enabled && (control.down || control.visualFocus || control.hovered)
color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.5)
Expand Down
34 changes: 19 additions & 15 deletions qml/ComponentLibrary/controls/ProgressBarThemed.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ T.ProgressBar {

property color colorBackground: Theme.colorComponentBackground
property color colorForeground: Theme.colorPrimary
property bool rounded: false

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

Expand All @@ -23,32 +24,35 @@ T.ProgressBar {
implicitHeight: 12
y: (control.height - height) / 2
color: control.colorBackground
radius: Theme.componentRadius
}

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

contentItem: Item {
width: control.width
height: control.height

Rectangle {
width: control.visualPosition * control.width
height: control.height
color: control.colorForeground
radius: control.rounded ? Theme.componentRadius : 0
}
}

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

layer.enabled: true
layer.effect: MultiEffect {
maskEnabled: true
maskInverted: false
maskThresholdMin: 0.5
maskSpreadAtMin: 1.0
maskSpreadAtMax: 0.0
maskSource: ShaderEffectSource {
sourceItem: Rectangle {
width: control.width
height: control.height
radius: Theme.componentRadius
layer.enabled: true
layer.effect: MultiEffect {
maskEnabled: true
maskInverted: false
maskThresholdMin: 0.5
maskSpreadAtMin: 1.0
maskSpreadAtMax: 0.0
maskSource: ShaderEffectSource {
sourceItem: Rectangle {
width: control.width
height: control.height
radius: Theme.componentRadius
}
}
}
}
Expand Down
18 changes: 15 additions & 3 deletions qml/ComponentLibrary/controls/ScrollBarThemed.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@ T.ScrollBar {
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)

leftPadding: 0
rightPadding: 0

visible: (policy !== T.ScrollBar.AlwaysOff)
minimumSize: (orientation === Qt.Horizontal) ? height / width : width / height

minimumSize: (orientation === Qt.Horizontal) ? (height / width) : (width / height)

property int radius: isDesktop ? 0 : 8

property color colorBackground: Theme.colorBackground
property color colorMoving: Theme.colorSecondary
property color colorPressed: Theme.colorPrimary

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

Expand Down Expand Up @@ -45,7 +55,8 @@ T.ScrollBar {
y: control.topPadding
height: control.height - control.topPadding - control.bottomPadding

color: Theme.colorBackground
radius: control.radius
color: control.colorBackground
opacity: 0.0
}

Expand All @@ -55,7 +66,8 @@ T.ScrollBar {
implicitWidth: control.interactive ? 12 : 6
implicitHeight: control.interactive ? 12 : 6

color: control.pressed ? Theme.colorSecondary : Theme.colorForeground
radius: control.radius
color: control.pressed ? control.colorPressed : control.colorMoving
opacity: 0.0
}

Expand Down
5 changes: 2 additions & 3 deletions qml/ComponentLibrary/generic/AndroidButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ T.Button {
implicitHeight: 48

RippleThemed {
width: parent.width
height: parent.height

anchors.fill: parent
anchor: control

pressed: control.pressed
active: control.enabled && (control.down || control.visualFocus)
color: Qt.rgba(control.colorPrimary.r, control.colorPrimary.g, control.colorPrimary.b, 0.1)
Expand Down
11 changes: 6 additions & 5 deletions qml/ComponentLibrary/generic/AndroidButtonIcon.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ T.Button {
// settings
property url source
property int sourceSize: 26
property int sourceRotation: 0
property int layoutDirection: Qt.LeftToRight

// colors
Expand All @@ -37,9 +38,9 @@ T.Button {

opacity: control.enabled ? 1 : 0.66

Rectangle {
id: shadowarea
Rectangle { // shadowarea
anchors.fill: parent

border.color: "#eee"
radius: 8
border.width: 1
Expand All @@ -54,10 +55,9 @@ T.Button {
}

RippleThemed {
width: parent.width
height: parent.height

anchors.fill: parent
anchor: control

pressed: control.pressed
active: enabled && (control.down || control.visualFocus)
color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.5)
Expand Down Expand Up @@ -94,6 +94,7 @@ T.Button {

width: control.sourceSize
height: control.sourceSize
rotation: control.sourceRotation

source: control.source
color: control.colorPrimary
Expand Down
15 changes: 9 additions & 6 deletions qml/ComponentLibrary/generic/ButtonChip.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ T.Button {
// colors
property color color: Theme.colorPrimary

// icon
// icons
property string leftIcon
property int leftIconSize: UtilsNumber.alignTo(height * 1.0, 2)
property int leftIconRotation: 0
property string rightIcon
property int rightIconSize: UtilsNumber.alignTo(height * 0.5, 2)
property int rightIconRotation: 0

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

Expand All @@ -55,10 +57,9 @@ T.Button {
}

RippleThemed {
width: parent.width
height: parent.height

anchors.fill: parent
anchor: control

pressed: control.pressed
active: control.enabled && (control.down || control.visualFocus)
color: Qt.rgba(control.color.r, control.color.g, control.color.b, 0.16)
Expand Down Expand Up @@ -100,9 +101,10 @@ T.Button {
visible: control.leftIcon.length

IconSvg {
anchors.centerIn: parent
width: control.leftIconSize
height: control.leftIconSize
anchors.centerIn: parent
rotation: control.leftIconRotation

color: control.color
source: control.leftIcon
Expand Down Expand Up @@ -130,9 +132,10 @@ T.Button {
visible: control.rightIcon.length

IconSvg {
anchors.centerIn: parent
width: control.rightIconSize
height: control.rightIconSize
anchors.centerIn: parent
rotation: control.rightIconRotation

color: control.color
source: control.rightIcon
Expand Down
5 changes: 2 additions & 3 deletions qml/ComponentLibrary/generic/ButtonFab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ T.Button {
}

RippleThemed {
width: parent.width
height: parent.height

anchors.fill: parent
anchor: control

pressed: control.pressed
active: control.enabled && (control.down || control.visualFocus)
color: Qt.rgba(control.colorHighlight.r, control.colorHighlight.g, control.colorHighlight.b, 0.1)
Expand Down
5 changes: 2 additions & 3 deletions qml/ComponentLibrary/generic/ButtonFabExtended.qml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ T.Button {
}

RippleThemed {
width: parent.width
height: parent.height

anchors.fill: parent
anchor: control

pressed: control.pressed
active: control.enabled && (control.down || control.visualFocus)
color: Qt.rgba(control.colorHighlight.r, control.colorHighlight.g, control.colorHighlight.b, 0.1)
Expand Down
5 changes: 2 additions & 3 deletions qml/ComponentLibrary/generic/ButtonToggle.qml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ T.Button {
}

RippleThemed {
width: parent.width
height: parent.height

anchors.fill: parent
anchor: control

pressed: control.pressed
active: control.enabled && (control.down || control.visualFocus)
color: control.colorRipple
Expand Down
2 changes: 1 addition & 1 deletion qml/ComponentLibrary/generic/DataBarSolid.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Item {
radius: control.hhh
color: control.colorBackground

layer.enabled: !isDesktop
layer.enabled: true
layer.effect: MultiEffect {
maskEnabled: true
maskInverted: false
Expand Down
3 changes: 2 additions & 1 deletion qml/ComponentLibrary/generic/IconSvg.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Item {
property alias source: sourceImg.source
property alias color: overlayImg.colorizationColor
property alias fillMode: sourceImg.fillMode
property alias smooth: sourceImg.smooth
property alias asynchronous: sourceImg.asynchronous

Image {
Expand All @@ -19,7 +20,7 @@ Item {
visible: parent.color ? false : true
sourceSize: Qt.size(width, height)
fillMode: Image.PreserveAspectFit
smooth: control.smooth
smooth: false
asynchronous: false
}

Expand Down
Loading

0 comments on commit ee4c2a9

Please sign in to comment.