overlay: add option for zoom anim and darkening surface

This commit is contained in:
end-4
2025-11-06 10:55:33 +01:00
parent 3bebabd95e
commit 6be3fe0c65
3 changed files with 68 additions and 40 deletions
@@ -361,6 +361,11 @@ Singleton {
property bool pinnedOnStartup: false
}
property JsonObject overlay: JsonObject {
property bool openingZoomAnimation: true
property bool darkenScreen: true
}
property JsonObject overview: JsonObject {
property bool enable: true
property real scale: 0.18 // Relative to screen size
@@ -20,7 +20,7 @@ Item {
}
}
property real initScale: 1.08
property real initScale: Config.options.overlay.openingZoomAnimation ? 1.08 : 1.000001
scale: initScale
Component.onCompleted: {
scale = 1
@@ -33,6 +33,7 @@ Item {
id: bg
anchors.fill: parent
color: Appearance.colors.colScrim
visible: Config.options.overlay.darkenScreen && opacity > 0
opacity: (GlobalStates.overlayOpen && root.scale !== initScale) ? 1 : 0
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
@@ -7,45 +7,6 @@ import qs.modules.common.widgets
ContentPage {
forceWidth: true
ContentSection {
icon: "point_scan"
title: Translation.tr("Crosshair overlay")
MaterialTextArea {
Layout.fillWidth: true
placeholderText: Translation.tr("Crosshair code (in Valorant's format)")
text: Config.options.crosshair.code
wrapMode: TextEdit.Wrap
onTextChanged: {
Config.options.crosshair.code = text;
}
}
RowLayout {
StyledText {
Layout.leftMargin: 10
color: Appearance.colors.colSubtext
font.pixelSize: Appearance.font.pixelSize.smallie
text: Translation.tr("Press Super+G to open the overlay and pin the crosshair")
}
Item {
Layout.fillWidth: true
}
RippleButtonWithIcon {
id: editorButton
buttonRadius: Appearance.rounding.full
materialIcon: "open_in_new"
mainText: Translation.tr("Open editor")
onClicked: {
Qt.openUrlExternally(`https://www.vcrdb.net/builder?c=${Config.options.crosshair.code}`);
}
StyledToolTip {
text: "www.vcrdb.net"
}
}
}
}
ContentSection {
icon: "call_to_action"
title: Translation.tr("Dock")
@@ -214,6 +175,67 @@ ContentPage {
}
}
ContentSection {
icon: "select_window"
title: Translation.tr("Overlay: General")
ConfigSwitch {
buttonIcon: "high_density"
text: Translation.tr("Enable opening zoom animation")
checked: Config.options.overlay.openingZoomAnimation
onCheckedChanged: {
Config.options.overlay.openingZoomAnimation = checked;
}
}
ConfigSwitch {
buttonIcon: "texture"
text: Translation.tr("Darken screen")
checked: Config.options.overlay.darkenScreen
onCheckedChanged: {
Config.options.overlay.darkenScreen = checked;
}
}
}
ContentSection {
icon: "point_scan"
title: Translation.tr("Overlay: Crosshair")
MaterialTextArea {
Layout.fillWidth: true
placeholderText: Translation.tr("Crosshair code (in Valorant's format)")
text: Config.options.crosshair.code
wrapMode: TextEdit.Wrap
onTextChanged: {
Config.options.crosshair.code = text;
}
}
RowLayout {
StyledText {
Layout.leftMargin: 10
color: Appearance.colors.colSubtext
font.pixelSize: Appearance.font.pixelSize.smallie
text: Translation.tr("Press Super+G to open the overlay and pin the crosshair")
}
Item {
Layout.fillWidth: true
}
RippleButtonWithIcon {
id: editorButton
buttonRadius: Appearance.rounding.full
materialIcon: "open_in_new"
mainText: Translation.tr("Open editor")
onClicked: {
Qt.openUrlExternally(`https://www.vcrdb.net/builder?c=${Config.options.crosshair.code}`);
}
StyledToolTip {
text: "www.vcrdb.net"
}
}
}
}
ContentSection {
icon: "screenshot_frame_2"
title: Translation.tr("Region selector (screen snipping/Google Lens)")