Release KSwitcher v0.6.72 with dedicated settings tabs
This commit is contained in:
1 parent
3cb2eee637
commit
12fdd7c549
12 files changed
+339
-201
No files matched your search
@@ -800,12 +800,52 @@ int main(int argc, char **argv) {
|
||||
require(fitted.left==0&&fitted.top==0&&fitted.right==1200&&fitted.bottom==800,"oversized disconnected-monitor window fits work area");
|
||||
fitted=ks::fitWindowRect({2000,2000,2600,2400},{-1920,0,0,1080});
|
||||
require(fitted.left==-600&&fitted.top==680&&fitted.right==0,"negative-coordinate monitor supported");
|
||||
// The fixture has a message-only window and no keyboard hook.
|
||||
app.settings.toggle = app.settings.casing = app.settings.translit =
|
||||
app.settings.undo = app.settings.clipboard = app.settings.screenshot = L"";
|
||||
std::fill(app.settings.direct.begin(), app.settings.direct.end(), L"");
|
||||
ks::showSettings(app,false);
|
||||
{
|
||||
auto settings = app.settingsWindow;
|
||||
auto tabs = GetDlgItem(settings, 260);
|
||||
auto capture = GetDlgItem(settings, 737);
|
||||
auto events = GetDlgItem(settings, 733);
|
||||
auto visible = [&](int id) { return (GetWindowLongPtrW(GetDlgItem(settings, id), GWL_STYLE) & WS_VISIBLE) != 0; };
|
||||
auto selectPage = [&](int index) {
|
||||
TabCtrl_SetCurSel(tabs, index);
|
||||
NMHDR changed{tabs, 260, TCN_SELCHANGE};
|
||||
SendMessageW(settings, WM_NOTIFY, 260, reinterpret_cast<LPARAM>(&changed));
|
||||
};
|
||||
RECT lastTab{}, tabClient{};
|
||||
GetClientRect(tabs, &tabClient);
|
||||
require(TabCtrl_GetItemCount(tabs) == 9 && TabCtrl_GetItemRect(tabs, 8, &lastTab) &&
|
||||
lastTab.right <= tabClient.right, "all Settings tabs fit in one row");
|
||||
selectPage(3);
|
||||
require(visible(257) && !visible(301), "OCR options are in Clipboard");
|
||||
selectPage(6);
|
||||
require(visible(258) && !visible(262), "Sync has its own tab");
|
||||
selectPage(7);
|
||||
require(visible(262) && !visible(258), "Computers has its own tab");
|
||||
selectPage(8);
|
||||
require(visible(208) && visible(256), "logging controls are in Diagnostics");
|
||||
selectPage(4);
|
||||
require(visible(301) && visible(303) && visible(318), "Snippets has an inline editor and its own Save button");
|
||||
const bool awake = app.settings.awake;
|
||||
SendDlgItemMessageW(settings, 205, BM_SETCHECK, awake ? BST_UNCHECKED : BST_CHECKED, 0);
|
||||
SendMessageW(settings, WM_COMMAND, 310, 0);
|
||||
SetDlgItemTextW(settings, 302, L";inline-fixture");
|
||||
SetDlgItemTextW(settings, 303, L"inline snippet");
|
||||
selectPage(0);
|
||||
selectPage(4);
|
||||
SendMessageW(settings, WM_COMMAND, 318, 0);
|
||||
require(app.settings.awake == awake && IsWindowEnabled(GetDlgItem(settings, IDOK)) &&
|
||||
std::any_of(app.settings.snippets.begin(), app.settings.snippets.end(), [](const ks::Snippet &snippet) {
|
||||
return snippet.trigger == L";inline-fixture" && snippet.text == L"inline snippet";
|
||||
}), "saving inline snippets preserves the unsaved settings draft across tab changes");
|
||||
SendDlgItemMessageW(settings, 205, BM_SETCHECK, awake ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
SendMessageW(settings, WM_COMMAND, 311, 0);
|
||||
SendMessageW(settings, WM_COMMAND, 318, 0);
|
||||
selectPage(0);
|
||||
require(!(GetWindowLongPtrW(capture, GWL_STYLE) & WS_VISIBLE),
|
||||
"mouse detection is hidden on General");
|
||||
TabCtrl_SetCurSel(tabs, 5);
|
||||
|
||||
Reference in new issue
Block a user