mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-05 04:39:08 +08:00
Spelling: ... common (#3781)
* spelling: alignment * spelling: awareness * spelling: background * spelling: bottom * spelling: buttons * spelling: comparison * spelling: cortana * spelling: exiting * spelling: initialization * spelling: middle * spelling: properly * spelling: succeeded * spelling: unknown
This commit is contained in:
parent
ecb5d2ae1c
commit
c2c163ac4e
@ -13,7 +13,7 @@ namespace UnitTestsVersionHelper
|
|||||||
TEST_CLASS (UnitTestsVersionHelper)
|
TEST_CLASS (UnitTestsVersionHelper)
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TEST_METHOD (integerConstructorShouldProprelyInitializateVersionNumbers)
|
TEST_METHOD (integerConstructorShouldProperlyInitializationVersionNumbers)
|
||||||
{
|
{
|
||||||
VersionHelper sut(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
VersionHelper sut(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ namespace UnitTestsVersionHelper
|
|||||||
Assert::AreEqual(MINOR_VERSION_12, sut.minor);
|
Assert::AreEqual(MINOR_VERSION_12, sut.minor);
|
||||||
Assert::AreEqual(REVISION_VERSION_0, sut.revision);
|
Assert::AreEqual(REVISION_VERSION_0, sut.revision);
|
||||||
}
|
}
|
||||||
TEST_METHOD (integerConstructorShouldProprelyInitializateWithDifferentVersionNumbers)
|
TEST_METHOD (integerConstructorShouldProperlyInitializationWithDifferentVersionNumbers)
|
||||||
{
|
{
|
||||||
const int testcaseMajor = 2;
|
const int testcaseMajor = 2;
|
||||||
const int testcaseMinor = 25;
|
const int testcaseMinor = 25;
|
||||||
@ -32,7 +32,7 @@ namespace UnitTestsVersionHelper
|
|||||||
Assert::AreEqual(testcaseMinor, sut.minor);
|
Assert::AreEqual(testcaseMinor, sut.minor);
|
||||||
Assert::AreEqual(testcaseRevision, sut.revision);
|
Assert::AreEqual(testcaseRevision, sut.revision);
|
||||||
}
|
}
|
||||||
TEST_METHOD (stringConstructorShouldProprelyInitializateVersionNumbers)
|
TEST_METHOD (stringConstructorShouldProperlyInitializationVersionNumbers)
|
||||||
{
|
{
|
||||||
VersionHelper sut("v0.12.3");
|
VersionHelper sut("v0.12.3");
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ namespace UnitTestsVersionHelper
|
|||||||
Assert::AreEqual(12, sut.minor);
|
Assert::AreEqual(12, sut.minor);
|
||||||
Assert::AreEqual(3, sut.revision);
|
Assert::AreEqual(3, sut.revision);
|
||||||
}
|
}
|
||||||
TEST_METHOD (stringConstructorShouldProprelyInitializateWithDifferentVersionNumbers)
|
TEST_METHOD (stringConstructorShouldProperlyInitializationWithDifferentVersionNumbers)
|
||||||
{
|
{
|
||||||
VersionHelper sut("v2.25.1");
|
VersionHelper sut("v2.25.1");
|
||||||
|
|
||||||
@ -48,28 +48,28 @@ namespace UnitTestsVersionHelper
|
|||||||
Assert::AreEqual(25, sut.minor);
|
Assert::AreEqual(25, sut.minor);
|
||||||
Assert::AreEqual(1, sut.revision);
|
Assert::AreEqual(1, sut.revision);
|
||||||
}
|
}
|
||||||
TEST_METHOD (whenMajorVersionIsGreaterComparationOperatorShouldReturnProperValue)
|
TEST_METHOD (whenMajorVersionIsGreaterComparisonOperatorShouldReturnProperValue)
|
||||||
{
|
{
|
||||||
VersionHelper lhs(MAJOR_VERSION_0 + 1, MINOR_VERSION_12, REVISION_VERSION_0);
|
VersionHelper lhs(MAJOR_VERSION_0 + 1, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||||
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||||
|
|
||||||
Assert::IsTrue(lhs > rhs);
|
Assert::IsTrue(lhs > rhs);
|
||||||
}
|
}
|
||||||
TEST_METHOD (whenMajorVersionIsLesserComparationOperatorShouldReturnProperValue)
|
TEST_METHOD (whenMajorVersionIsLesserComparisonOperatorShouldReturnProperValue)
|
||||||
{
|
{
|
||||||
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||||
VersionHelper rhs(MAJOR_VERSION_0 + 1, MINOR_VERSION_12, REVISION_VERSION_0);
|
VersionHelper rhs(MAJOR_VERSION_0 + 1, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||||
|
|
||||||
Assert::IsFalse(lhs > rhs);
|
Assert::IsFalse(lhs > rhs);
|
||||||
}
|
}
|
||||||
TEST_METHOD (whenMajorVersionIsEqualComparationOperatorShouldCompareMinorVersionValue)
|
TEST_METHOD (whenMajorVersionIsEqualComparisonOperatorShouldCompareMinorVersionValue)
|
||||||
{
|
{
|
||||||
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||||
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12 - 1, REVISION_VERSION_0);
|
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12 - 1, REVISION_VERSION_0);
|
||||||
|
|
||||||
Assert::IsTrue(lhs > rhs);
|
Assert::IsTrue(lhs > rhs);
|
||||||
}
|
}
|
||||||
TEST_METHOD (whenMajorVersionIsEqualComparationOperatorShouldCompareMinorVersionValue2)
|
TEST_METHOD (whenMajorVersionIsEqualComparisonOperatorShouldCompareMinorVersionValue2)
|
||||||
{
|
{
|
||||||
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12 - 1, REVISION_VERSION_0);
|
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12 - 1, REVISION_VERSION_0);
|
||||||
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||||
@ -77,14 +77,14 @@ namespace UnitTestsVersionHelper
|
|||||||
Assert::IsFalse(lhs > rhs);
|
Assert::IsFalse(lhs > rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_METHOD (whenMajorAndMinorVersionIsEqualComparationOperatorShouldCompareRevisionValue)
|
TEST_METHOD (whenMajorAndMinorVersionIsEqualComparisonOperatorShouldCompareRevisionValue)
|
||||||
{
|
{
|
||||||
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0 + 1);
|
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0 + 1);
|
||||||
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||||
|
|
||||||
Assert::IsTrue(lhs > rhs);
|
Assert::IsTrue(lhs > rhs);
|
||||||
}
|
}
|
||||||
TEST_METHOD (whenMajorAndMinorVersionIsEqualComparationOperatorShouldCompareRevisionValue2)
|
TEST_METHOD (whenMajorAndMinorVersionIsEqualComparisonOperatorShouldCompareRevisionValue2)
|
||||||
{
|
{
|
||||||
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||||
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0 + 1);
|
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0 + 1);
|
||||||
|
@ -171,17 +171,17 @@ ShortcutGuideFilter get_shortcutguide_filtered_window()
|
|||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
static HWND cortanda_hwnd = nullptr;
|
static HWND cortana_hwnd = nullptr;
|
||||||
if (cortanda_hwnd == nullptr)
|
if (cortana_hwnd == nullptr)
|
||||||
{
|
{
|
||||||
if (strcmp(class_name.data(), "Windows.UI.Core.CoreWindow") == 0 &&
|
if (strcmp(class_name.data(), "Windows.UI.Core.CoreWindow") == 0 &&
|
||||||
get_process_path(active_window).ends_with(L"SearchUI.exe"))
|
get_process_path(active_window).ends_with(L"SearchUI.exe"))
|
||||||
{
|
{
|
||||||
cortanda_hwnd = active_window;
|
cortana_hwnd = active_window;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cortanda_hwnd == active_window)
|
else if (cortana_hwnd == active_window)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -321,7 +321,7 @@ WindowState get_window_state(HWND hwnd)
|
|||||||
|
|
||||||
if (GetWindowPlacement(hwnd, &placement) == 0)
|
if (GetWindowPlacement(hwnd, &placement) == 0)
|
||||||
{
|
{
|
||||||
return UNKNONW;
|
return UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (placement.showCmd == SW_MINIMIZE || placement.showCmd == SW_SHOWMINIMIZED || IsIconic(hwnd))
|
if (placement.showCmd == SW_MINIMIZE || placement.showCmd == SW_SHOWMINIMIZED || IsIconic(hwnd))
|
||||||
@ -337,7 +337,7 @@ WindowState get_window_state(HWND hwnd)
|
|||||||
auto rectp = get_window_pos(hwnd);
|
auto rectp = get_window_pos(hwnd);
|
||||||
if (!rectp)
|
if (!rectp)
|
||||||
{
|
{
|
||||||
return UNKNONW;
|
return UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto rect = *rectp;
|
auto rect = *rectp;
|
||||||
@ -511,7 +511,7 @@ bool run_non_elevated(const std::wstring& file, const std::wstring& params, DWOR
|
|||||||
siex.StartupInfo.cb = sizeof(siex);
|
siex.StartupInfo.cb = sizeof(siex);
|
||||||
|
|
||||||
PROCESS_INFORMATION process_info = { 0 };
|
PROCESS_INFORMATION process_info = { 0 };
|
||||||
auto succedded = CreateProcessW(file.c_str(),
|
auto succeeded = CreateProcessW(file.c_str(),
|
||||||
const_cast<LPWSTR>(executable_args.c_str()),
|
const_cast<LPWSTR>(executable_args.c_str()),
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
@ -535,7 +535,7 @@ bool run_non_elevated(const std::wstring& file, const std::wstring& params, DWOR
|
|||||||
{
|
{
|
||||||
CloseHandle(process_info.hThread);
|
CloseHandle(process_info.hThread);
|
||||||
}
|
}
|
||||||
return succedded;
|
return succeeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool run_same_elevation(const std::wstring& file, const std::wstring& params)
|
bool run_same_elevation(const std::wstring& file, const std::wstring& params)
|
||||||
@ -547,7 +547,7 @@ bool run_same_elevation(const std::wstring& file, const std::wstring& params)
|
|||||||
}
|
}
|
||||||
STARTUPINFO si = { 0 };
|
STARTUPINFO si = { 0 };
|
||||||
PROCESS_INFORMATION pi = { 0 };
|
PROCESS_INFORMATION pi = { 0 };
|
||||||
auto succedded = CreateProcessW(file.c_str(),
|
auto succeeded = CreateProcessW(file.c_str(),
|
||||||
const_cast<LPWSTR>(executable_args.c_str()),
|
const_cast<LPWSTR>(executable_args.c_str()),
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
@ -565,7 +565,7 @@ bool run_same_elevation(const std::wstring& file, const std::wstring& params)
|
|||||||
{
|
{
|
||||||
CloseHandle(pi.hThread);
|
CloseHandle(pi.hThread);
|
||||||
}
|
}
|
||||||
return succedded;
|
return succeeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring get_process_path(HWND window) noexcept
|
std::wstring get_process_path(HWND window) noexcept
|
||||||
|
@ -47,7 +47,7 @@ void show_last_error_message(LPCWSTR lpszFunction, DWORD dw);
|
|||||||
|
|
||||||
enum WindowState
|
enum WindowState
|
||||||
{
|
{
|
||||||
UNKNONW,
|
UNKNOWN,
|
||||||
MINIMIZED,
|
MINIMIZED,
|
||||||
MAXIMIZED,
|
MAXIMIZED,
|
||||||
SNAPED_TOP_LEFT,
|
SNAPED_TOP_LEFT,
|
||||||
|
@ -24,19 +24,19 @@ D2DText& D2DText::resize(float text_size, float scale)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
D2DText& D2DText::set_aligment_left()
|
D2DText& D2DText::set_alignment_left()
|
||||||
{
|
{
|
||||||
winrt::check_hresult(format->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
|
winrt::check_hresult(format->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
D2DText& D2DText::set_aligment_center()
|
D2DText& D2DText::set_alignment_center()
|
||||||
{
|
{
|
||||||
winrt::check_hresult(format->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER));
|
winrt::check_hresult(format->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
D2DText& D2DText::set_aligment_right()
|
D2DText& D2DText::set_alignment_right()
|
||||||
{
|
{
|
||||||
winrt::check_hresult(format->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_TRAILING));
|
winrt::check_hresult(format->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_TRAILING));
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -7,9 +7,9 @@ class D2DText
|
|||||||
public:
|
public:
|
||||||
D2DText(float text_size = 15.0f, float scale = 1.0f);
|
D2DText(float text_size = 15.0f, float scale = 1.0f);
|
||||||
D2DText& resize(float text_size, float scale);
|
D2DText& resize(float text_size, float scale);
|
||||||
D2DText& set_aligment_left();
|
D2DText& set_alignment_left();
|
||||||
D2DText& set_aligment_center();
|
D2DText& set_alignment_center();
|
||||||
D2DText& set_aligment_right();
|
D2DText& set_alignment_right();
|
||||||
void write(ID2D1DeviceContext5* d2d_dc, D2D1_COLOR_F color, D2D1_RECT_F rect, std::wstring text);
|
void write(ID2D1DeviceContext5* d2d_dc, D2D1_COLOR_F color, D2D1_RECT_F rect, std::wstring text);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -56,7 +56,7 @@ namespace DPIAware
|
|||||||
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
||||||
}
|
}
|
||||||
|
|
||||||
AwarnessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value)
|
AwarenessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value)
|
||||||
{
|
{
|
||||||
const std::array levels{ DPI_AWARENESS_CONTEXT_UNAWARE,
|
const std::array levels{ DPI_AWARENESS_CONTEXT_UNAWARE,
|
||||||
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE,
|
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE,
|
||||||
@ -67,9 +67,9 @@ namespace DPIAware
|
|||||||
{
|
{
|
||||||
if (AreDpiAwarenessContextsEqual(levels[i], system_returned_value))
|
if (AreDpiAwarenessContextsEqual(levels[i], system_returned_value))
|
||||||
{
|
{
|
||||||
return static_cast<AwarnessLevel>(i);
|
return static_cast<AwarenessLevel>(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AwarnessLevel::UNAWARE;
|
return AwarenessLevel::UNAWARE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ namespace DPIAware
|
|||||||
void Convert(HMONITOR monitor_handle, int& width, int& height);
|
void Convert(HMONITOR monitor_handle, int& width, int& height);
|
||||||
void EnableDPIAwarenessForThisProcess();
|
void EnableDPIAwarenessForThisProcess();
|
||||||
|
|
||||||
enum AwarnessLevel
|
enum AwarenessLevel
|
||||||
{
|
{
|
||||||
UNAWARE,
|
UNAWARE,
|
||||||
SYSTEM_AWARE,
|
SYSTEM_AWARE,
|
||||||
@ -18,5 +18,5 @@ namespace DPIAware
|
|||||||
PER_MONITOR_AWARE_V2,
|
PER_MONITOR_AWARE_V2,
|
||||||
UNAWARE_GDISCALED
|
UNAWARE_GDISCALED
|
||||||
};
|
};
|
||||||
AwarnessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value);
|
AwarenessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value);
|
||||||
};
|
};
|
||||||
|
@ -20,7 +20,7 @@ struct ScreenSize
|
|||||||
POINT middle() const { return { rect.left + width() / 2, rect.top + height() / 2 }; };
|
POINT middle() const { return { rect.left + width() / 2, rect.top + height() / 2 }; };
|
||||||
POINT middle_right() const { return { rect.right, rect.top + height() / 2 }; };
|
POINT middle_right() const { return { rect.right, rect.top + height() / 2 }; };
|
||||||
POINT bottom_left() const { return { rect.left, rect.bottom }; };
|
POINT bottom_left() const { return { rect.left, rect.bottom }; };
|
||||||
POINT bottm_midle() const { return { rect.left + width() / 2, rect.bottom }; };
|
POINT bottom_middle() const { return { rect.left + width() / 2, rect.bottom }; };
|
||||||
POINT bottom_right() const { return { rect.right, rect.bottom }; };
|
POINT bottom_right() const { return { rect.right, rect.bottom }; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public:
|
|||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
auto dispatcher = reinterpret_cast<decltype(dispatch_to_backround_handler)*>(GetProcAddress(lib, "dispatch_to_backround_handler"));
|
auto dispatcher = reinterpret_cast<decltype(dispatch_to_background_handler)*>(GetProcAddress(lib, "dispatch_to_background_handler"));
|
||||||
if (!dispatcher)
|
if (!dispatcher)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -3,4 +3,4 @@ DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
|
|||||||
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
|
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
|
||||||
DllRegisterServer PRIVATE
|
DllRegisterServer PRIVATE
|
||||||
DllUnregisterServer PRIVATE
|
DllUnregisterServer PRIVATE
|
||||||
dispatch_to_backround_handler PRIVATE
|
dispatch_to_background_handler PRIVATE
|
@ -17,6 +17,6 @@ namespace winrt::PowerToysNotifications::implementation
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch_to_backround_handler(details.Argument());
|
dispatch_to_background_handler(details.Argument());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace
|
|||||||
const std::unordered_map<std::wstring_view, handler_function_t> handlers_map;
|
const std::unordered_map<std::wstring_view, handler_function_t> handlers_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dispatch_to_backround_handler(std::wstring_view argument)
|
void dispatch_to_background_handler(std::wstring_view argument)
|
||||||
{
|
{
|
||||||
winrt::Windows::Foundation::WwwFormUrlDecoder decoder{ argument };
|
winrt::Windows::Foundation::WwwFormUrlDecoder decoder{ argument };
|
||||||
|
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
void dispatch_to_backround_handler(std::wstring_view argument);
|
void dispatch_to_background_handler(std::wstring_view argument);
|
||||||
|
@ -44,8 +44,8 @@ bool Tasklist::update_buttons(std::vector<TasklistButton>& buttons)
|
|||||||
if (elements->get_Length(&count) < 0)
|
if (elements->get_Length(&count) < 0)
|
||||||
return false;
|
return false;
|
||||||
winrt::com_ptr<IUIAutomationElement> child;
|
winrt::com_ptr<IUIAutomationElement> child;
|
||||||
std::vector<TasklistButton> found_butttons;
|
std::vector<TasklistButton> found_buttons;
|
||||||
found_butttons.reserve(count);
|
found_buttons.reserve(count);
|
||||||
for (int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
child = nullptr;
|
child = nullptr;
|
||||||
@ -82,11 +82,11 @@ bool Tasklist::update_buttons(std::vector<TasklistButton>& buttons)
|
|||||||
button.name = automation_id;
|
button.name = automation_id;
|
||||||
SysFreeString(automation_id);
|
SysFreeString(automation_id);
|
||||||
}
|
}
|
||||||
found_butttons.push_back(button);
|
found_buttons.push_back(button);
|
||||||
}
|
}
|
||||||
// assign keynums
|
// assign keynums
|
||||||
buttons.clear();
|
buttons.clear();
|
||||||
for (auto& button : found_butttons)
|
for (auto& button : found_buttons)
|
||||||
{
|
{
|
||||||
if (buttons.empty())
|
if (buttons.empty())
|
||||||
{
|
{
|
||||||
|
@ -422,7 +422,7 @@ void TwoWayPipeMessageIPC::TwoWayPipeMessageIPCImpl::handle_pipe_connection(HAND
|
|||||||
|
|
||||||
HeapFree(hHeap, 0, pchRequest);
|
HeapFree(hHeap, 0, pchRequest);
|
||||||
|
|
||||||
printf("InstanceThread exitting.\n");
|
printf("InstanceThread exiting.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TwoWayPipeMessageIPC::TwoWayPipeMessageIPCImpl::start_named_pipe_server(HANDLE token)
|
void TwoWayPipeMessageIPC::TwoWayPipeMessageIPCImpl::start_named_pipe_server(HANDLE token)
|
||||||
|
@ -18,7 +18,7 @@ namespace UnitTests_PreviewHandlerCommon
|
|||||||
{ }
|
{ }
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void FormHandlerControl_ShouldCreateHandle_OnIntialization()
|
public void FormHandlerControl_ShouldCreateHandle_OnInitialization()
|
||||||
{
|
{
|
||||||
// Arrange and act
|
// Arrange and act
|
||||||
using (var testFormHandlerControl = new TestFormControl())
|
using (var testFormHandlerControl = new TestFormControl())
|
||||||
@ -29,7 +29,7 @@ namespace UnitTests_PreviewHandlerCommon
|
|||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void FormHandlerControl_ShouldSetVisibleFalse_OnIntialization()
|
public void FormHandlerControl_ShouldSetVisibleFalse_OnInitialization()
|
||||||
{
|
{
|
||||||
// Arrange and act
|
// Arrange and act
|
||||||
using (var testFormHandlerControl = new TestFormControl())
|
using (var testFormHandlerControl = new TestFormControl())
|
||||||
@ -40,7 +40,7 @@ namespace UnitTests_PreviewHandlerCommon
|
|||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void FormHandlerControl_ShouldSetFormBorderStyle_OnIntialization()
|
public void FormHandlerControl_ShouldSetFormBorderStyle_OnInitialization()
|
||||||
{
|
{
|
||||||
// Arrange and act
|
// Arrange and act
|
||||||
using (var testFormHandlerControl = new TestFormControl())
|
using (var testFormHandlerControl = new TestFormControl())
|
||||||
|
@ -751,7 +751,7 @@ void D2DOverlayWindow::render(ID2D1DeviceContext5* d2d_dc)
|
|||||||
if (!minature_shown && window_state != MINIMIZED)
|
if (!minature_shown && window_state != MINIMIZED)
|
||||||
{
|
{
|
||||||
no_active.render(d2d_dc);
|
no_active.render(d2d_dc);
|
||||||
window_state = UNKNONW;
|
window_state = UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the animation - move the draw window according to animation step
|
// Set the animation - move the draw window according to animation step
|
||||||
@ -864,13 +864,13 @@ void D2DOverlayWindow::render(ID2D1DeviceContext5* d2d_dc)
|
|||||||
}
|
}
|
||||||
auto text_color = D2D1::ColorF(light_mode ? 0x222222 : 0xDDDDDD, active_window_snappable && (minature_shown || window_state == MINIMIZED) ? 1.0f : 0.3f);
|
auto text_color = D2D1::ColorF(light_mode ? 0x222222 : 0xDDDDDD, active_window_snappable && (minature_shown || window_state == MINIMIZED) ? 1.0f : 0.3f);
|
||||||
use_overlay->find_element(L"KeyUpGroup")->SetAttributeValue(L"fill-opacity", up_disabled ? 0.3f : 1.0f);
|
use_overlay->find_element(L"KeyUpGroup")->SetAttributeValue(L"fill-opacity", up_disabled ? 0.3f : 1.0f);
|
||||||
text.set_aligment_center().write(d2d_dc, text_color, use_overlay->get_maximize_label(), up);
|
text.set_alignment_center().write(d2d_dc, text_color, use_overlay->get_maximize_label(), up);
|
||||||
use_overlay->find_element(L"KeyDownGroup")->SetAttributeValue(L"fill-opacity", down_disabled ? 0.3f : 1.0f);
|
use_overlay->find_element(L"KeyDownGroup")->SetAttributeValue(L"fill-opacity", down_disabled ? 0.3f : 1.0f);
|
||||||
text.write(d2d_dc, text_color, use_overlay->get_minimize_label(), down);
|
text.write(d2d_dc, text_color, use_overlay->get_minimize_label(), down);
|
||||||
use_overlay->find_element(L"KeyLeftGroup")->SetAttributeValue(L"fill-opacity", left_disabled ? 0.3f : 1.0f);
|
use_overlay->find_element(L"KeyLeftGroup")->SetAttributeValue(L"fill-opacity", left_disabled ? 0.3f : 1.0f);
|
||||||
text.set_aligment_right().write(d2d_dc, text_color, use_overlay->get_snap_left(), left);
|
text.set_alignment_right().write(d2d_dc, text_color, use_overlay->get_snap_left(), left);
|
||||||
use_overlay->find_element(L"KeyRightGroup")->SetAttributeValue(L"fill-opacity", right_disabled ? 0.3f : 1.0f);
|
use_overlay->find_element(L"KeyRightGroup")->SetAttributeValue(L"fill-opacity", right_disabled ? 0.3f : 1.0f);
|
||||||
text.set_aligment_left().write(d2d_dc, text_color, use_overlay->get_snap_right(), right);
|
text.set_alignment_left().write(d2d_dc, text_color, use_overlay->get_snap_right(), right);
|
||||||
// ... and the arrows with numbers
|
// ... and the arrows with numbers
|
||||||
for (auto&& button : tasklist_buttons)
|
for (auto&& button : tasklist_buttons)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user