Fancy zones ui update( zone numbering as numbers, dragged window transaprency option, zone coloring customization) (#1666)

* Fancy zones ui update (#4)

* Draft of numeric fancyzones with numbers

* Added support for zone color configuration, improved zone number display

* Changed order of settings to more logical

* Added option to edit zone border color

* Trancparency of dragged window, transparency of displayed zones, changed font of zone numbers

* Fix for compilation

* Some refactor

* Introduced gdiplus to draw zone and zone index

* Fix for dissappering windows

* Some fixes

* another merge fix

* another merge fix

* Unit test merge fix

* Transparency with show zones on all fix

* indentation fix

* Fix for failing test

* Changed order of color pickers

* "Zone Opacity"

* Zone opacity (%)

* Added option to turn off dragged window transparency, changed default zones color values
This commit is contained in:
PrzemyslawTusinski
2020-03-25 15:38:44 +01:00
committed by GitHub
parent b835716e36
commit f8f7fe4f33
13 changed files with 783 additions and 589 deletions

View File

@@ -36,7 +36,7 @@ private:
PCWSTR name;
bool* value;
int resourceId;
} m_configBools[9] = {
} m_configBools[10] = {
{ L"fancyzones_shiftDrag", &m_settings.shiftDrag, IDS_SETTING_DESCRIPTION_SHIFTDRAG },
{ L"fancyzones_overrideSnapHotkeys", &m_settings.overrideSnapHotkeys, IDS_SETTING_DESCRIPTION_OVERRIDE_SNAP_HOTKEYS },
{ L"fancyzones_zoneSetChange_flashZones", &m_settings.zoneSetChange_flashZones, IDS_SETTING_DESCRIPTION_ZONESETCHANGE_FLASHZONES },
@@ -46,8 +46,11 @@ private:
{ L"fancyzones_appLastZone_moveWindows", &m_settings.appLastZone_moveWindows, IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS },
{ L"use_cursorpos_editor_startupscreen", &m_settings.use_cursorpos_editor_startupscreen, IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN },
{ L"fancyzones_show_on_all_monitors", &m_settings.showZonesOnAllMonitors, IDS_SETTING_DESCRIPTION_SHOW_FANCY_ZONES_ON_ALL_MONITORS},
{ L"fancyzones_makeDraggedWindowTransparent", &m_settings.makeDraggedWindowTransparent, IDS_SETTING_DESCRIPTION_MAKE_DRAGGED_WINDOW_TRANSPARENT},
};
const std::wstring m_zoneColorName = L"fancyzones_zoneColor";
const std::wstring m_zoneBorderColorName = L"fancyzones_zoneBorderColor";
const std::wstring m_zoneHiglightName = L"fancyzones_zoneHighlightColor";
const std::wstring m_editorHotkeyName = L"fancyzones_editor_hotkey";
const std::wstring m_excludedAppsName = L"fancyzones_excluded_apps";
@@ -79,8 +82,12 @@ IFACEMETHODIMP_(bool) FancyZonesSettings::GetConfig(_Out_ PWSTR buffer, _Out_ in
settings.add_bool_toogle(setting.name, setting.resourceId, *setting.value);
}
settings.add_int_spinner(m_zoneHighlightOpacity, IDS_SETTINGS_HIGHLIGHT_OPACITY, m_settings.zoneHighlightOpacity, 0, 100, 1);
settings.add_color_picker(m_zoneHiglightName, IDS_SETTING_DESCRIPTION_ZONEHIGHLIGHTCOLOR, m_settings.zoneHightlightColor);
settings.add_color_picker(m_zoneColorName, IDS_SETTING_DESCRIPTION_ZONECOLOR, m_settings.zoneColor);
settings.add_color_picker(m_zoneBorderColorName, IDS_SETTING_DESCRIPTION_ZONE_BORDER_COLOR, m_settings.zoneBorderColor);
settings.add_int_spinner(m_zoneHighlightOpacity, IDS_SETTINGS_HIGHLIGHT_OPACITY, m_settings.zoneHighlightOpacity, 0, 100, 1);
settings.add_multiline_string(m_excludedAppsName, IDS_SETTING_EXCLCUDED_APPS_DESCRIPTION, m_settings.excludedApps);
return settings.serialize_to_buffer(buffer, buffer_size);
@@ -125,6 +132,16 @@ void FancyZonesSettings::LoadSettings(PCWSTR config, bool fromFile) noexcept try
}
}
if (auto val = values.get_string_value(m_zoneColorName))
{
m_settings.zoneColor = std::move(*val);
}
if (auto val = values.get_string_value(m_zoneBorderColorName))
{
m_settings.zoneBorderColor = std::move(*val);
}
if (auto val = values.get_string_value(m_zoneHiglightName))
{
m_settings.zoneHightlightColor = std::move(*val);
@@ -174,6 +191,8 @@ void FancyZonesSettings::SaveSettings() noexcept try
values.add_property(setting.name, *setting.value);
}
values.add_property(m_zoneColorName, m_settings.zoneColor);
values.add_property(m_zoneBorderColorName, m_settings.zoneBorderColor);
values.add_property(m_zoneHiglightName, m_settings.zoneHightlightColor);
values.add_property(m_zoneHighlightOpacity, m_settings.zoneHighlightOpacity);
values.add_property(m_editorHotkeyName, m_settings.editorHotkey.get_json());