overview: add music recognition button to search bar

This commit is contained in:
end-4
2025-10-30 23:08:30 +01:00
parent b3f06049be
commit 480966f978
5 changed files with 161 additions and 81 deletions
@@ -92,8 +92,6 @@ RowLayout {
}
}
// background: null
cursorDelegate: Rectangle {
width: 1
color: searchInput.activeFocus ? Appearance.colors.colPrimary : "transparent"
@@ -102,10 +100,58 @@ RowLayout {
}
IconToolbarButton {
Layout.topMargin: 4
Layout.bottomMargin: 4
onClicked: {
GlobalStates.overviewOpen = false;
Hyprland.dispatch("global quickshell:regionSearch")
}
text: "image_search"
StyledToolTip {
text: Translation.tr("Google Lens")
}
}
IconToolbarButton {
id: songRecButton
Layout.topMargin: 4
Layout.bottomMargin: 4
Layout.rightMargin: 4
toggled: SongRec.running
onClicked: SongRec.toggleRunning()
text: "music_cast"
StyledToolTip {
text: Translation.tr("Recognize music")
}
colText: toggled ? Appearance.colors.colOnPrimary : Appearance.colors.colOnSurfaceVariant
background: MaterialShape {
RotationAnimation on rotation {
running: songRecButton.toggled
duration: 12000
easing.type: Easing.Linear
loops: Animation.Infinite
from: 0
to: 360
}
shape: {
if (songRecButton.down) {
return songRecButton.toggled ? MaterialShape.Shape.Circle : MaterialShape.Shape.Square
} else {
return songRecButton.toggled ? MaterialShape.Shape.SoftBurst : MaterialShape.Shape.Circle
}
}
color: {
if (songRecButton.toggled) {
return songRecButton.hovered ? Appearance.colors.colPrimaryHover : Appearance.colors.colPrimary
} else {
return songRecButton.hovered ? Appearance.colors.colSurfaceContainerHigh : ColorUtils.transparentize(Appearance.colors.colSurfaceContainerHigh)
}
}
Behavior on color {
animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this)
}
}
}
}