Skip to content

Commit

Permalink
Fix redraw glitch in save image dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
clsid2 committed Jun 10, 2024
1 parent 233decf commit 1815ead
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/mpc-hc/SaveImageDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ CSaveImageDialog::CSaveImageDialog(
IFileDialogCustomize* pfdc = GetIFileDialogCustomize();
CString str;

pfdc->StartVisualGroup(IDS_IMAGE_JPEG_QUALITY, ResStr(IDS_IMAGE_JPEG_QUALITY));
pfdc->AddText(IDS_IMAGE_QUALITY, ResStr(IDS_IMAGE_QUALITY));
pfdc->StartVisualGroup(IDS_IMAGE_QUALITY, ResStr(IDS_IMAGE_QUALITY));
str.Format(L"%d", std::clamp(m_nJpegQuality, 20, 100));
pfdc->AddEditBox(IDC_EDIT1, str);
pfdc->EndVisualGroup();

bSubtitleOptionSupported = subtitleOptionSupported;
if (bSubtitleOptionSupported) {
pfdc->StartVisualGroup(IDS_SAVEDIALOG_INCLUDE_SUBS, L"");
pfdc->AddCheckButton(IDS_SNAPSHOT_SUBTITLES, ResStr(IDS_SNAPSHOT_SUBTITLES), AfxGetAppSettings().bSnapShotSubtitles);
pfdc->EndVisualGroup();
}

pfdc->Release();
Expand Down Expand Up @@ -103,12 +104,9 @@ void CSaveImageDialog::OnTypeChange()
IFileDialogCustomize* pfdc = GetIFileDialogCustomize();

if (m_pOFN->nFilterIndex == 2) { // JPEG encoding is chosen
pfdc->SetControlState(IDS_IMAGE_JPEG_QUALITY, CDCS_ENABLEDVISIBLE);
pfdc->SetControlState(IDS_IMAGE_QUALITY, CDCS_ENABLEDVISIBLE);
pfdc->SetControlState(IDC_EDIT1, CDCS_ENABLEDVISIBLE);
redrawAllThemedWidgets(); //in some cases, showing the themed widgets using IFileDialogCustomize doesn't seem to trigger a redraw
} else {
pfdc->SetControlState(IDS_IMAGE_JPEG_QUALITY, CDCS_INACTIVE);
pfdc->SetControlState(IDS_IMAGE_QUALITY, CDCS_INACTIVE);
pfdc->SetControlState(IDC_EDIT1, CDCS_INACTIVE);
}
Expand Down
1 change: 1 addition & 0 deletions src/mpc-hc/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,7 @@
#define IDS_PPAGEADVANCED_CAPTURE_DEINTERLACE 57643
#define IDS_PLAYLIST_TOGGLE_SHUFFLE 57644
#define IDS_AUDIOSHIFT_ONOFF 57645
#define IDS_SAVEDIALOG_INCLUDE_SUBS 57646


#define IDS_ARS_WASAPI_MODE 57700
Expand Down

0 comments on commit 1815ead

Please sign in to comment.