Ported over ui updates from Linux Game Manager.

This commit is contained in:
Storm Dragon
2025-08-06 15:47:59 -04:00
parent adfef6fba4
commit fa80331a63
3 changed files with 51 additions and 14 deletions

View File

@@ -165,12 +165,12 @@ agm_msgbox() {
local text="$3"
if [[ "$dialogType" == "yad" ]]; then
yad --form \
echo -e "$text" | yad --text-info \
--title="$title" \
--field="$text:LBL" \
--selectable-labels \
--show-cursor \
--button="OK:0" \
--width=400
--width=600 \
--height=400
else
dialog --backtitle "$backTitle" \
--title "$title" \
@@ -186,13 +186,13 @@ agm_yesno() {
local text="$3"
if [[ "$dialogType" == "yad" ]]; then
yad --form \
echo -e "$text" | yad --text-info \
--title="$title" \
--field="$text:LBL" \
--selectable-labels \
--show-cursor \
--button="Yes:0" \
--button="No:1" \
--width=400
--width=600 \
--height=400
else
dialog --backtitle "$backTitle" \
--title "$title" \
@@ -361,8 +361,36 @@ agm_progress_with_percent() {
local text="$2"
if [[ "$dialogType" == "yad" ]]; then
# Create a true progress dialog that accepts percentage updates
yad --progress \
# Start audio feedback for accessibility
local beepPid
local yadPid
# Cleanup function for traps
cleanup_percent_progress() {
[[ -n "$beepPid" ]] && kill "$beepPid" 2>/dev/null
[[ -n "$yadPid" ]] && kill "$yadPid" 2>/dev/null
}
# Set trap to ensure cleanup on interruption
trap cleanup_percent_progress EXIT INT TERM
if command -v sox >/dev/null 2>&1; then
{
while true; do
# Generate a short, pleasant progress beep (440Hz for 0.1s)
sox -q -n -d synth 0.1 sine 440 vol 0.3 2>/dev/null
sleep 2 # Beep every 2 seconds
done
} &
beepPid=$!
fi
# Create a true progress dialog that accepts percentage updates with tee for cleanup
{
cat
cleanup_percent_progress
trap - EXIT INT TERM
} | yad --progress \
--title="$title" \
--text="$text" \
--auto-close \