mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 02:06:36 +02:00
[File Explorer Add-ons] Fix file preview pane flickering on file selection and resizing (#26660)
* Move color values to constant * Fix MonacoPreview flickering on file selection and resizing * Fix MarkdownPreview flickering on file selection and resizing * Fix SvgPreview flickering on file selection and resizing * Create Settings class and standardize background setting for MarkdownPreview * Replace ColorTranslator.FromHtml with Color.FromArgb for constant color settings * Use existing SetBackground * Remove duplicate GetTheme function * Update src/modules/previewpane/MarkdownPreviewHandler/Settings.cs
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "MonacoPreviewHandler.h"
|
||||
#include "../powerpreview/powerpreviewConstants.h"
|
||||
|
||||
#include <shellapi.h>
|
||||
#include <Shlwapi.h>
|
||||
@@ -9,6 +10,7 @@
|
||||
#include <common/logger/logger.h>
|
||||
#include <common/SettingsAPI/settings_helpers.h>
|
||||
#include <common/utils/process_path.h>
|
||||
#include <common/Themes/windows_colors.h>
|
||||
|
||||
extern HINSTANCE g_hInst;
|
||||
extern long g_cDllRef;
|
||||
@@ -202,6 +204,8 @@ IFACEMETHODIMP MonacoPreviewHandler::Unload()
|
||||
|
||||
IFACEMETHODIMP MonacoPreviewHandler::SetBackgroundColor(COLORREF color)
|
||||
{
|
||||
HBRUSH brush = CreateSolidBrush(WindowsColors::is_dark_mode() ? powerpreviewConstants::DARK_THEME_COLOR : powerpreviewConstants::LIGHT_THEME_COLOR);
|
||||
SetClassLongPtr(m_hwndParent, GCLP_HBRBACKGROUND, reinterpret_cast<LONG_PTR>(brush));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user