forked from Shinonome/dots-hyprland
overview: add music recognition button to search bar
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user