From b750d4569baa0b7d39952e072a04c57a04e457b6 Mon Sep 17 00:00:00 2001 From: Benjamim Gois Date: Sun, 28 Jul 2024 16:02:42 -0300 Subject: [PATCH] implement notification for loading custom user preset --- overlayunit.pas | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/overlayunit.pas b/overlayunit.pas index 5f22596..5e13707 100644 --- a/overlayunit.pas +++ b/overlayunit.pas @@ -544,6 +544,8 @@ procedure Tgoverlayform.usercustomBitBtnClick(Sender: TObject); MANGOHUDCFGFILE := GetEnvironmentVariable('HOME') + '/.config/MangoHud/MangoHud.conf'; + + if not FileExists(CUSTOMCFGFILE) then begin ShowMessage('You need to save a custom preset first. Click on the hamburguer menu and click save as custom config.'); @@ -563,6 +565,21 @@ procedure Tgoverlayform.usercustomBitBtnClick(Sender: TObject); end; end; + // Change button color + fullBitbtn.Color:=clDefault; + basicBitbtn.Color:=clDefault; + basichorizontalBitbtn.Color:=clDefault; + fpsonlyBitbtn.Color:=clDefault; + usercustomBitbtn.Color:=$007F5500; + + Process1 := TProcess.Create(nil); + Process1.Executable := 'sh'; + Process1.Parameters.Add('-c'); + Process1.Parameters.Add('notify-send -e -i /usr/share/icons/hicolor/128x128/apps/goverlay.png "MangoHud" "Reloading custom user preset"'); + Process1.Options := [poUsePipes]; + Process1.Execute; + Process1.WaitOnExit; + Process1.Free; end;