Skip to content

Commit

Permalink
Update RGB values when selecting a conhost color property (#12099)
Browse files Browse the repository at this point in the history
When editing colors in the conhost properties dialog, and you select an
item to update (e.g. Screen Text, or Screen Background), the associated
color swatch for that item would be highlighted, but the RGB color
values weren't updated to reflect that selection. This PR fixes it so
the RGB values are now correctly refreshed.

I just copied the three lines used up update the color value fields from
the code that handles changes to the color swatch selection. I didn't
think it was worth pulling those three lines out into a separate
function.

## Validation Steps Performed
I've manually verified that the RGB values are now refreshed correctly
when selecting a color item to update.

Closes #1220
  • Loading branch information
j4james authored Jan 7, 2022
1 parent 63a3517 commit c8cbf90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/propsheet/ColorsPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ INT_PTR WINAPI ColorDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam)
InvalidateRect(hWndOld, nullptr, TRUE);
}

// update color value fields to reflect the new color
UpdateItem(hDlg, IDD_COLOR_RED, GetRValue(AttrToRGB(ColorArray[iColor])));
UpdateItem(hDlg, IDD_COLOR_GREEN, GetGValue(AttrToRGB(ColorArray[iColor])));
UpdateItem(hDlg, IDD_COLOR_BLUE, GetBValue(AttrToRGB(ColorArray[iColor])));

return TRUE;

case IDD_COLOR_RED:
Expand Down

0 comments on commit c8cbf90

Please sign in to comment.