[ZoomIt]Fix transparent draw after changing another setting (#37042)

This commit is contained in:
Jaime Bernardo 2025-01-23 23:18:13 +00:00 коммит произвёл GitHub
Родитель 0efdc94548
Коммит eeeabc82c9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 14 добавлений и 18 удалений

Просмотреть файл

@ -6023,6 +6023,12 @@ LRESULT APIENTRY MainWndProc(
// Apply tray icon setting // Apply tray icon setting
EnableDisableTrayIcon(hWnd, g_ShowTrayIcon); EnableDisableTrayIcon(hWnd, g_ShowTrayIcon);
// This is also called by ZoomIt when it starts and loads the Settings. Opacity is added after loading from registry, so we use the same pattern.
if ((g_PenColor >> 24) == 0)
{
g_PenColor |= 0xFF << 24;
}
// Apply hotkey settings // Apply hotkey settings
UnregisterAllHotkeys(hWnd); UnregisterAllHotkeys(hWnd);
g_ToggleMod = GetKeyMod(g_ToggleKey); g_ToggleMod = GetKeyMod(g_ToggleKey);

Просмотреть файл

@ -105,9 +105,12 @@ namespace winrt::PowerToys::ZoomItSettingsInterop::implementation
} }
else if (special_semantics->second == SPECIAL_SEMANTICS_COLOR) else if (special_semantics->second == SPECIAL_SEMANTICS_COLOR)
{ {
// PowerToys settings likes colors as #FFFFFF strings. /* PowerToys settings likes colors as #FFFFFF strings.
But currently these Settings are internal state for ZoomIt, not something that we really need to send Settings.
Code is kept here as a reference if a future color Setting ends up being configured.
hstring s = winrt::to_hstring(std::format("#{:02x}{:02x}{:02x}", value & 0xFF, (value >> 8) & 0xFF, (value >> 16) & 0xFF)); hstring s = winrt::to_hstring(std::format("#{:02x}{:02x}{:02x}", value & 0xFF, (value >> 8) & 0xFF, (value >> 16) & 0xFF));
_settings.add_property(curSetting->ValueName, s); _settings.add_property(curSetting->ValueName, s);
*/
} }
} }
break; break;
@ -211,6 +214,9 @@ namespace winrt::PowerToys::ZoomItSettingsInterop::implementation
} }
else if (special_semantics->second == SPECIAL_SEMANTICS_COLOR) else if (special_semantics->second == SPECIAL_SEMANTICS_COLOR)
{ {
/* PowerToys settings likes colors as #FFFFFF strings.
But currently these Settings are internal state for ZoomIt, not something that we really need to save from Settings.
Code is kept here as a reference if a future color Setting ends up being configured.
auto possibleValue = valuesFromSettings.get_string_value(curSetting->ValueName); auto possibleValue = valuesFromSettings.get_string_value(curSetting->ValueName);
if (possibleValue.has_value()) if (possibleValue.has_value())
{ {
@ -219,8 +225,8 @@ namespace winrt::PowerToys::ZoomItSettingsInterop::implementation
{ {
*static_cast<PDWORD>(curSetting->Setting) = RGB(r, g, b); *static_cast<PDWORD>(curSetting->Setting) = RGB(r, g, b);
} }
} }
*/
} }
} }
break; break;

Просмотреть файл

@ -44,12 +44,6 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public KeyboardKeysProperty SnipToggleKey { get; set; } public KeyboardKeysProperty SnipToggleKey { get; set; }
public StringProperty PenColor { get; set; }
public IntProperty PenWidth { get; set; }
public StringProperty BreakPenColor { get; set; }
public KeyboardKeysProperty BreakTimerKey { get; set; } public KeyboardKeysProperty BreakTimerKey { get; set; }
public StringProperty Font { get; set; } public StringProperty Font { get; set; }
@ -80,24 +74,14 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public BoolProperty BreakShowDesktop { get; set; } public BoolProperty BreakShowDesktop { get; set; }
public BoolProperty BreakOnSecondary { get; set; }
public IntProperty FontScale { get; set; }
public BoolProperty ShowExpiredTime { get; set; } public BoolProperty ShowExpiredTime { get; set; }
public BoolProperty ShowTrayIcon { get; set; } public BoolProperty ShowTrayIcon { get; set; }
public BoolProperty AnimnateZoom { get; set; } public BoolProperty AnimnateZoom { get; set; }
public BoolProperty TelescopeZoomOut { get; set; }
public BoolProperty SnapToGrid { get; set; }
public IntProperty ZoominSliderLevel { get; set; } public IntProperty ZoominSliderLevel { get; set; }
public IntProperty RecordFrameRate { get; set; }
public IntProperty RecordScaling { get; set; } public IntProperty RecordScaling { get; set; }
public BoolProperty CaptureAudio { get; set; } public BoolProperty CaptureAudio { get; set; }