Skip to content

Commit

Permalink
Update shared components
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Nov 29, 2024
1 parent 158fdd7 commit e3102d8
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 35 deletions.
4 changes: 3 additions & 1 deletion thirdparty/ComponentLibrary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ set_source_files_properties(ThemeEngine.qml PROPERTIES

set_target_properties(ComponentLibrary PROPERTIES AUTOMOC ON)

target_link_libraries(ComponentLibrary PRIVATE Qt::Quick)
find_package(Qt6 REQUIRED COMPONENTS Qml Quick QuickControls2)

target_link_libraries(ComponentLibrary PRIVATE Qt6::Qml Qt6::Quick Qt6::QuickControls2 Qt6::QmlModels)

qt_add_qml_module(ComponentLibrary
URI ComponentLibrary
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/ComponentLibrary/controls/ScrollBarThemed.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ T.ScrollBar {
name: "active"
when: (control.policy === T.ScrollBar.AlwaysOn) || (control.active && control.size < 1.0)
PropertyChanges { control.background.opacity: 0.75 }
PropertyChanges { control.contentItem.opacity: 0.75 }
PropertyChanges { control.contentItem.opacity: 1.0 }
}

transitions: Transition {
Expand Down
8 changes: 6 additions & 2 deletions thirdparty/ComponentLibrary/controls/SwitchThemed.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ T.Switch {
implicitWidth: control.www
implicitHeight: Theme.componentHeight

x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
x: control.text ?
(control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) :
(control.leftPadding + (control.availableWidth - width) / 2)
y: control.topPadding + (control.availableHeight - height) / 2

width: control.www
height: control.hhh
radius: control.hhh
Expand All @@ -57,7 +60,8 @@ T.Switch {
z: -1
radius: (width / 2)
color: parent.color
opacity: enabled && (control.pressed || control.hovered || control.visualFocus) ? 0.2 : 0
opacity: (control.enabled && control.checkable && (control.pressed || control.hovered || control.visualFocus)) ?
(control.checked ? 0.16 : 0.32) : 0
Behavior on opacity { NumberAnimation { duration: 133 } }
}
}
Expand Down
53 changes: 41 additions & 12 deletions thirdparty/ComponentLibrary/maps/MapButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ T.Button {
property string highlightMode: "off" // available: off

// colors
property string iconColor: Theme.colorIcon
property string highlightColor: Theme.colorPrimary
property string borderColor: Theme.colorSeparator
property string backgroundColor: Theme.colorLowContrast
property color iconColor: Theme.colorIcon
property color highlightColor: Theme.colorComponent
property color borderColor: Theme.colorSeparator
property color backgroundColor: Theme.colorLowContrast

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

Expand All @@ -54,17 +54,46 @@ T.Button {
radius: control.radius
color: control.backgroundColor
}
/*
RippleThemed {

Item {
id: bglayer
anchors.fill: parent
anchor: control
/*
RippleThemed {
anchors.fill: parent
anchor: control
clip: visible
pressed: control.pressed
active: enabled && (control.down || control.visualFocus || control.hovered)
color: Qt.rgba(control.highlightColor.r, control.highlightColor.g, control.highlightColor.b, 0.66)
}
*/
Rectangle { // button_bg
anchors.fill: parent
color: control.highlightColor
opacity: control.hovered ? 0.66 : 0
Behavior on opacity { NumberAnimation { duration: 333 } }
}

clip: visible
pressed: control.pressed
active: enabled && (control.down || control.visualFocus || control.hovered)
color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.9)
layer.enabled: true
layer.effect: MultiEffect {
maskEnabled: true
maskInverted: false
maskThresholdMin: 0.5
maskSpreadAtMin: 1.0
maskSpreadAtMax: 0.0
maskSource: ShaderEffectSource {
sourceItem: Rectangle {
x: bglayer.x
y: bglayer.y
width: bglayer.width
height: bglayer.height
radius: control.radius
}
}
}
}
*/
}

////////////////
Expand Down
53 changes: 41 additions & 12 deletions thirdparty/ComponentLibrary/maps/MapButtonCompass.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ T.Button {
property string highlightMode: "off" // available: off

// colors
property string iconColor: Theme.colorIcon
property string highlightColor: Theme.colorPrimary
property string borderColor: Theme.colorSeparator
property string backgroundColor: Theme.colorLowContrast
property color iconColor: Theme.colorIcon
property color highlightColor: Theme.colorComponent
property color borderColor: Theme.colorSeparator
property color backgroundColor: Theme.colorLowContrast

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

Expand All @@ -55,17 +55,46 @@ T.Button {
radius: control.radius
color: control.backgroundColor
}
/*
RippleThemed {

Item {
id: bglayer
anchors.fill: parent
anchor: control
/*
RippleThemed {
anchors.fill: parent
anchor: control
clip: visible
pressed: control.pressed
active: enabled && (control.down || control.visualFocus || control.hovered)
color: Qt.rgba(control.highlightColor.r, control.highlightColor.g, control.highlightColor.b, 0.66)
}
*/
Rectangle { // button_bg
anchors.fill: parent
color: control.highlightColor
opacity: control.hovered ? 0.66 : 0
Behavior on opacity { NumberAnimation { duration: 333 } }
}

clip: visible
pressed: control.pressed
active: enabled && (control.down || control.visualFocus || control.hovered)
color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.9)
layer.enabled: true
layer.effect: MultiEffect {
maskEnabled: true
maskInverted: false
maskThresholdMin: 0.5
maskSpreadAtMin: 1.0
maskSpreadAtMax: 0.0
maskSource: ShaderEffectSource {
sourceItem: Rectangle {
x: bglayer.x
y: bglayer.y
width: bglayer.width
height: bglayer.height
radius: control.radius
}
}
}
}
*/
}

