Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49ad7104fe | ||
|
|
cc6615cb74 | ||
|
|
66a69aa706 | ||
|
|
626fb685e5 | ||
|
|
8538c595e1 | ||
|
|
7f54f12bf2 |
No files matched your search
+1
-1
@@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
project(KSwitcher VERSION 0.6.95 LANGUAGES CXX RC)
|
||||
project(KSwitcher VERSION 0.6.97 LANGUAGES CXX RC)
|
||||
if(NOT WIN32)
|
||||
message(FATAL_ERROR "KSwitcher uses native Windows APIs")
|
||||
endif()
|
||||
|
||||
@@ -36,11 +36,14 @@ Warning і початковий фокус на No.
|
||||
- У головному вікні клавіатурний фокус залишається в командному рядку.
|
||||
Tab перемикає активну панель, клік вибирає рядок, а стрілки вгору й вниз,
|
||||
Page Up і Page Down пересувають курсор у панелі навіть під час набору команди.
|
||||
Клік оновлює підсвічування рядків курсора без перемальовування всієї панелі.
|
||||
Меню й діалоги тимчасово приймають фокус. Ctrl+V і Shift+Insert вставляють
|
||||
текст із буфера обміну в позицію курсора або замінюють виділення.
|
||||
Enter запускає введену команду або відкриває поточний елемент, якщо рядок
|
||||
порожній. Escape очищає рядок.
|
||||
Промпт і текст команди вирівняні по спільній базовій лінії.
|
||||
- **F8 Delete** у нижньому рядку клавіш викликає той самий діалог видалення,
|
||||
що й клавіша F8.
|
||||
- У віддаленій панелі Enter запускає введену команду PowerShell на
|
||||
спареному ПК в поточному каталозі цієї панелі. Вивід і код завершення
|
||||
з’являються в терміналі Files як текст. Службовий прогрес PowerShell
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,17 @@
|
||||
# Latest Windows release
|
||||
|
||||
## v0.6.97 — 2026-11-16
|
||||
|
||||
KSwitcher Files clears the highlight from the previous cursor row after a selection change and highlights the new row. It keeps the targeted repaint introduced in v0.6.96. This release replaces v0.6.96.
|
||||
|
||||
**Українською.** KSwitcher Files знімає підсвічування з попереднього рядка курсора після зміни вибору й виділяє новий рядок. Панель і далі перемальовує лише потрібні рядки. Цей реліз замінює v0.6.96.
|
||||
|
||||
## v0.6.96 — 2026-11-16
|
||||
|
||||
Clicking a file row in Files now redraws only the affected cursor rows, including when switching panes. The key bar adds **F8 Delete**, which opens the same confirmation as pressing F8.
|
||||
|
||||
**Українською.** Клік по рядку у Files перемальовує лише рядки курсора, зокрема при переході на іншу панель. У нижньому рядку клавіш є **F8 Delete**, що відкриває той самий діалог підтвердження, що й клавіша F8.
|
||||
|
||||
## v0.6.95 — 2026-11-16
|
||||
|
||||
Files shows Markdown after rendering completes, refreshes local previews when the file changes on disk, and opens internal links in the same window. Shift+click opens a separate window. The arrow controls, mouse side buttons and Alt+Left/Right navigate history. Ctrl+W closes the viewer. Ctrl+Tab cycles through Files and its open editors and viewers. Up and Down wrap in Files menus and drop-downs. Manual and LAN updates close Files, editors, Settings and bundled StayHere from the target installation before replacing its files. Save open work before updating. When installing this release with an older updater, close Files and its separate windows first. This release replaces v0.6.94.
|
||||
|
||||
@@ -1 +1 @@
|
||||
22bda6ae5555a48bc23aeda7dafe6b132f22be17f0f4979f5e9cc83b366ea3ea KSwitcher-win-x64.zip
|
||||
25ed8a7d3920b1d85f09271f8882e79953e80916c49af673ddcc4a3af5437437 KSwitcher-win-x64.zip
|
||||
+70
-70
@@ -1,166 +1,166 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"files": [
|
||||
{
|
||||
"size": 2361856,
|
||||
"sha256": "a267d8bd17f0247df78bffccf626919cdd91266f3b338a07f9fc3e7f747b0c5e",
|
||||
"path": "KSwitcher.exe"
|
||||
"sha256": "b3ea22fe674be884f48475dd39d1841bef5b1598b3e36de9623755f779eb075e",
|
||||
"path": "KSwitcher.exe",
|
||||
"size": 2361856
|
||||
},
|
||||
{
|
||||
"size": 2359808,
|
||||
"sha256": "06f4baf81aa8b5f0158468ad51262b78cd75a5730ee8ed731036d11820a6121a",
|
||||
"path": "KSwitcher.Config.exe"
|
||||
"sha256": "6c2ff14c22eeee192234b239f6bcdd54c53a195c12c016094d9295fc2d6ea6db",
|
||||
"path": "KSwitcher.Config.exe",
|
||||
"size": 2359808
|
||||
},
|
||||
{
|
||||
"size": 3337216,
|
||||
"sha256": "b9523a172b2902e5f8fe80328dd8ccda5f95be54f589d90826864b13fcf03de0",
|
||||
"path": "KSwitcher.Screenshot.exe"
|
||||
"sha256": "ef3599f85c20f98eed827231a4ff279359126127d5e3e1b6525dee4b259cbd9e",
|
||||
"path": "KSwitcher.Screenshot.exe",
|
||||
"size": 3337216
|
||||
},
|
||||
{
|
||||
"size": 3736064,
|
||||
"sha256": "7f7379dc5ad9393aab0de48ba5ad4d5b1161e488a088fb11bac3ddfb1f7cb6d9",
|
||||
"path": "KSwitcher.Files.exe"
|
||||
"sha256": "b42acaa23b069307e532d4f403d318555512a30fca1d7400f4955e2cc15824cc",
|
||||
"path": "KSwitcher.Files.exe",
|
||||
"size": 3736576
|
||||
},
|
||||
{
|
||||
"size": 194912,
|
||||
"sha256": "d3fce90bdeecb08596e377dea6a316354dd8949e32ff09b89d51be00c14e21b6",
|
||||
"path": "WebView2Loader.dll"
|
||||
"path": "WebView2Loader.dll",
|
||||
"size": 194912
|
||||
},
|
||||
{
|
||||
"size": 1103,
|
||||
"sha256": "e256f01188af527e4d06d21d06fbf785ae9c50d4b328bf03cbe0ba7f0aa4228f",
|
||||
"path": "terminal/addon-fit-LICENSE.txt"
|
||||
"path": "terminal/addon-fit-LICENSE.txt",
|
||||
"size": 1103
|
||||
},
|
||||
{
|
||||
"size": 1521,
|
||||
"sha256": "ba3ea256ce0620a0992a197d6c9baea64823fc93d8da07a9e366ca9943c18527",
|
||||
"path": "terminal/addon-fit.js"
|
||||
"path": "terminal/addon-fit.js",
|
||||
"size": 1521
|
||||
},
|
||||
{
|
||||
"size": 527,
|
||||
"sha256": "084d97a727b778fb10d31adcd557ee7840a38377ed60e0ef0f3ece93b349b1ef",
|
||||
"path": "terminal/index.html"
|
||||
"path": "terminal/index.html",
|
||||
"size": 527
|
||||
},
|
||||
{
|
||||
"size": 1073,
|
||||
"sha256": "792c48c5a849a15fdf9e37e8bcf9e6d1dd13b32b46c642a748a0a46a9919d473",
|
||||
"path": "terminal/markdown-it-LICENSE.txt"
|
||||
"path": "terminal/markdown-it-LICENSE.txt",
|
||||
"size": 1073
|
||||
},
|
||||
{
|
||||
"size": 100786,
|
||||
"sha256": "391f2aa638e75e6c7859d0a5c5650ef0956722a45998f17e05b83bc655778e1e",
|
||||
"path": "terminal/markdown-it.js"
|
||||
"path": "terminal/markdown-it.js",
|
||||
"size": 100786
|
||||
},
|
||||
{
|
||||
"size": 2212,
|
||||
"sha256": "27d3c6d39325d4995162911c352a8e20603513445683ceb0409e628949c39237",
|
||||
"path": "terminal/markdown.html"
|
||||
"path": "terminal/markdown.html",
|
||||
"size": 2212
|
||||
},
|
||||
{
|
||||
"size": 6534,
|
||||
"sha256": "dbf9a062364dcc90b59fd98eb0adb0f153ed95accf26e28f7be9cce8c13ae324",
|
||||
"path": "terminal/markdown.js"
|
||||
"path": "terminal/markdown.js",
|
||||
"size": 6534
|
||||
},
|
||||
{
|
||||
"size": 1089,
|
||||
"sha256": "ec9fb67dcb25eccc416ed56e1aab819222c805a2a4bfe4cb19e7556bf2ffde80",
|
||||
"path": "terminal/mermaid-LICENSE.txt"
|
||||
"path": "terminal/mermaid-LICENSE.txt",
|
||||
"size": 1089
|
||||
},
|
||||
{
|
||||
"size": 5537838,
|
||||
"sha256": "336df803d87a38b70a01e736e666c8f7601d2ce42f5e47c8fafe5d721074b9a3",
|
||||
"path": "terminal/mermaid.js"
|
||||
"path": "terminal/mermaid.js",
|
||||
"size": 5537838
|
||||
},
|
||||
{
|
||||
"size": 4478,
|
||||
"sha256": "0f3edde02b30e7b0f76d0cc88daae5791d720a4b74cf8b34e7c0b4dbe0cf9c9d",
|
||||
"path": "terminal/terminal.js"
|
||||
"path": "terminal/terminal.js",
|
||||
"size": 4478
|
||||
},
|
||||
{
|
||||
"size": 1261,
|
||||
"sha256": "b569f629d00f2626a8100df2a1798210535621e42164dfd426a6fe5aac7b0ccd",
|
||||
"path": "terminal/xterm-LICENSE.txt"
|
||||
"path": "terminal/xterm-LICENSE.txt",
|
||||
"size": 1261
|
||||
},
|
||||
{
|
||||
"size": 7112,
|
||||
"sha256": "854a7c0fb70e8b1a083c16797ab827299fb18744f5ad34f227b48337e33293c6",
|
||||
"path": "terminal/xterm.css"
|
||||
"path": "terminal/xterm.css",
|
||||
"size": 7112
|
||||
},
|
||||
{
|
||||
"size": 488663,
|
||||
"sha256": "14903579ff54664cd72f8e8699e6961a6272c21863ec1c3b118cdc8af5d4a972",
|
||||
"path": "terminal/xterm.js"
|
||||
"path": "terminal/xterm.js",
|
||||
"size": 488663
|
||||
},
|
||||
{
|
||||
"size": 4401,
|
||||
"sha256": "d3c81140cce01c26bf6cbf52aa40e0825e1fa35b9a91d1387170a65d2597082c",
|
||||
"path": "LICENSE"
|
||||
"path": "LICENSE",
|
||||
"size": 4401
|
||||
},
|
||||
{
|
||||
"size": 1096,
|
||||
"sha256": "61e08da79c44061654015ce6b0c4061c23ee1dd18237fbf09e9bfda3c0ea2831",
|
||||
"path": "json-LICENSE.txt"
|
||||
"path": "json-LICENSE.txt",
|
||||
"size": 1096
|
||||
},
|
||||
{
|
||||
"size": 883,
|
||||
"sha256": "185c5a37521316e940ead89cbf0b1ba5862d810c7c966e6c6a14a4a515b23625",
|
||||
"path": "files-text-license.txt"
|
||||
"path": "files-text-license.txt",
|
||||
"size": 883
|
||||
},
|
||||
{
|
||||
"size": 94357,
|
||||
"sha256": "fca41227e9b38bf061298d69806ea66fb00086ae03aec49665e4f68ed2c3f8e9",
|
||||
"path": "README.md"
|
||||
"path": "README.md",
|
||||
"size": 94357
|
||||
},
|
||||
{
|
||||
"size": 11418,
|
||||
"sha256": "2c13d3ed4761e679c352fb1ade24a1ec3060ad2862376ede801cdee5fcc3bada",
|
||||
"path": "LAN-PREVIEW.md"
|
||||
"path": "LAN-PREVIEW.md",
|
||||
"size": 11418
|
||||
},
|
||||
{
|
||||
"size": 732485,
|
||||
"sha256": "d0c022b27b9fbc2ff7b6b8bec723cc1adc4eef517202f9ff77eed5d8bea3acb9",
|
||||
"path": "dictionaries/en.txt"
|
||||
"path": "dictionaries/en.txt",
|
||||
"size": 732485
|
||||
},
|
||||
{
|
||||
"size": 20566,
|
||||
"sha256": "0bdfb0201d1803634f268cdff0993b8349d2c70e956a06dbb667c8dd65254ec5",
|
||||
"path": "dictionaries/LICENSE-CC-BY-SA-4.0.txt"
|
||||
"path": "dictionaries/LICENSE-CC-BY-SA-4.0.txt",
|
||||
"size": 20566
|
||||
},
|
||||
{
|
||||
"size": 2265,
|
||||
"sha256": "3017bf44d3be9d9dfab21bd6778aa52b7947e61acf9ce2bc86b41d6e949ac311",
|
||||
"path": "dictionaries/README.md"
|
||||
"path": "dictionaries/README.md",
|
||||
"size": 2265
|
||||
},
|
||||
{
|
||||
"size": 1109134,
|
||||
"sha256": "80e6b6a27815973535f7facb636c597eb845dfee45cfabfc4e9b3341b9332849",
|
||||
"path": "dictionaries/ru.txt"
|
||||
"path": "dictionaries/ru.txt",
|
||||
"size": 1109134
|
||||
},
|
||||
{
|
||||
"size": 1280,
|
||||
"sha256": "98e5b3fe7304e37705c9e5ff48b0b399ccb16e806736d21f09921b99e5f2a408",
|
||||
"path": "dictionaries/sources.json"
|
||||
"path": "dictionaries/sources.json",
|
||||
"size": 1280
|
||||
},
|
||||
{
|
||||
"size": 940799,
|
||||
"sha256": "d30e990d6ec2983c04f3644a3c61c6c668e8c542323f5931916fdd55b916eebf",
|
||||
"path": "dictionaries/uk.txt"
|
||||
"path": "dictionaries/uk.txt",
|
||||
"size": 940799
|
||||
},
|
||||
{
|
||||
"size": 993,
|
||||
"sha256": "a34b5161a8315af037e1ec71d816bfc688f7c364141d4ee2347cf0515ef0c82a",
|
||||
"path": "tools/README.txt"
|
||||
"path": "tools/README.txt",
|
||||
"size": 993
|
||||
},
|
||||
{
|
||||
"size": 134656,
|
||||
"sha256": "6ef5cf64708d62b7fc63c3c793cc99188a513433ff4774cae01dc014f6664376",
|
||||
"path": "tools/StayHere.exe"
|
||||
"path": "tools/StayHere.exe",
|
||||
"size": 134656
|
||||
},
|
||||
{
|
||||
"size": 2796,
|
||||
"sha256": "ba214e2aca7405e698b3ab21ceb1f41ce088edd996b3e30e4a9d58ff496f9413",
|
||||
"path": "tools/StayHere-README.md"
|
||||
"path": "tools/StayHere-README.md",
|
||||
"size": 2796
|
||||
}
|
||||
],
|
||||
"version": "0.6.95",
|
||||
"schema": 1
|
||||
"version": "0.6.97"
|
||||
}
|
||||
+3
-3
@@ -9,8 +9,8 @@ IDC_SCREENSHOT_PENCIL CURSOR "icons/lucide/pencil.cur"
|
||||
1 RT_MANIFEST "app.manifest"
|
||||
201 RCDATA "update.ps1"
|
||||
1 VERSIONINFO
|
||||
FILEVERSION 0,6,95,0
|
||||
PRODUCTVERSION 0,6,95,0
|
||||
FILEVERSION 0,6,97,0
|
||||
PRODUCTVERSION 0,6,97,0
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE VFT_APP
|
||||
BEGIN
|
||||
@@ -20,7 +20,7 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "FileDescription", "KSwitcher — native keyboard and clipboard utility"
|
||||
VALUE "ProductName", "KSwitcher"
|
||||
VALUE "FileVersion", "0.6.95"
|
||||
VALUE "FileVersion", "0.6.97"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
+88
-32
@@ -355,7 +355,12 @@ std::vector<CommandEntry> terminalHistory;
|
||||
size_t terminalHistoryIndex{};
|
||||
constexpr UINT_PTR transferHighlightTimer=1;
|
||||
unsigned transferHighlightPhase{};
|
||||
HWND status{}, commands[7]{};
|
||||
constexpr struct KeyBarCommand { int id; WPARAM key; const wchar_t *label; } keyBar[]{
|
||||
{110,VK_F2,L"Ctrl+R Refresh"}, {111,VK_F3,L"F3 View"}, {112,VK_F4,L"F4 Edit"},
|
||||
{113,VK_F5,L"F5 Copy"}, {114,VK_F6,L"F6 Move"}, {115,VK_F7,L"F7 Mkdir"},
|
||||
{117,VK_F8,L"F8 Delete"}, {116,VK_F10,L"F10 Exit"}
|
||||
};
|
||||
HWND status{}, commands[std::size(keyBar)]{};
|
||||
int active{}, split{};
|
||||
bool dragging{};
|
||||
bool rememberElevationApproval{};
|
||||
@@ -447,7 +452,7 @@ void openMenu(HWND window, int index);
|
||||
void showFileDetails(const Panel &panel);
|
||||
void editOptions(HWND owner);
|
||||
void showFolderShortcuts(Panel &panel,int digit,bool all=false);
|
||||
void layout(HWND window);
|
||||
void layout(HWND window,bool activeOnly=false);
|
||||
|
||||
DWORD preference(const wchar_t *name, DWORD fallback)
|
||||
{
|
||||
@@ -511,7 +516,6 @@ BOOL CALLBACK updateDialogFont(HWND window,LPARAM parameter)
|
||||
return TRUE;
|
||||
}
|
||||
HBRUSH blue{}, teal{}, terminalBackground{};
|
||||
void layout(HWND window);
|
||||
|
||||
LOGFONTW defaultFilesFont()
|
||||
{
|
||||
@@ -761,6 +765,7 @@ void hidePicker()
|
||||
void selectDrive();
|
||||
void showMenu(bool show)
|
||||
{
|
||||
if(!show && !IsWindowVisible(menuBar)) return;
|
||||
if (show) SetWindowPos(menuBar,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW);
|
||||
for (auto item : menuItems)
|
||||
{
|
||||
@@ -829,7 +834,7 @@ void closePanelSearch()
|
||||
if(IsWindowVisible(panelSearchPopup)) ShowWindow(panelSearchPopup,SW_HIDE);
|
||||
}
|
||||
|
||||
void layout(HWND window)
|
||||
void layout(HWND window,bool activeOnly)
|
||||
{
|
||||
RECT rect{};
|
||||
GetClientRect(window, &rect);
|
||||
@@ -848,21 +853,24 @@ void layout(HWND window)
|
||||
if(control) SetWindowPos(control,nullptr,x,y,width,height,
|
||||
SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOREDRAW);
|
||||
};
|
||||
for (int i = 0; i < 2; ++i)
|
||||
if(!activeOnly)
|
||||
{
|
||||
int x = i ? middle + 2 : 0;
|
||||
int end = i ? width : middle - 2;
|
||||
place(panels[i].path, x + 5, 4, std::max(0, end - x - 10), textHeight);
|
||||
int headingHeight=panels[i].wide?textHeight:0;
|
||||
place(panels[i].heading,x+5,textHeight+10,std::max(0,end-x-13),headingHeight);
|
||||
ShowWindow(panels[i].heading,!terminalVisible && panels[i].wide?SW_SHOWNA:SW_HIDE);
|
||||
place(panels[i].list, x + 5, textHeight+10+headingHeight, std::max(0, end - x - 13),
|
||||
std::max(0, panelBottom-textHeight-10-headingHeight));
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
int x = i ? middle + 2 : 0;
|
||||
int end = i ? width : middle - 2;
|
||||
place(panels[i].path, x + 5, 4, std::max(0, end - x - 10), textHeight);
|
||||
int headingHeight=panels[i].wide?textHeight:0;
|
||||
place(panels[i].heading,x+5,textHeight+10,std::max(0,end-x-13),headingHeight);
|
||||
ShowWindow(panels[i].heading,!terminalVisible && panels[i].wide?SW_SHOWNA:SW_HIDE);
|
||||
place(panels[i].list, x + 5, textHeight+10+headingHeight, std::max(0, end - x - 13),
|
||||
std::max(0, panelBottom-textHeight-10-headingHeight));
|
||||
}
|
||||
place(menuBar,0,0,width,textHeight+4);
|
||||
const int menuEdges[]{0,7,15,27,38,46};
|
||||
for(int i=0;i<5;++i)
|
||||
place(menuItems[i],4+menuEdges[i]*cellWidth,0,(menuEdges[i+1]-menuEdges[i])*cellWidth,textHeight+4);
|
||||
}
|
||||
place(menuBar,0,0,width,textHeight+4);
|
||||
const int menuEdges[]{0,7,15,27,38,46};
|
||||
for(int i=0;i<5;++i)
|
||||
place(menuItems[i],4+menuEdges[i]*cellWidth,0,(menuEdges[i+1]-menuEdges[i])*cellWidth,textHeight+4);
|
||||
const int detailsLeft=active?middle+2:0;
|
||||
const int detailsRight=active?width:middle-2;
|
||||
place(status,detailsLeft+8,panelBottom+4,std::max(0,detailsRight-detailsLeft-16),textHeight);
|
||||
@@ -880,6 +888,14 @@ void layout(HWND window)
|
||||
const int promptWidth=std::min(width/2,static_cast<int>(promptExtent.cx));
|
||||
place(terminalPrompt,4,inputTop,promptWidth,textHeight);
|
||||
place(terminalInput,4+promptWidth,inputTop,std::max(0,width-8-promptWidth),textHeight);
|
||||
if(activeOnly)
|
||||
{
|
||||
const RECT details{0,panelBottom+4,width,panelBottom+4+textHeight};
|
||||
const RECT commandLine{0,inputTop,width,inputTop+textHeight};
|
||||
if(!terminalVisible) RedrawWindow(window,&details,nullptr,RDW_INVALIDATE|RDW_ALLCHILDREN);
|
||||
RedrawWindow(window,&commandLine,nullptr,RDW_INVALIDATE|RDW_ALLCHILDREN);
|
||||
return;
|
||||
}
|
||||
// Keep the WebView in place while the panels reveal more or less of it.
|
||||
place(terminalOutput,4,4,std::max(0,width-8),terminalBottom-4);
|
||||
if(showOutput)
|
||||
@@ -920,6 +936,21 @@ void showTerminal(HWND owner,bool show)
|
||||
void open(Panel &panel,const fs::path &directory,bool offerElevation);
|
||||
void restoreCommandFocus();
|
||||
|
||||
void invalidatePanelRow(HWND list,LRESULT row)
|
||||
{
|
||||
RECT bounds{};
|
||||
if(row!=LB_ERR && SendMessageW(list,LB_GETITEMRECT,row,reinterpret_cast<LPARAM>(&bounds))!=LB_ERR)
|
||||
InvalidateRect(list,&bounds,FALSE);
|
||||
}
|
||||
|
||||
void invalidatePanelCursorChange(HWND list,LRESULT previous)
|
||||
{
|
||||
const auto current=SendMessageW(list,LB_GETCURSEL,0,0);
|
||||
if(current==previous) return;
|
||||
invalidatePanelRow(list,previous);
|
||||
invalidatePanelRow(list,current);
|
||||
}
|
||||
|
||||
void activatePanel(int index)
|
||||
{
|
||||
const auto previous=active;
|
||||
@@ -929,9 +960,9 @@ void activatePanel(int index)
|
||||
for(const auto &panel:panels)
|
||||
{
|
||||
InvalidateRect(panel.path,nullptr,FALSE);
|
||||
InvalidateRect(panel.list,nullptr,FALSE);
|
||||
invalidatePanelRow(panel.list,SendMessageW(panel.list,LB_GETCURSEL,0,0));
|
||||
}
|
||||
layout(GetParent(panels[index].list));
|
||||
layout(GetParent(panels[index].list),true);
|
||||
}
|
||||
|
||||
std::wstring terminalInputText()
|
||||
@@ -4396,16 +4427,38 @@ void makeFolder(HWND owner,Panel &panel)
|
||||
|
||||
LRESULT CALLBACK panelKeys(HWND window, UINT message, WPARAM wp, LPARAM lp, UINT_PTR, DWORD_PTR index)
|
||||
{
|
||||
if(message==WM_LBUTTONDOWN)
|
||||
if(message==WM_LBUTTONDOWN || message==WM_LBUTTONDBLCLK ||
|
||||
(message==WM_MOUSEMOVE && (wp&MK_LBUTTON) && GetCapture()==window))
|
||||
{
|
||||
auto &panel=panels[index];
|
||||
activatePanel(static_cast<int>(index));
|
||||
const auto count=SendMessageW(window,LB_GETCOUNT,0,0);
|
||||
RECT last{};
|
||||
if(count>0 && SendMessageW(window,LB_GETITEMRECT,count-1,reinterpret_cast<LPARAM>(&last))!=LB_ERR &&
|
||||
GET_Y_LPARAM(lp)>=last.bottom)
|
||||
if(!count || count==LB_ERR) return 0;
|
||||
const auto hit=SendMessageW(window,LB_ITEMFROMPOINT,0,lp);
|
||||
const auto row=static_cast<LRESULT>(LOWORD(hit));
|
||||
const POINT point{GET_X_LPARAM(lp),GET_Y_LPARAM(lp)};
|
||||
RECT bounds{};
|
||||
const bool rowHit=!HIWORD(hit) && row<count &&
|
||||
SendMessageW(window,LB_GETITEMRECT,row,reinterpret_cast<LPARAM>(&bounds))!=LB_ERR &&
|
||||
PtInRect(&bounds,point);
|
||||
const auto previous=SendMessageW(window,LB_GETCURSEL,0,0);
|
||||
const auto target=rowHit?row:point.y>=0 && message==WM_LBUTTONDOWN?count-1:previous;
|
||||
if(target!=previous)
|
||||
{
|
||||
selectPanelEdge(panels[index],false);
|
||||
return 0;
|
||||
// The list box can draw synchronously before committing its new selection.
|
||||
SendMessageW(window,LB_SETCURSEL,target,0);
|
||||
invalidatePanelCursorChange(window,previous);
|
||||
}
|
||||
showFileDetails(panel);
|
||||
if(message==WM_LBUTTONDOWN) SetCapture(window);
|
||||
if(message==WM_LBUTTONDBLCLK && rowHit) enter(panel);
|
||||
return 0;
|
||||
}
|
||||
if(message==WM_LBUTTONUP && GetCapture()==window)
|
||||
{
|
||||
ReleaseCapture();
|
||||
restoreCommandFocus();
|
||||
return 0;
|
||||
}
|
||||
const bool rangeKey=wp==VK_UP || wp==VK_DOWN || wp==VK_LEFT || wp==VK_RIGHT;
|
||||
if(message==WM_KEYDOWN && (wp==VK_INSERT || (rangeKey && (GetKeyState(VK_SHIFT)&0x8000))))
|
||||
@@ -4475,7 +4528,11 @@ LRESULT CALLBACK panelKeys(HWND window, UINT message, WPARAM wp, LPARAM lp, UINT
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
const bool movesCursor=message==WM_KEYDOWN &&
|
||||
(wp==VK_UP || wp==VK_DOWN || wp==VK_PRIOR || wp==VK_NEXT || wp==VK_HOME || wp==VK_END);
|
||||
const auto previous=movesCursor?SendMessageW(window,LB_GETCURSEL,0,0):LB_ERR;
|
||||
auto result=scrollList(window, message, wp, lp);
|
||||
if(movesCursor) invalidatePanelCursorChange(window,previous);
|
||||
if(message==WM_LBUTTONUP && GetFocus()==window) restoreCommandFocus();
|
||||
if(message==WM_PAINT && panels[index].wide)
|
||||
{
|
||||
@@ -4838,10 +4895,9 @@ LRESULT CALLBACK filesWindow(HWND window, UINT message, WPARAM wp, LPARAM lp)
|
||||
SetTimer(window,directoryWatchTimer,200,nullptr);
|
||||
if (!mono || !blue || !teal || !menuBar || !picker || !pickerFrame || !status || !panelSearchPopup) return -1;
|
||||
SendMessageW(status, WM_SETFONT, reinterpret_cast<WPARAM>(mono), FALSE);
|
||||
const wchar_t *labels[]{L"Ctrl+R Refresh", L"F3 View", L"F4 Edit", L"F5 Copy", L"F6 Move", L"F7 Mkdir", L"F10 Exit"};
|
||||
for (int i = 0; i < static_cast<int>(std::size(commands)); ++i)
|
||||
commands[i] = CreateWindowW(L"BUTTON", labels[i], WS_CHILD | WS_VISIBLE | BS_OWNERDRAW,
|
||||
0, 0, 0, 0, window, reinterpret_cast<HMENU>(110 + static_cast<INT_PTR>(i)), instance, nullptr);
|
||||
commands[i] = CreateWindowW(L"BUTTON", keyBar[i].label, WS_CHILD | WS_VISIBLE | BS_OWNERDRAW,
|
||||
0, 0, 0, 0, window, reinterpret_cast<HMENU>(static_cast<INT_PTR>(keyBar[i].id)), instance, nullptr);
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
auto &panel = panels[i];
|
||||
@@ -5139,6 +5195,7 @@ LRESULT CALLBACK filesWindow(HWND window, UINT message, WPARAM wp, LPARAM lp)
|
||||
const auto cursor=SendMessageW(item.hwndItem,LB_GETCURSEL,0,0);
|
||||
if(activePanelRow && cursor!=LB_ERR &&
|
||||
static_cast<UINT>(cursor)==item.itemID) background=PanelCursor;
|
||||
traceTerminal("panel-draw",item.CtlID-102,item.itemID,background==PanelCursor);
|
||||
}
|
||||
else if(item.itemState&(ODS_SELECTED|ODS_FOCUS))
|
||||
background=Selection;
|
||||
@@ -5296,17 +5353,16 @@ LRESULT CALLBACK filesWindow(HWND window, UINT message, WPARAM wp, LPARAM lp)
|
||||
openMenu(window,LOWORD(wp)-130);
|
||||
return 0;
|
||||
}
|
||||
if (LOWORD(wp) >= 110 && LOWORD(wp) < 110+std::size(commands) && HIWORD(wp) == BN_CLICKED)
|
||||
if (HIWORD(wp) == BN_CLICKED)
|
||||
{
|
||||
const WPARAM keys[]{VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F10};
|
||||
SendMessageW(panels[active].list, WM_KEYDOWN, keys[LOWORD(wp) - 110], 0);
|
||||
for(const auto &command:keyBar)
|
||||
if(LOWORD(wp)==command.id) SendMessageW(panels[active].list,WM_KEYDOWN,command.key,0);
|
||||
}
|
||||
if (LOWORD(wp) >= 102 && LOWORD(wp) <= 103 && HIWORD(wp) == LBN_DBLCLK)
|
||||
enter(panels[LOWORD(wp) - 102]);
|
||||
if (LOWORD(wp) >= 102 && LOWORD(wp) <= 103 && HIWORD(wp) == LBN_SELCHANGE)
|
||||
{
|
||||
const auto &panel=panels[LOWORD(wp) - 102];
|
||||
InvalidateRect(panel.list,nullptr,FALSE);
|
||||
showFileDetails(panel);
|
||||
}
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#include "platform.h"
|
||||
namespace ks
|
||||
{
|
||||
inline constexpr wchar_t AppVersion[] = L"0.6.95";
|
||||
inline constexpr wchar_t AppVersion[] = L"0.6.97";
|
||||
inline constexpr UINT UpdateMessage = WM_APP + 7;
|
||||
inline constexpr UINT UpdateCheckIntervalMs = 6 * 60 * 60 * 1000;
|
||||
inline constexpr UINT UpdateNotificationRetryMs = 5 * 60 * 1000;
|
||||
|
||||
@@ -10,6 +10,7 @@ public static class SearchArrowTest {
|
||||
[DllImport("user32.dll")] public static extern uint GetWindowThreadProcessId(IntPtr window, out uint pid);
|
||||
[DllImport("user32.dll")] public static extern IntPtr GetDlgItem(IntPtr hwnd, int id);
|
||||
[DllImport("user32.dll", EntryPoint="SendMessageW")] public static extern IntPtr Send(IntPtr hwnd, uint message, IntPtr w, IntPtr l);
|
||||
[DllImport("user32.dll", EntryPoint="SendMessageW")] public static extern IntPtr SendRect(IntPtr hwnd, uint message, IntPtr w, out Rect rect);
|
||||
[DllImport("user32.dll", EntryPoint="SendMessageW", CharSet=CharSet.Unicode)] public static extern IntPtr SendText(IntPtr hwnd, uint message, IntPtr w, string l);
|
||||
[DllImport("user32.dll", EntryPoint="SendMessageW", CharSet=CharSet.Unicode)] public static extern IntPtr GetText(IntPtr hwnd, uint message, IntPtr w, StringBuilder l);
|
||||
[DllImport("user32.dll")] public static extern bool PostMessage(IntPtr hwnd, uint message, IntPtr w, IntPtr l);
|
||||
@@ -94,6 +95,15 @@ function Select-Row($Panel, $Name) {
|
||||
function Post($Window, $Message, $W, $L = 0) {
|
||||
if (![SearchArrowTest]::PostMessage($Window, $Message, $W, $L)) { throw "Post failed" }
|
||||
}
|
||||
function Click-PanelRow($Panel, $Row) {
|
||||
$bounds=[SearchArrowTest+Rect]::new()
|
||||
if([SearchArrowTest]::SendRect($Panel,0x198,$Row,[ref]$bounds).ToInt64() -eq -1){
|
||||
throw "Missing file panel row $Row"
|
||||
}
|
||||
$point=([int](($bounds.Top+$bounds.Bottom)/2) -shl 16) -bor 6
|
||||
Post $Panel 0x201 1 $point
|
||||
Post $Panel 0x202 0 $point
|
||||
}
|
||||
function Assert-FarCheckbox($Dialog, [int]$Id, $NextControl) {
|
||||
$checkbox=[SearchArrowTest]::GetDlgItem($Dialog,$Id)
|
||||
Post $Dialog 0x28 $checkbox 1
|
||||
@@ -215,10 +225,38 @@ $fixture = Join-Path $scratch ('files-editor-ui-' + [Guid]::NewGuid().ToString('
|
||||
[IO.File]::WriteAllText($fixture, "public class Test {`r`n}`r`n")
|
||||
$copy=Join-Path $scratch 'KSwitcher.Files.search-arrow-test.exe'
|
||||
Copy-Item -LiteralPath $Executable -Destination $copy
|
||||
$process = Start-Process -FilePath $copy -PassThru -WindowStyle Hidden
|
||||
$process = Start-Process -FilePath $copy -ArgumentList '--terminal-trace' -PassThru -WindowStyle Normal
|
||||
$paintTrace = Join-Path ([IO.Path]::GetTempPath()) "KSwitcher.Files.terminal-trace-$($process.Id).log"
|
||||
try {
|
||||
$previousDpi=[SearchArrowTest]::SetThreadDpiAwarenessContext([IntPtr](-4))
|
||||
$main = Wait-Until { Find-Window 'KSwitcher.Files' $process.Id }
|
||||
$leftPanel=[SearchArrowTest]::GetDlgItem($main,102)
|
||||
$rightPanel=[SearchArrowTest]::GetDlgItem($main,103)
|
||||
foreach($check in @(@{Panel=$leftPanel; Index=0},@{Panel=$rightPanel; Index=1},@{Panel=$rightPanel; Index=1})) {
|
||||
$before=[SearchArrowTest]::Send($check.Panel,0x188,0,0).ToInt32()
|
||||
$top=[SearchArrowTest]::Send($check.Panel,0x18E,0,0).ToInt32()
|
||||
$row=if($before -eq $top){$top+1}else{$top}
|
||||
[void](Wait-Until { Test-Path -LiteralPath $paintTrace })
|
||||
Start-Sleep -Milliseconds 150
|
||||
$lineCount=@(Get-Content -LiteralPath $paintTrace).Count
|
||||
Click-PanelRow $check.Panel $row
|
||||
[void](Wait-Until { [SearchArrowTest]::Send($check.Panel,0x188,0,0).ToInt32() -eq $row })
|
||||
Start-Sleep -Milliseconds 150
|
||||
$highlight=@{}
|
||||
Get-Content -LiteralPath $paintTrace | Select-Object -Skip $lineCount |
|
||||
ForEach-Object { if($_ -match '^\d+ panel-draw ([01]) (\d+) ([01]) '){
|
||||
$highlight["$($Matches[1])/$($Matches[2])"]=$Matches[3]
|
||||
} }
|
||||
$draws=@($highlight.Keys)
|
||||
if("$($check.Index)/$row" -notin $draws -or $draws.Count -gt 3){
|
||||
throw "Clicking a row repainted unrelated file rows. Drawn rows: $draws"
|
||||
}
|
||||
if($highlight["$($check.Index)/$row"] -ne '1' -or
|
||||
($before -ge $top -and $highlight["$($check.Index)/$before"] -ne '0')){
|
||||
throw 'The new row must be painted active and the previous visible row must lose its highlight.'
|
||||
}
|
||||
}
|
||||
Write-Output 'Verified file clicks repaint only cursor rows in the active pane and when changing panes.'
|
||||
Post $main 0x111 132
|
||||
$commandMenu=Wait-Until {
|
||||
$list=[SearchArrowTest]::GetDlgItem($main,121)
|
||||
@@ -268,6 +306,18 @@ try {
|
||||
Select-Row $panel "[$component]"
|
||||
[void][SearchArrowTest]::Send($panel,0x100,13,0)
|
||||
}
|
||||
$fixtureRow=[SearchArrowTest]::SendText($panel,0x1A2,-1,([IO.Path]::GetFileName($fixture))).ToInt32()
|
||||
Click-PanelRow $panel $fixtureRow
|
||||
$deleteButton=[SearchArrowTest]::GetDlgItem($main,117)
|
||||
$deleteLabel=[Text.StringBuilder]::new(64)
|
||||
[void][SearchArrowTest]::GetText($deleteButton,0xD,$deleteLabel.Capacity,$deleteLabel)
|
||||
if($deleteLabel.ToString() -cne 'F8 Delete'){throw 'The F8 Delete key bar button is missing.'}
|
||||
Post $deleteButton 0xF5 0
|
||||
$deleteDialog=Wait-Until { Find-Window '#32770' $process.Id 6 }
|
||||
Post $deleteDialog 0x111 2
|
||||
[void](Wait-Until { ![SearchArrowTest]::IsWindow($deleteDialog) })
|
||||
if(!(Test-Path -LiteralPath $fixture)){throw 'Canceling F8 Delete removed the fixture.'}
|
||||
Write-Output 'Verified F8 Delete on the key bar opens the normal confirmation.'
|
||||
$newFolder='F7 тестова папка'
|
||||
Post $panel 0x100 0x76
|
||||
$makeDialog=Wait-Until { Find-Window '#32770' $process.Id 361 }
|
||||
@@ -692,6 +742,7 @@ finally {
|
||||
[void]$process.WaitForExit(5000)
|
||||
}
|
||||
if ($previousDpi) { [void][SearchArrowTest]::SetThreadDpiAwarenessContext($previousDpi) }
|
||||
if(Test-Path -LiteralPath $paintTrace){Remove-Item -LiteralPath $paintTrace -Force}
|
||||
$resolved=(Resolve-Path -LiteralPath $scratch).Path
|
||||
$root=(Resolve-Path -LiteralPath (Split-Path -Parent $scratch)).Path
|
||||
if ([IO.Path]::GetDirectoryName($resolved) -eq $root -and (Split-Path -Leaf $resolved) -like 'search-arrow-test-*') {
|
||||
|
||||
Reference in new issue
Block a user