Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/modules/ZoomIt/ZoomIt/Zoomit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6023,6 +6023,12 @@ LRESULT APIENTRY MainWndProc(
// Apply tray icon setting
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
UnregisterAllHotkeys(hWnd);
g_ToggleMod = GetKeyMod(g_ToggleKey);
Expand Down
10 changes: 8 additions & 2 deletions src/modules/ZoomIt/ZoomItSettingsInterop/ZoomItSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,12 @@ namespace winrt::PowerToys::ZoomItSettingsInterop::implementation
}
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));
_settings.add_property(curSetting->ValueName, s);
*/
}
}
break;
Expand Down Expand Up @@ -211,6 +214,9 @@ namespace winrt::PowerToys::ZoomItSettingsInterop::implementation
}
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);
if (possibleValue.has_value())
{
Expand All @@ -219,8 +225,8 @@ namespace winrt::PowerToys::ZoomItSettingsInterop::implementation
{
*static_cast<PDWORD>(curSetting->Setting) = RGB(r, g, b);
}

}
*/
}
}
break;
Expand Down
16 changes: 0 additions & 16 deletions src/settings-ui/Settings.UI.Library/ZoomItProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ public ZoomItProperties()

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 StringProperty Font { get; set; }
Expand Down Expand Up @@ -80,24 +74,14 @@ public ZoomItProperties()

public BoolProperty BreakShowDesktop { get; set; }

public BoolProperty BreakOnSecondary { get; set; }

public IntProperty FontScale { get; set; }

public BoolProperty ShowExpiredTime { get; set; }

public BoolProperty ShowTrayIcon { get; set; }

public BoolProperty AnimnateZoom { get; set; }

public BoolProperty TelescopeZoomOut { get; set; }

public BoolProperty SnapToGrid { get; set; }

public IntProperty ZoominSliderLevel { get; set; }

public IntProperty RecordFrameRate { get; set; }

public IntProperty RecordScaling { get; set; }

public BoolProperty CaptureAudio { get; set; }
Expand Down
Loading