diff --git a/Library/DialogManage.cpp b/Library/DialogManage.cpp index ed33a1ac..9356b517 100644 --- a/Library/DialogManage.cpp +++ b/Library/DialogManage.cpp @@ -1081,7 +1081,7 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) { m_IgnoreUpdate = true; ZPOSITION zpos = (ZPOSITION)(ComboBox_GetCurSel((HWND)lParam) - 2); - m_SkinWindow->ChangeZPos(zpos); + m_SkinWindow->SetWindowZPosition(zpos); } break; diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index cecfb059..334dba22 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -3612,28 +3612,23 @@ LRESULT CMeterWindow::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam) } else if (wParam == ID_CONTEXT_SKINMENU_VERYTOPMOST) { - ChangeZPos(ZPOSITION_ONTOPMOST); - WriteConfig(SETTING_ALWAYSONTOP); + SetWindowZPosition(ZPOSITION_ONTOPMOST); } else if (wParam == ID_CONTEXT_SKINMENU_TOPMOST) { - ChangeZPos(ZPOSITION_ONTOP); - WriteConfig(SETTING_ALWAYSONTOP); + SetWindowZPosition(ZPOSITION_ONTOP); } else if (wParam == ID_CONTEXT_SKINMENU_BOTTOM) { - ChangeZPos(ZPOSITION_ONBOTTOM); - WriteConfig(SETTING_ALWAYSONTOP); + SetWindowZPosition(ZPOSITION_ONBOTTOM); } else if (wParam == ID_CONTEXT_SKINMENU_NORMAL) { - ChangeZPos(ZPOSITION_NORMAL); - WriteConfig(SETTING_ALWAYSONTOP); + SetWindowZPosition(ZPOSITION_NORMAL); } else if (wParam == ID_CONTEXT_SKINMENU_ONDESKTOP) { - ChangeZPos(ZPOSITION_ONDESKTOP); - WriteConfig(SETTING_ALWAYSONTOP); + SetWindowZPosition(ZPOSITION_ONDESKTOP); } else if (wParam == ID_CONTEXT_SKINMENU_KEEPONSCREEN) { @@ -3867,6 +3862,18 @@ void CMeterWindow::SetWindowHide(HIDEMODE hide) WriteConfig(SETTING_HIDEONMOUSEOVER); } +/* +** SetWindowZPosition +** +** Helper function for setting Position +** +*/ +void CMeterWindow::SetWindowZPosition(ZPOSITION zpos) +{ + ChangeZPos(zpos); + WriteConfig(SETTING_ALWAYSONTOP); +} + /* ** OnSysCommand ** diff --git a/Library/MeterWindow.h b/Library/MeterWindow.h index cf3afa5c..d0177763 100644 --- a/Library/MeterWindow.h +++ b/Library/MeterWindow.h @@ -330,6 +330,7 @@ private: void SetSavePosition(bool b); void SetSnapEdges(bool b); void SetWindowHide(HIDEMODE hide); + void SetWindowZPosition(ZPOSITION zpos); bool DoAction(int x, int y, MOUSE mouse, bool test); bool DoMoveAction(int x, int y, MOUSE mouse); bool ResizeWindow(bool reset);