Skip to content

Commit

Permalink
Fix dialog global draggable checkbox not updating state when toggling…
Browse files Browse the repository at this point in the history
… via tray icon (rainmeter#348)
  • Loading branch information
Joehuu authored Jul 20, 2023
1 parent 4970a05 commit 8930785
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Library/DialogManage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ void DialogManage::UpdateLanguageStatus()
}
}

void DialogManage::UpdateGlobalDraggableCheckBox()
{
if (c_Dialog && c_Dialog->m_TabSettings.IsInitialized())
{
c_Dialog->m_TabSettings.UpdateDraggableCheckBox();
}
}

void DialogManage::UpdateSettings()
{
if (c_Dialog && c_Dialog->m_TabSettings.IsInitialized())
Expand Down Expand Up @@ -2462,7 +2470,7 @@ void DialogManage::TabSettings::Initialize()
Button_SetCheck(GetControl(Id_AutoInstallCheckBox), !GetRainmeter().GetDisableAutoUpdate());
EnableWindow(GetControl(Id_AutoInstallCheckBox), check);

Button_SetCheck(GetControl(Id_LockSkinsCheckBox), GetRainmeter().GetDisableDragging());
UpdateDraggableCheckBox();
Button_SetCheck(GetControl(Id_LogToFileCheckBox), GetLogger().IsLogToFile());
Button_SetCheck(GetControl(Id_VerboseLoggingCheckBox), GetRainmeter().GetDebug());

Expand Down Expand Up @@ -2492,6 +2500,11 @@ void DialogManage::TabSettings::UpdateLanguageStatus()
ShowWindow(item, GetRainmeter().GetLanguageStatus() ? SW_SHOWNOACTIVATE : SW_HIDE);
}

void DialogManage::TabSettings::UpdateDraggableCheckBox()
{
Button_SetCheck(GetControl(Id_LockSkinsCheckBox), GetRainmeter().GetDisableDragging());
}

void DialogManage::TabSettings::Update()
{
Initialize();
Expand Down
2 changes: 2 additions & 0 deletions Library/DialogManage.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class DialogManage : public Dialog
static void UpdateGameMode();

static void UpdateLanguageStatus();
static void UpdateGlobalDraggableCheckBox();

static void UpdateSettings();

Expand Down Expand Up @@ -212,6 +213,7 @@ class DialogManage : public Dialog
virtual void Initialize();

void UpdateLanguageStatus();
void UpdateDraggableCheckBox();
void Update();

protected:
Expand Down
1 change: 1 addition & 0 deletions Library/Rainmeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2147,6 +2147,7 @@ void Rainmeter::SetDisableDragging(bool dragging)
{
m_DisableDragging = dragging;
DialogManage::UpdateSkinDraggableCheckBox();
DialogManage::UpdateGlobalDraggableCheckBox();
WritePrivateProfileString(L"Rainmeter", L"DisableDragging", dragging ? L"1" : L"0", m_IniFile.c_str());
}

Expand Down

0 comments on commit 8930785

Please sign in to comment.