Skip to content

Commit

Permalink
Minor UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Aug 7, 2024
1 parent c49c2bb commit 6861030
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
11 changes: 11 additions & 0 deletions qml/ComponentLibrary/menus/DesktopHeaderItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ T.Button {
// colors
property color colorContent: Theme.colorHeaderContent
property color colorHighlight: Theme.colorHeaderHighlight
property color colorRipple: Qt.rgba(colorContent.r, colorContent.g, colorContent.b, 0.12)

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

Expand All @@ -46,6 +47,16 @@ T.Button {
}
Behavior on opacity { OpacityAnimator { duration: 233 } }

RippleThemed {
anchors.fill: parent
anchor: control
clip: true

pressed: control.pressed
active: control.enabled && control.down
color: control.colorRipple
}

Rectangle { // backgroundIndicator
anchors.top: parent.top
anchors.left: parent.left
Expand Down
2 changes: 2 additions & 0 deletions qml/MobileDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ DrawerThemed {

////////

topPadding: -Theme.componentMargin/2

ListSeparatorPadded { }

////////
Expand Down
18 changes: 14 additions & 4 deletions qml/widgets/DeviceWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ Item {
property int margin: Theme.componentMargin
property int halfmargin: Theme.componentMargin / 2

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

Component.onCompleted: initBoxData()

Connections {
target: boxDevice
function onSensorUpdated() { initBoxData() }
Expand Down Expand Up @@ -54,8 +58,6 @@ Item {
}
}

Component.onCompleted: initBoxData()

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

function initBoxData() {
Expand Down Expand Up @@ -223,14 +225,22 @@ Item {

opacity: boxDevice.deviceEnabled ? 1 : 0.66

RippleThemed {
anchors.fill: parent
anchor: control
clip: true

pressed: mousearea.pressed
active: mousearea.enabled && mousearea.down
color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.8)
}

MouseArea {
id: mousearea
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.MiddleButton

onClicked: (mouse) => {
if (typeof boxDevice === "undefined" || !boxDevice) return

if (mouse.button === Qt.LeftButton) {
// multi selection
if ((mouse.modifiers & Qt.ControlModifier) ||
Expand Down

0 comments on commit 6861030

Please sign in to comment.