Skip to content

Commit

Permalink
ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Odizinne committed Dec 29, 2024
1 parent 7d03381 commit af70cb3
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions SoundPanel/SoundPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,6 @@
#include "QuickSoundSwitcher.h"
#include <QPropertyAnimation>

bool isTransparencyEffectEnabled() {
HKEY hKey;
DWORD value = 0;
DWORD valueSize = sizeof(value);
const wchar_t* subKey = L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize";
const wchar_t* valueName = L"EnableTransparency";

if (RegOpenKeyEx(HKEY_CURRENT_USER, subKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueEx(hKey, valueName, nullptr, nullptr, reinterpret_cast<LPBYTE>(&value), &valueSize) == ERROR_SUCCESS) {
RegCloseKey(hKey);
return value != 0;
}
RegCloseKey(hKey);
}
return false;
}

SoundPanel::SoundPanel(QObject* parent)
: QObject(parent)
, soundPanelWindow(nullptr)
Expand Down Expand Up @@ -320,7 +303,11 @@ void SoundPanel::onRecordingDeviceChanged(const QString &deviceName) {

void SoundPanel::setOutputButtonImage(int volume) {
QString icon;
icon = Utils::getIcon(2, volume, NULL);
if (isWindows10) {
icon = Utils::getIcon(1, volume, NULL);
} else {
icon = Utils::getIcon(2, volume, NULL);
}

engine->rootContext()->setContextProperty("outputIcon", QStringLiteral("qrc") + icon);
}
Expand Down

0 comments on commit af70cb3

Please sign in to comment.