Skip to content

Commit

Permalink
[ZoomIt]Fix transparent draw after changing another setting
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo committed Jan 23, 2025
1 parent 0efdc94 commit a9c4473
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
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

0 comments on commit a9c4473

Please sign in to comment.