Change the Pause icon if paused
This commit is contained in:
@@ -217,6 +217,7 @@ extern int MediaMenuHandler(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPara
|
|||||||
extern HWND hwndRebar;
|
extern HWND hwndRebar;
|
||||||
extern void ToolBarCreate(HWND hwndParent, HINSTANCE hInst);
|
extern void ToolBarCreate(HWND hwndParent, HINSTANCE hInst);
|
||||||
extern void ToolBarLoadIcons();
|
extern void ToolBarLoadIcons();
|
||||||
|
extern void ToolBarUpdatePause(int paused);
|
||||||
|
|
||||||
|
|
||||||
/* Functions in win_dialog.c: */
|
/* Functions in win_dialog.c: */
|
||||||
|
@@ -17,14 +17,14 @@ static wchar_t wTitle[512] = { 0 };
|
|||||||
static WNDPROC pOriginalProcedure = NULL;
|
static WNDPROC pOriginalProcedure = NULL;
|
||||||
|
|
||||||
static TBBUTTON buttons[] = {
|
static TBBUTTON buttons[] = {
|
||||||
{ 0, IDM_ACTION_PAUSE, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Pause
|
{ 1, IDM_ACTION_PAUSE, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Pause
|
||||||
{ 0, 0, TBSTATE_INDETERMINATE, BTNS_SEP, { 0 }, 0, 0 },
|
{ 0, 0, TBSTATE_INDETERMINATE, BTNS_SEP, { 0 }, 0, 0 },
|
||||||
{ 1, IDM_ACTION_RESET_CAD, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Ctrl+Alt+Del
|
{ 2, IDM_ACTION_RESET_CAD, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Ctrl+Alt+Del
|
||||||
{ 2, IDM_ACTION_CTRL_ALT_ESC, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Ctrl+Alt+Esc
|
{ 3, IDM_ACTION_CTRL_ALT_ESC, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Ctrl+Alt+Esc
|
||||||
{ 3, IDM_ACTION_HRESET, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Hard reset
|
{ 4, IDM_ACTION_HRESET, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Hard reset
|
||||||
{ 4, 0, TBSTATE_INDETERMINATE, BTNS_BUTTON, { 0 }, 0, 0 }, // ACPI shutdown
|
{ 5, 0, TBSTATE_INDETERMINATE, BTNS_BUTTON, { 0 }, 0, 0 }, // ACPI shutdown
|
||||||
{ 0, 0, TBSTATE_INDETERMINATE, BTNS_SEP, { 0 }, 0, 0 },
|
{ 0, 0, TBSTATE_INDETERMINATE, BTNS_SEP, { 0 }, 0, 0 },
|
||||||
{ 5, IDM_CONFIG, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 } // Settings
|
{ 6, IDM_CONFIG, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 } // Settings
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -98,6 +98,19 @@ ToolBarLoadIcons()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
ToolBarUpdatePause(int pause)
|
||||||
|
{
|
||||||
|
TBBUTTONINFO tbbi;
|
||||||
|
|
||||||
|
tbbi.cbSize = sizeof(tbbi);
|
||||||
|
tbbi.dwMask = TBIF_IMAGE;
|
||||||
|
tbbi.iImage = pause ? 0 : 1;
|
||||||
|
|
||||||
|
SendMessage(hwndToolbar, TB_SETBUTTONINFO, IDM_ACTION_PAUSE, (LPARAM) &tbbi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ToolBarCreate(HWND hwndParent, HINSTANCE hInst)
|
ToolBarCreate(HWND hwndParent, HINSTANCE hInst)
|
||||||
{
|
{
|
||||||
|
@@ -1630,6 +1630,9 @@ plat_pause(int p)
|
|||||||
if (enable_discord)
|
if (enable_discord)
|
||||||
discord_update_activity(dopause);
|
discord_update_activity(dopause);
|
||||||
|
|
||||||
|
/* Update the toolbar */
|
||||||
|
ToolBarUpdatePause(p);
|
||||||
|
|
||||||
/* Send the WM to a manager if needed. */
|
/* Send the WM to a manager if needed. */
|
||||||
if (source_hwnd)
|
if (source_hwnd)
|
||||||
PostMessage((HWND) (uintptr_t) source_hwnd, WM_SENDSTATUS, (WPARAM) !!dopause, (LPARAM) hwndMain);
|
PostMessage((HWND) (uintptr_t) source_hwnd, WM_SENDSTATUS, (WPARAM) !!dopause, (LPARAM) hwndMain);
|
||||||
|
Reference in New Issue
Block a user