////////////////
Expand Down
12 changes: 6 additions & 6 deletions thirdparty/ComponentLibrary/maps/MapButtonZoom.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ T.Button {
property string highlightMode: "off" // available: off

// colors
property string iconColor: Theme.colorIcon
property string highlightColor: Theme.colorPrimary
property string borderColor: Theme.colorSeparator
property string backgroundColor: Theme.colorLowContrast
property color iconColor: Theme.colorIcon
property color highlightColor: Theme.colorComponent
property color borderColor: Theme.colorSeparator
property color backgroundColor: Theme.colorLowContrast

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

Expand Down Expand Up @@ -69,7 +69,7 @@ T.Button {
width: parent.width
height: parent.width

color: Theme.colorComponent
color: control.highlightColor
opacity: button1_ma.containsMouse ? 0.66 : 0
Behavior on opacity { NumberAnimation { duration: 333 } }
}
Expand All @@ -78,7 +78,7 @@ T.Button {
width: parent.width
height: parent.width

color: Theme.colorComponent
color: control.highlightColor
opacity: button2_ma.containsMouse ? 0.66 : 0
Behavior on opacity { NumberAnimation { duration: 333 } }
}
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/ComponentLibrary/menus/ActionMenuItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ T.Button {

pressed: control.pressed
active: control.enabled && (control.down || control.visualFocus)
color: Qt.rgba(Theme.colorComponentDown.r, Theme.colorComponentDown.g, Theme.colorComponentDown.b, 0.666)
color: Qt.rgba(Theme.colorComponentDown.r, Theme.colorComponentDown.g, Theme.colorComponentDown.b, 0.66)
}

layer.enabled: true
Expand Down
1 change: 1 addition & 0 deletions thirdparty/IconLibrary/IconLibrary.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@
<file>material-symbols/add_circle.svg</file>
<file>material-symbols/add_circle-fill.svg</file>
<file>material-symbols/altitude.svg</file>
<file>material-symbols/altitude-fill.svg</file>
<file>material-symbols/android.svg</file>
<file>material-symbols/archive.svg</file>
<file>material-symbols/archive-fill.svg</file>
Expand Down
1 change: 1 addition & 0 deletions thirdparty/IconLibrary/material-symbols/altitude-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e3102d8

Please sign in to comment.