From 6fc16f2360677d459a9581d93d9efcd23da4b36c Mon Sep 17 00:00:00 2001 From: yulian5 Date: Tue, 7 Oct 2025 21:09:59 -0700 Subject: [PATCH 1/2] New feature: panel resizing with mouse --- far/FarColorW.pas | 3 +- far/FarCze.hlf.m4 | 15 +- far/FarEng.hlf.m4 | 43 ++- far/FarGer.hlf.m4 | 39 ++- far/FarHun.hlf.m4 | 20 +- far/FarPol.hlf.m4 | 15 +- far/FarRus.hlf.m4 | 31 +- far/FarSky.hlf.m4 | 23 +- far/FarUkr.hlf.m4 | 31 +- far/changelog | 36 +++ far/farcolor.hpp | 1 + far/farlang.templ.m4 | 15 + far/filelist.cpp | 81 ++--- far/filelist.hpp | 5 + far/filepanels.cpp | 723 ++++++++++++++++++++++++++++++++++++++++++- far/filepanels.hpp | 50 +++ far/keyboard.cpp | 22 ++ far/palette.cpp | 1 + far/panel.hpp | 1 + far/setcolor.cpp | 1 + far/vbuild.m4 | 2 +- 21 files changed, 1069 insertions(+), 89 deletions(-) diff --git a/far/FarColorW.pas b/far/FarColorW.pas index e074dc33bf..365ab80772 100644 --- a/far/FarColorW.pas +++ b/far/FarColorW.pas @@ -215,7 +215,8 @@ interface COL_WARNDIALOGHIGHLIGHTDEFAULTBUTTON = 145; COL_WARNDIALOGHIGHLIGHTSELECTEDDEFAULTBUTTON = 146; - COL_LASTPALETTECOLOR = 147; + COL_PANELDRAGBORDER = 147; + COL_LASTPALETTECOLOR = 148; implementation end. diff --git a/far/FarCze.hlf.m4 b/far/FarCze.hlf.m4 index 75f38adbea..9328597286 100644 --- a/far/FarCze.hlf.m4 +++ b/far/FarCze.hlf.m4 @@ -1,4 +1,4 @@ -m4_include(`farversion.m4')m4_dnl +m4_include(`farversion.m4')m4_dnl .Language=Czech,Čeština .Options CtrlColorChar=\ .Options CtrlStartPosChar=^ @@ -365,10 +365,11 @@ $ #Ovládání panelů# Skrytí/ukázání levého panelu #Ctrl+F1# Skrytí/ukázání pravého panelu #Ctrl+F2# Změna výšky panelu #Ctrl+Nahoru,Ctrl+Dolů# - Změna šířky panelu #Ctrl+Vlevo,Ctrl+Vpravo# - Change panels width #Ctrl+Left,Ctrl+Right# + Změna šířky panelů klávesnicí #Ctrl+Vlevo,Ctrl+Vpravo# (pokud je příkazová řádka prázdná) + Změna šířky panelů myší #Přetažení hranice mezi panely# Obnovení nastavení implicitní šířky panelů #Ctrl+Numpad5# + #Dvojklik myší na hranici mezi panely# Restore default panels height #Ctrl+Alt+Numpad5# Zobrazení/Skrytí panelu funkčních kláves na spodní části. #Ctrl+B# Toggle total and free size show mode #Ctrl+Shift+S# @@ -1181,6 +1182,14 @@ přepnut na souborový. ~Rychlé hledání~@FastFind@ může být použito pro dosažení požadovaného souboru pomocí prvního znaku jeho názvu. + #Změna velikosti panelů myší# + + Můžete změnit šířku souborových panelů pomocí myši: + + - ^Najeďte kurzorem myši na hranici mezi levým a pravým panelem, abyste viděli vizuální zpětnou vazbu označující oblast, kterou lze změnit. + - ^Klikněte a táhněte hranici doleva nebo doprava pro úpravu šířky panelů. + - ^Dvojklikněte na hranici pro obnovení výchozí stejné šířky panelů (rozdělení 50/50). + See also the list of ~macro keys~@KeyMacroShellList@, available in the panels. diff --git a/far/FarEng.hlf.m4 b/far/FarEng.hlf.m4 index 12948be44e..db62aec237 100644 --- a/far/FarEng.hlf.m4 +++ b/far/FarEng.hlf.m4 @@ -1,4 +1,4 @@ -m4_include(`farversion.m4')m4_dnl +m4_include(`farversion.m4')m4_dnl .Language=English,English .Options CtrlColorChar=\ .Options CtrlStartPosChar=^ @@ -365,9 +365,12 @@ $ #Panel control commands# Hide/show right panel #Ctrl+F2# Change panels height #Ctrl+Up,Ctrl+Down# Change current panel height #Ctrl+Shift+Up,Ctrl+Shift+Down# - Change panels width #Ctrl+Left,Ctrl+Right# - (when the command line is empty) + Change panels height with mouse #Drag bottom border of panels# + Change panels width with keyboard #Ctrl+Left,Ctrl+Right# + (only when the command line is empty) + Change panels width with mouse #Drag border between panels# Restore default panels width #Ctrl+Numpad5# + #Mouse double click on border between panels# Restore default panels height #Ctrl+Alt+Numpad5# Show/Hide functional key bar at the bottom line. #Ctrl+B# Toggle total and free size show mode #Ctrl+Shift+S# @@ -884,8 +887,8 @@ default button or does another similar thing). #Mouse# Clicking the #middle mouse button# in the ~panels~@PanelCmd@ has the same -effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, -#Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. + effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, + #Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. Far Manager also supports the ~mouse wheel~@MsWheel@. @@ -900,7 +903,7 @@ $ #Special commands# $ #Mouse: wheel support# #Panels# Rotating the wheel scrolls the file list without changing the cursor position on the screen. -Pressing the #middle button# has the same effect as pressing #Enter#. + Pressing the #middle button# has the same effect as pressing #Enter#. #Editor# Rotating the wheel scrolls the text without changing the cursor position on the screen @@ -914,11 +917,11 @@ Pressing the #middle button# has the same effect as pressing #Enter#. #Menus# Wheel scrolling works as #Up#/#Down# keys. Pressing the #middle button# has the same effect as -pressing #Enter#. It is possible to choose items without moving the cursor. + pressing #Enter#. It is possible to choose items without moving the cursor. #Dialogs# In dialogs, when the wheel is rotated at an edit line with a history list or a combo box, -the drop-down list is opened. In the drop-down list scrolling works the same as in menus. + the drop-down list is opened. In the drop-down list scrolling works the same as in menus. You can specify the number of lines to scroll at a time in the panels, editor and viewer (see ~System.MsWheelDelta~@System.MsWheelDelta@). @@ -1160,6 +1163,30 @@ if the initial panel type differs it will be automatically set to the file panel ~Fast find~@FastFind@ action can be used to point to the required file by the first letters of its name. + #Mouse panel resizing# + + You can resize the width and height of file panels using the mouse: + + #Width resizing:# + - ^Hover the mouse cursor over the vertical border between the left and right panels to see visual feedback indicating the resizable area. + - ^Click and drag the border left or right to adjust the panel widths. + - ^Double-click on the vertical border to restore default equal panel widths (50/50 split). + - ^Press #Esc# during resizing to cancel and revert to the original panel widths. + + #Height resizing:# + - ^Hover the mouse cursor over the bottom border of a panel to see visual feedback indicating the resizable area. + - ^Click and drag the bottom border up or down to adjust the panel height. + - ^The resizing behavior depends on the horizontal mouse position: + - ^Over LEFT panel bottom border in Left half of panel → Resize LEFT panel only + - ^Over LEFT panel bottom border in Right half of panel → Resize BOTH panels + - ^Over RIGHT panel bottom border in Left half of panel → Resize BOTH panels + - ^Over RIGHT panel bottom border in Right half of panel → Resize RIGHT panel only + - ^Double-click on the bottom border to restore full panel height. + - ^Press #Esc# during resizing to cancel and revert to the original panel heights. + + #Note for ConEmu users:# + ^To avoid duplicated resizing indicators and methods, it's recommended to disable ConEmu's Far Manager panel resize feature by unchecking #Settings → Far Manager → Resize panels by mouse#. + See also the list of ~macro keys~@KeyMacroShellList@, available in the panels. diff --git a/far/FarGer.hlf.m4 b/far/FarGer.hlf.m4 index 5b7730d704..e4efb4de7d 100644 --- a/far/FarGer.hlf.m4 +++ b/far/FarGer.hlf.m4 @@ -1,4 +1,4 @@ -m4_include(`farversion.m4')m4_dnl +m4_include(`farversion.m4')m4_dnl .Language=German,Deutsch .Options CtrlColorChar=\ .Options CtrlStartPosChar=^ @@ -369,9 +369,12 @@ $ #Befehl zur Fenstersteuerung# Rechtes Fenster anzeigen/verbergen #Strg+F2# Fensterhöhe ändern #Strg+↑,Strg+↓# Change current panel height #Ctrl+Shift+Up,Ctrl+Shift+Down# - Fensterbreite ändern #Strg+Links,Strg+Rechts# + Fensterhöhe mit Maus ändern #Untere Grenze der Fenster ziehen# + Fensterbreite mit Tastatur ändern #Strg+Links,Strg+Rechts# (b.leerer Kommandozeile) + Fensterbreite mit Maus ändern #Grenze zwischen Fenstern ziehen# Standardfensterbreite wiederherstellen #Strg+Num5# + #Maus-Doppelklick auf Grenze zwischen Fenstern# Restore default panels height #Ctrl+Alt+Numpad5# Show/Hide functional key bar at the bottom line. #Ctrl+B# Toggle total and free size show mode #Ctrl+Shift+S# @@ -896,8 +899,8 @@ default button or does another similar thing). #Mouse# Clicking the #middle mouse button# in the ~panels~@PanelCmd@ has the same -effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, -#Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. + effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, + #Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. Far Manager also supports the ~mouse wheel~@MsWheel@. @@ -912,7 +915,7 @@ $ #Special commands# $ #Mouse: wheel support# #Panels# Rotating the wheel scrolls the file list without changing the cursor position on the screen. -Pressing the #middle button# has the same effect as pressing #Enter#. + Pressing the #middle button# has the same effect as pressing #Enter#. #Editor# Rotating the wheel scrolls the text without changing the cursor position on the screen @@ -926,7 +929,7 @@ Pressing the #middle button# has the same effect as pressing #Enter#. #Menus# Wheel scrolling works as #Up#/#Down# keys. Pressing the #middle button# has the same effect as -pressing #Enter#. It is possible to choose items without moving the cursor. + pressing #Enter#. It is possible to choose items without moving the cursor. #Dialogs# In dialogs, when the wheel is rotated at an edit line with a history list or a combo box, @@ -1183,6 +1186,30 @@ automatisch die Starteinstellung des Fenstertyps benutzt. Die ~Schnellsuche~@FastFind@ kann benutzt werden, um durch die Anfangsbuch- staben eines Namens auf die Datei zu springen. + #Fenstergröße mit der Maus ändern# + + Sie können die Breite und Höhe der Dateifenster mit der Maus ändern: + + #Breite ändern:# + - ^Bewegen Sie den Mauszeiger über die vertikale Grenze zwischen dem linken und rechten Fenster, um eine visuelle Rückmeldung für den veränderbaren Bereich zu sehen. + - ^Klicken und ziehen Sie die Grenze nach links oder rechts, um die Fensterbreiten anzupassen. + - ^Doppelklicken Sie auf die vertikale Grenze, um die standardmäßigen gleichen Fensterbreiten wiederherzustellen (50/50-Aufteilung). + - ^Drücken Sie #Esc# während der Größenänderung, um abzubrechen und zur ursprünglichen Fensterbreite zurückzukehren. + + #Höhe ändern:# + - ^Bewegen Sie den Mauszeiger über die untere Grenze eines Fensters, um eine visuelle Rückmeldung für den veränderbaren Bereich zu sehen. + - ^Klicken und ziehen Sie die untere Grenze nach oben oder unten, um die Fensterhöhe anzupassen. + - ^Das Verhalten der Größenänderung hängt von der horizontalen Mausposition ab: + - ^Über LINKEM Fenster in linker Hälfte → Nur LINKES Fenster ändern + - ^Über LINKEM Fenster in rechter Hälfte → BEIDE Fenster ändern + - ^Über RECHTEM Fenster in linker Hälfte → BEIDE Fenster ändern + - ^Über RECHTEM Fenster in rechter Hälfte → Nur RECHTES Fenster ändern + - ^Doppelklicken Sie auf die untere Grenze, um die volle Fensterhöhe wiederherzustellen. + - ^Drücken Sie #Esc# während der Größenänderung, um abzubrechen und zur ursprünglichen Fensterhöhe zurückzukehren. + + #Hinweis für ConEmu-Benutzer:# + ^Um doppelte Größenänderungsindikatoren und -methoden zu vermeiden, wird empfohlen, die Far Manager-Fenstergröße-Funktion in ConEmu zu deaktivieren, indem Sie #Einstellungen → Far Manager → Resize panels by mouse# deaktivieren. + See also the list of ~macro keys~@KeyMacroShellList@, available in the panels. diff --git a/far/FarHun.hlf.m4 b/far/FarHun.hlf.m4 index a3e8ebab9d..e331f4a058 100644 --- a/far/FarHun.hlf.m4 +++ b/far/FarHun.hlf.m4 @@ -1,4 +1,4 @@ -m4_include(`farversion.m4')m4_dnl +m4_include(`farversion.m4')m4_dnl .Language=Hungarian,Magyar .Options CtrlColorChar=\ .Options CtrlStartPosChar=^ @@ -373,9 +373,13 @@ $ #Panelvezérlő parancsok# Elrejti/megmutatja a bal panelt #Ctrl+F1# Elrejti/megmutatja a jobb panelt #Ctrl+F2# A panelek magasságán változtat #Ctrl+Fel,Ctrl+Le# - A panelek szélességén változtat #Ctrl+Jobb,Ctrl+Bal# + A panelek magasságán változtat egérrel #Alsó határ húzása a paneleken# + A panelek szélességén változtat billentyűzettel #Ctrl+Jobb,Ctrl+Bal# (ha a parancssor üres) + A panelek szélességén változtat egérrel + #Határ húzása a panelek között# Visszaállítja a panelszélességek alapértékét #Ctrl+Numpad5# + #Dupla egérkattintás a panelek határán# Visszaállítja a panelmagasságok alapértékét #Ctrl+Alt+Numpad5# Megmutatja/elrejti a funkcióbillentyűk sorát #Ctrl+B# a képernyő alján @@ -908,8 +912,8 @@ alapértelmezett gombot vagy más hasonló dolgot művel). #Mouse# Clicking the #middle mouse button# in the ~panels~@PanelCmd@ has the same -effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, -#Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. + effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, + #Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. A Far Manager kezeli az ~egér görgőjét~@MsWheel@. @@ -1185,6 +1189,14 @@ volt, a módváltás vagy a meghajtóváltás után automatikusan fájlpanel mó A ~gyorskeresés~@FastFind@ művelet a keresett fájlnév karaktereinek begépelésével a megfelelő fájlra állítja a kurzort. + #Panel átméretezése egérrel# + + A fájlpanelek szélességét egérrel is módosíthatja: + + - ^Vigye az egérmutatót a bal és jobb panel közötti határvonalra, hogy lássa az átméretezési terület vizuális jelzését. + - ^Kattintson és húzza a határvonalat balra vagy jobbra a panelek szélességének beállításához. + - ^Kattintson duplán a határvonalra az alapértelmezett egyenlő panelszélesség visszaállításához (50/50 felosztás). + See also the list of ~macro keys~@KeyMacroShellList@, available in the panels. diff --git a/far/FarPol.hlf.m4 b/far/FarPol.hlf.m4 index d46ee9ea9e..180a5b240c 100644 --- a/far/FarPol.hlf.m4 +++ b/far/FarPol.hlf.m4 @@ -1,4 +1,4 @@ -m4_include(`farversion.m4')m4_dnl +m4_include(`farversion.m4')m4_dnl .Language=Polish,Polski .Options CtrlColorChar=\ .Options CtrlStartPosChar=^ @@ -369,9 +369,12 @@ $ #Polecenia kontroli panelu# Ukryj/pokaż prawy panel #Ctrl+F2# Zmień wysokość panelu #Ctrl+Góra,Ctrl+Dół# Zmień wysokość bieżącego panelu #Ctrl+Shift+Góra,Ctrl+Shift+Dół# - Zmień szerokość panelu #Ctrl+Lewo,Ctrl+Prawo# + Zmień wysokość paneli myszą #Przeciągnij dolną granicę paneli# + Zmień szerokość paneli klawiaturą #Ctrl+Lewo,Ctrl+Prawo# (tylko gdy wiersz poleceń jest pusty) + Zmień szerokość paneli myszą #Przeciągnij granicę między panelami# Przywróć domyślną szerokość paneli #Ctrl+Numpad5# + #Podwójne kliknięcie myszy na granicy paneli# Przywróć domyślną wysokość paneli #Ctrl+Alt+Numpad5# Pokaż/Ukryj pasek skrótów w dolnej linii #Ctrl+B# Przełącz tryb całkowitej i wolnej wielkości #Ctrl+Shift+S# @@ -1152,6 +1155,14 @@ automatycznie ustawiony na panel plików. Operacja ~szybkiego szukania~@FastFind@ może być użyta jako odnośnik do żądanego plików po pierwszej literze jego nazwy. + #Zmiana rozmiaru paneli myszą# + + Można zmieniać szerokość paneli plików za pomocą myszy: + + - ^Najedź kursorem myszy na granicę między lewym i prawym panelem, aby zobaczyć wizualną informację o możliwości zmiany rozmiaru. + - ^Kliknij i przeciągnij granicę w lewo lub w prawo, aby dostosować szerokość paneli. + - ^Kliknij dwukrotnie na granicy, aby przywrócić domyślną równą szerokość paneli (podział 50/50). + Zobacz także listę ~klawiszy makropoleceń~@KeyMacroShellList@, dostępnych w panelach. diff --git a/far/FarRus.hlf.m4 b/far/FarRus.hlf.m4 index acb67d942a..4ffe99ca6d 100644 --- a/far/FarRus.hlf.m4 +++ b/far/FarRus.hlf.m4 @@ -1,4 +1,4 @@ -m4_include(`farversion.m4')m4_dnl +m4_include(`farversion.m4')m4_dnl .Language=Russian,Русский .Options CtrlColorChar=\ .Options CtrlStartPosChar=^ @@ -380,9 +380,12 @@ $ #Команды управления панелями# Убрать/показать правую панель #Ctrl+F2# Изменить высоту панелей #Ctrl+Up,Ctrl+Down# Изменить высоту текущей панели #Ctrl+Shift+Up,Ctrl+Shift+Down# - Изменить ширину панелей #Ctrl+Left,Ctrl+Right# + Изменить высоту панелей мышью #Перетаскивание нижней границы панелей# + Изменить ширину панелей клавиатурой #Ctrl+Left,Ctrl+Right# (при пустой командной строке) + Изменить ширину панелей мышью#Перетаскивание границы между панелями# Восстановить ширину панелей по умолчанию #Ctrl+Numpad5# + #Двойной щелчок мыши по границе между панелями# Восстановить высоту панелей по умолчанию #Ctrl+Alt+Numpad5# Спрятать/Показать линейку функциональных клавиш #Ctrl+B# Переключение режима показа общего размера файлов и #Ctrl+Shift+S# @@ -1187,6 +1190,30 @@ $ #Панель файлов# Для позиционирования на файл можно воспользоваться операцией ~быстрого поиска~@FastFind@ по первым буквам имени. + #Изменение размера панелей мышью# + + Вы можете изменять ширину и высоту панелей файлов с помощью мыши: + + #Изменение ширины:# + - ^Наведите курсор мыши на вертикальную границу между левой и правой панелями, чтобы увидеть визуальную подсказку о возможности изменения размера. + - ^Нажмите и перетащите границу влево или вправо для регулировки ширины панелей. + - ^Дважды щёлкните на вертикальной границе, чтобы восстановить равную ширину панелей по умолчанию (разделение 50/50). + - ^Нажмите #Esc# во время изменения размера, чтобы отменить и вернуться к исходной ширине панелей. + + #Изменение высоты:# + - ^Наведите курсор мыши на нижнюю границу панели, чтобы увидеть визуальную подсказку о возможности изменения размера. + - ^Нажмите и перетащите нижнюю границу вверх или вниз для регулировки высоты панели. + - ^Поведение изменения размера зависит от горизонтального положения мыши: + - ^Над ЛЕВОЙ панелью + Левая половина → Изменяется только ЛЕВАЯ панель + - ^Над ЛЕВОЙ панелью + Правая половина → Изменяются ОБЕ панели + - ^Над ПРАВОЙ панелью + Левая половина → Изменяются ОБЕ панели + - ^Над ПРАВОЙ панелью + Правая половина → Изменяется только ПРАВАЯ панель + - ^Дважды щёлкните на нижней границе, чтобы восстановить полную высоту панели. + - ^Нажмите #Esc# во время изменения размера, чтобы отменить и вернуться к исходной высоте панелей. + + #Примечание для пользователей ConEmu:# + ^Чтобы избежать дублирования индикаторов и методов изменения размера, рекомендуется отключить функцию изменения размера панелей Far Manager в ConEmu, сняв флажок #Настройки → Far Manager → Resize panels by mouse#. + См. также список ~макроклавиш~@KeyMacroShellList@, доступных в панелях. diff --git a/far/FarSky.hlf.m4 b/far/FarSky.hlf.m4 index f7ec696ae0..f9236daaf6 100644 --- a/far/FarSky.hlf.m4 +++ b/far/FarSky.hlf.m4 @@ -1,4 +1,4 @@ -m4_include(`farversion.m4')m4_dnl +m4_include(`farversion.m4')m4_dnl .Language=Slovak,Slovenčina .Options CtrlColorChar=\ .Options CtrlStartPosChar=^ @@ -364,9 +364,12 @@ $ #Príkazy na ovládanie panelov# Schovaj/zobraz pravý panel #Ctrl+F2# Zmeň výšku panelov #Ctrl+Nahor,Ctrl+Nadol# Change current panel height #Ctrl+Shift+Up,Ctrl+Shift+Down# - Zmeň šírku panelov #Ctrl+Doľ,Ctrl+Dopr# + Zmeň výšku panelov myšou #Ťahanie dolnej hranice panelov# + Zmeň šírku panelov klávesnicou #Ctrl+Doľ,Ctrl+Dopr# (ak je prík. riadok prázdny) + Zmeň šírku panelov myšou #Ťahanie hranice medzi panelmi# Vráť štandartnú šírku panelov #Ctrl+NumKlav5# + #Dvojklik myšou na hranicu medzi panelmi# Restore default panels height #Ctrl+Alt+Numpad5# Show/Hide functional key bar at the bottom line. #Ctrl+B# Toggle total and free size show mode #Ctrl+Shift+S# @@ -881,8 +884,8 @@ default button or does another similar thing). #Mouse# Clicking the #middle mouse button# in the ~panels~@PanelCmd@ has the same -effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, -#Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. + effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, + #Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. Far Manager also supports the ~mouse wheel~@MsWheel@. @@ -897,7 +900,7 @@ $ #Special commands# $ #Mouse: wheel support# #Panels# Rotating the wheel scrolls the file list without changing the cursor position on the screen. -Pressing the #middle button# has the same effect as pressing #Enter#. + Pressing the #middle button# has the same effect as pressing #Enter#. #Editor# Rotating the wheel scrolls the text without changing the cursor position on the screen @@ -911,7 +914,7 @@ Pressing the #middle button# has the same effect as pressing #Enter#. #Menus# Wheel scrolling works as #Up#/#Down# keys. Pressing the #middle button# has the same effect as -pressing #Enter#. It is possible to choose items without moving the cursor. + pressing #Enter#. It is possible to choose items without moving the cursor. #Dialogs# In dialogs, when the wheel is rotated at an edit line with a history list or a combo box, @@ -1158,6 +1161,14 @@ ak bol predtým nastavený iný typ panelu. ~Rýchle vyhľadávanie~@FastFind@ možno použiť na nastavenie sa na požadovaný súbor použitím prvých písmen jeho mena. + #Zmena veľkosti panelov myšou# + + Môžete zmeniť šírku súborových panelov pomocou myši: + + - ^Navedite kurzor myši na hranicu medzi ľavým a pravým panelom, aby ste videli vizuálnu spätnú väzbu označujúcu oblasť, ktorú možno zmeniť. + - ^Kliknite a ťahajte hranicu doľava alebo doprava na úpravu šírky panelov. + - ^Dvakrát kliknite na hranicu na obnovenie predvolenej rovnakej šírky panelov (rozdelenie 50/50). + See also the list of ~macro keys~@KeyMacroShellList@, available in the panels. diff --git a/far/FarUkr.hlf.m4 b/far/FarUkr.hlf.m4 index 692f931293..a183587ae2 100644 --- a/far/FarUkr.hlf.m4 +++ b/far/FarUkr.hlf.m4 @@ -1,4 +1,4 @@ -m4_include(`farversion.m4')m4_dnl +m4_include(`farversion.m4')m4_dnl .Language=Ukrainian,Українська .Options CtrlColorChar=\ .Options CtrlStartPosChar=^ @@ -362,9 +362,12 @@ $ #Команди керування панелями# Прибрати/показати праву панель #Ctrl+F2# Змінити висоту панелей #Ctrl+Up, Ctrl+Down# Змінити висоту поточної панелі #Ctrl+Shift+Up,Ctrl+Shift+Down# - Змінити ширину #Ctrl+Left, Ctrl+Right# + Змінити висоту панелей мишею #Перетягування нижньої межі панелей# + Змінити ширину панелей клавіатурою #Ctrl+Left, Ctrl+Right# (при пустому командному рядку) + Змінити ширину панелей мишею #Перетягування межі між панелями# Відновити ширину панелей за замовчуванням #Ctrl+Numpad5# + #Подвійний клік мишею по межі панелей# Відновити висоту панелей за замовчуванням #Ctrl+Alt+Numpad5# Сховати/Показати лінійку функціональних клавіш #Ctrl+B# Перемкнути показ загального та вільного розміру #Ctrl+Shift+S# @@ -1180,6 +1183,30 @@ NTFS. Деякі файлові системи можуть не підтрим Для позиціонування на файл можна скористатися операцією ~швидкого пошуку~@FastFind@ по перших літерах імені. + #Зміна розміру панелей мишею# + + Ви можете змінювати ширину та висоту панелей файлів за допомогою миші: + + #Зміна ширини:# + - ^Наведіть курсор миші на вертикальну межу між лівою та правою панелями, щоб побачити візуальний зворотний зв'язок, що вказує на область зміни розміру. + - ^Клацніть та перетягніть межу ліворуч або праворуч для налаштування ширини панелей. + - ^Двічі клацніть на вертикальній межі, щоб відновити однакову ширину панелей за замовчуванням (розділення 50/50). + - ^Натисніть #Esc# під час зміни розміру, щоб скасувати та повернутися до початкової ширини панелей. + + #Зміна висоти:# + - ^Наведіть курсор миші на нижню межу панелі, щоб побачити візуальний зворотний зв'язок, що вказує на область зміни розміру. + - ^Клацніть та перетягніть нижню межу вгору або вниз для налаштування висоти панелі. + - ^Поведінка зміни розміру залежить від горизонтального положення миші: + - ^Над ЛІВОЮ панеллю в лівій половині панелі → Змінюється тільки ЛІВА панель + - ^Над ЛІВОЮ панеллю в правій половині панелі → Змінюються ОБІ панелі + - ^Над ПРАВОЮ панеллю в лівій половині панелі → Змінюються ОБІ панелі + - ^Над ПРАВОЮ панеллю в правій половині панелі → Змінюється тільки ПРАВА панель + - ^Двічі клацніть на нижній межі, щоб відновити повну висоту панелі. + - ^Натисніть #Esc# під час зміни розміру, щоб скасувати та повернутися до початкової висоти панелей. + + #Примітка для користувачів ConEmu:# + ^Щоб уникнути дублювання індикаторів та методів зміни розміру, рекомендується відключити функцію зміни розміру панелей Far Manager у ConEmu, знявши прапорець #Налаштування → Far Manager → Resize panels by mouse#. + Дивіться також список ~макроклавіш~@KeyMacroShellList@, доступних у панелях. diff --git a/far/changelog b/far/changelog index 95142287f4..d8e025697d 100644 --- a/far/changelog +++ b/far/changelog @@ -1,3 +1,39 @@ +-------------------------------------------------------------------------------- +yulian5 2025-10-07 21:00:00-07:00 - build 6572 + +1. New feature: panel resizing with mouse + +-------------------------------------------------------------------------------- +zg 2025-10-05 23:11:22+03:00 - build 6571 + +1. selection drawn incorrectly in viewer in dump mode. + +-------------------------------------------------------------------------------- +drkns 2025-10-04 21:05:17+01:00 - build 6570 + +1. gh-939: ECSTATE_SAVED / ECSTATE_MODIFIED changed their meaning. + The original meaning restored (more or less). + +-------------------------------------------------------------------------------- +drkns 2025-10-04 00:00:33+01:00 - build 6569 + +1. Refactoring. + +2. More ASAN tests. + +3. Reorganize headers. + +-------------------------------------------------------------------------------- +drkns 2025-10-03 20:47:49+01:00 - build 6568 + +1. gh-1022: crash on smb share. + This was already fixed in 1805 and broken again in 5838. + +-------------------------------------------------------------------------------- +drkns 2025-10-03 11:10:57+01:00 - build 6567 + +1. Correction of 6549 for old OSes. + -------------------------------------------------------------------------------- rohitab 2025-10-01 13:36:49+10:00 - build 6566 diff --git a/far/farcolor.hpp b/far/farcolor.hpp index e5fa649ab6..2a3eaa78b8 100644 --- a/far/farcolor.hpp +++ b/far/farcolor.hpp @@ -212,6 +212,7 @@ enum PaletteColors COL_WARNDIALOGHIGHLIGHTDEFAULTBUTTON, COL_WARNDIALOGHIGHLIGHTSELECTEDDEFAULTBUTTON, + COL_PANELDRAGBORDER, COL_LASTPALETTECOLOR }; diff --git a/far/farlang.templ.m4 b/far/farlang.templ.m4 index 2b96124427..2f9977ce03 100644 --- a/far/farlang.templ.m4 +++ b/far/farlang.templ.m4 @@ -18791,6 +18791,21 @@ MSetColorPanelDragging "Tempiamas tekstas" upd:"Dragging text" +MSetColorPanelDraggingBorder +"Граница перетаскивания" +"Dragging border" +"Tažená hranice" +"Drag && Drop Border" +"Vonszolt szegély" +"Przeciągana krawędź" +"Texto arrastrado" +"Potiahnutý okraj" +"Spostamento Bordo" +"Межа перетягув." +"Мяжа пераносу" +"Tempiama riba" +upd:"Dragging border" + MSetColorPanelBox "Рамка" "Border" diff --git a/far/filelist.cpp b/far/filelist.cpp index 7e0870e726..abd8f1b5f5 100644 --- a/far/filelist.cpp +++ b/far/filelist.cpp @@ -121,7 +121,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. static_assert(static_cast(panel_sort::BY_USER) == static_cast(OPENPANELINFO_SORTMODES::SM_USER)); - constexpr auto operator+(panel_sort const Value) noexcept { return std::to_underlying(Value); @@ -135,6 +134,7 @@ static const struct sort_mode std::initializer_list> DefaultLayers; } + SortModes[] { { lng::MMenuUnsorted, 5, KEY_CTRLF7, { { panel_sort::UNSORTED, sort_order::ascend, }, }, }, @@ -197,7 +197,6 @@ static auto compare_fat_write_time(os::chrono::time_point First, os::chrono::tim return First <=> Second; } - enum SELECT_MODES { SELECT_INVERT, @@ -553,7 +552,6 @@ FileList::~FileList() dispose(); } - FileList::list_data& FileList::list_data::operator=(FileList::list_data&& rhs) noexcept { clear(); @@ -596,7 +594,6 @@ void FileList::ToBegin() ShowFileList(); } - void FileList::ToEnd() { m_CurFile = is_data_empty()? 0 : static_cast(data_size() - 1); @@ -722,7 +719,6 @@ class list_less return false; } - private: std::strong_ordering compare(panel_sort const SortMode, bool const Reverse, FileListItem const& Item1, FileListItem const& Item2) const { @@ -805,7 +801,6 @@ class list_less bool m_IgnorePaths; }; - void FileList::SortFileList(bool KeepPosition) { if (is_data_empty() || m_InsideGetFindData) @@ -1778,7 +1773,6 @@ bool FileList::ProcessKey(const Manager::Key& Key) ProcessHostFile(); return true; } - case KEY_F3: case KEY_NUMPAD5: case KEY_SHIFTNUMPAD5: case KEY_ALTF3: @@ -2631,7 +2625,6 @@ bool FileList::ProcessKey(const Manager::Key& Key) return false; } - void FileList::Select(FileListItem& SelItem, bool Selection) { if (IsParentDirectory(SelItem) || SelItem.Selected == Selection) @@ -2849,7 +2842,6 @@ void FileList::ProcessEnter(bool EnableExec,bool SeparateWindow,bool EnableAssoc } } - bool FileList::SetCurDir(string_view const NewDir, bool ClosePanel, bool IsUpdated, bool const Silent) { const auto DataLock = lock_data(); @@ -3396,7 +3388,6 @@ bool FileList::ProcessMouse(const MOUSE_EVENT_RECORD *MouseEvent) return false; } - /* $ 12.09.2000 SVS + Опциональное поведение для правой клавиши мыши на пустой панели */ @@ -3662,7 +3653,6 @@ long FileList::FindNext(int StartPos, string_view const Name) return -1; } - bool FileList::IsSelected(string_view const Name) { const auto DataLock = lock_data(); @@ -4022,7 +4012,6 @@ bool FileList::GetSelName(string* strName, string* strShortName, os::fs::find_da return false; } - void FileList::ClearLastGetSelection() { if (LastSelPosition < 0 || LastSelPosition >= static_cast(data_size())) @@ -4370,7 +4359,6 @@ void FileList::UpdateViewPanel() RefreshTitle(); } - void FileList::CompareDir() { const auto Another = std::dynamic_pointer_cast(Parent()->GetAnotherPanel(this)); @@ -4631,7 +4619,6 @@ void FileList::ClearSelection() SortFileList(true); } - void FileList::SaveSelection() { const auto DataLock = lock_data(); @@ -4643,7 +4630,6 @@ void FileList::SaveSelection() } } - void FileList::RestoreSelection() { const auto DataLock = lock_data(); @@ -4660,8 +4646,6 @@ void FileList::RestoreSelection() Redraw(); } - - bool FileList::GetFileName(string& strName, int Pos, os::fs::attributes& FileAttr) const { if (Pos >= static_cast(data_size())) @@ -5065,7 +5049,6 @@ void FileList::SelectSortMode() } } - void FileList::DeleteDiz(const string_view Name, const string_view ShortName) { if (m_PanelMode == panel_mode::NORMAL_PANEL) @@ -5079,7 +5062,6 @@ void FileList::FlushDiz() Diz.Flush(m_CurDir); } - string FileList::GetDizName() const { return m_PanelMode == panel_mode::NORMAL_PANEL? Diz.GetDizName() : string(); @@ -5166,13 +5148,11 @@ void FileList::DescribeFiles() }*/ } - void FileList::SetReturnCurrentFile(bool Mode) { ReturnCurrentFile=Mode; } - bool FileList::ApplyCommand() { static string strPrevCommand; @@ -5241,7 +5221,6 @@ bool FileList::ApplyCommand() return true; } - void FileList::CountDirSize(bool IsRealNames) { unsigned long SelDirCount=0; @@ -5369,13 +5348,11 @@ void FileList::CountDirSize(bool IsRealNames) InitFSWatcher(true); } - int FileList::GetPrevViewMode() const { return (m_PanelMode == panel_mode::PLUGIN_PANEL && !PluginsList.empty())?PluginsList.front()->m_PrevViewMode:m_ViewMode; } - panel_sort FileList::GetPrevSortMode() const { return (m_PanelMode == panel_mode::PLUGIN_PANEL && !PluginsList.empty())?PluginsList.front()->m_PrevSortMode:m_SortMode; @@ -5451,7 +5428,6 @@ void FileList::SetAndUpdateFilePlugin(const string& FileName, std::unique_ptrRedraw(); } - void FileList::ProcessCopyKeys(unsigned const Key) { if (is_data_empty() || !SetCurPath()) @@ -5606,7 +5582,6 @@ string FileList::GetPluginPrefix() const return {}; } - void FileList::GoHome(string_view const Drive) { const auto FarRoot = extract_root_directory(Global->g_strFarModuleName); @@ -6060,7 +6035,6 @@ FileListItem::FileListItem(const PluginPanelItem& pi) m_StreamsSize = FileSize; } - std::unique_ptr FileList::OpenPluginForFile(const string& FileName, os::fs::attributes const FileAttr, OPENFILEPLUGINTYPE const Type, bool* const StopProcessing) { if (FileName.empty() || FileAttr & FILE_ATTRIBUTE_DIRECTORY) @@ -6131,7 +6105,6 @@ void FileList::PluginDelete() AnotherPanel->Redraw(); } - void FileList::PutDizToPlugin(FileList *DestPanel, std::span const ItemList, bool Delete, bool Move, DizList *SrcDiz) const { Global->CtrlObject->Plugins->GetOpenPanelInfo(DestPanel->GetPluginHandle(), &m_CachedOpenPanelInfo); @@ -6208,7 +6181,6 @@ void FileList::PutDizToPlugin(FileList *DestPanel, std::span co DeleteFileWithFolder(strDizName); } - void FileList::PluginGetFiles(const string& DestPath, bool Move) { SaveSelection(); @@ -6271,7 +6243,6 @@ void FileList::PluginGetFiles(const string& DestPath, bool Move) AnotherPanel->Redraw(); } - void FileList::PluginToPluginFiles(bool Move) { const auto AnotherFilePanel = std::dynamic_pointer_cast(Parent()->GetAnotherPanel(this)); @@ -6402,7 +6373,6 @@ void FileList::PluginHostGetFiles() AnotherPanel->Redraw(); } - void FileList::PluginPutFilesToNew() { const auto DataLock = lock_data(); @@ -6452,7 +6422,6 @@ void FileList::PluginPutFilesToNew() } } - /* $ 12.04.2002 IS PluginPutFilesToAnother теперь int - возвращает то, что возвращает PutFiles: @@ -6506,7 +6475,6 @@ int FileList::PluginPutFilesToAnother(bool Move, panel_ptr AnotherPanel) return PutCode; } - void FileList::GetOpenPanelInfo(OpenPanelInfo *Info) const { *Info = {}; @@ -6515,7 +6483,6 @@ void FileList::GetOpenPanelInfo(OpenPanelInfo *Info) const Global->CtrlObject->Plugins->GetOpenPanelInfo(GetPluginHandle(), Info); } - /* Функция для вызова команды "Архивные команды" (Shift-F3) */ @@ -7656,7 +7623,6 @@ void FileList::UpdatePlugin(bool const KeepSelection, bool const UpdateEvenIfPan RefreshTitle(); } - void FileList::ReadDiz(std::span const Items) { if (DizRead) @@ -7743,7 +7709,6 @@ void FileList::ReadDiz(std::span const Items) } } - void FileList::ReadSortGroups(bool UpdateFilterCurrentTime) { if (SortGroupsRead) @@ -8107,7 +8072,6 @@ void FileList::ShowFileList(bool Fast) Parent()->ShowChildren(); } - FarColor FileList::GetShowColor(int Position, bool FileColor) const { if (static_cast(Position) >= data_size()) @@ -8203,6 +8167,9 @@ void FileList::ShowSelectedSize() if (strSelStr.size() > AvailableWidth) inplace::truncate_right(strSelStr, AvailableWidth); } + // Cache the status text length for GetBottomStatusTextBounds + m_CachedStatusTextLength = static_cast(strSelStr.size()); + SetColor(COL_PANELSELECTEDINFO); GotoXY(static_cast(m_Where.left + BorderSize + (AvailableWidth - strSelStr.size()) / 2), m_Where.bottom - 2 * Global->Opt->ShowPanelStatus); Text(L' '); @@ -8214,7 +8181,10 @@ void FileList::ShowSelectedSize() void FileList::ShowTotalSize(const OpenPanelInfo &Info) { if (!Global->Opt->ShowPanelTotals && m_PanelMode == panel_mode::PLUGIN_PANEL && !(Info.Flags & OPIF_REALNAMES)) + { + InvalidateStatusTextCache(); return; + } const auto calc_total_string = [this, Info](bool ShowBytes) { @@ -8256,6 +8226,9 @@ void FileList::ShowTotalSize(const OpenPanelInfo &Info) const string_view TotalStrView = TotalStr; + // Cache the status text length for GetBottomStatusTextBounds + m_CachedStatusTextLength = static_cast(TotalStrView.size()); + SetColor(COL_PANELTOTALINFO); GotoXY(static_cast(m_Where.left + BorderSize + (AvailableWidth - TotalStrView.size()) / 2), m_Where.bottom); const auto BoxPos = TotalStrView.find(BoxSymbols[BS_H2]); @@ -8433,7 +8406,6 @@ void FileList::PrepareViewSettings(int ViewMode) UpdateHeight(); } - void FileList::PreparePanelView() { PrepareColumnWidths(m_ViewSettings.StatusColumns, (m_ViewSettings.Flags&PVS_FULLSCREEN) != 0); @@ -8441,7 +8413,6 @@ void FileList::PreparePanelView() PrepareStripes(m_ViewSettings.PanelColumns); } - void FileList::PrepareColumnWidths(std::vector& Columns, bool FullScreen) const { int ZeroLengthCount = 0; @@ -8603,7 +8574,6 @@ void FileList::PrepareStripes(const std::vector& Columns) m_ColumnsInStripe = ColumnsSize; } - void FileList::HighlightBorder(int Level, int ListPos) const { if (Level == m_ColumnsInStripe) @@ -9140,6 +9110,37 @@ void FileList::background_update() } +bool FileList::GetBottomStatusTextBounds(int& OutStartX, int& OutEndX) const +{ + OutStartX = -1; + OutEndX = -1; + + if (m_CachedStatusTextLength == -1) + { + return false; + } + + // Check if status text should be displayed + const bool hasSelectedFiles = m_SelFileCount > 0; + const bool shouldShowTotals = Global->Opt->ShowPanelTotals || Global->Opt->ShowPanelFree; + + if (!hasSelectedFiles && !shouldShowTotals) + { + return false; // No status text to display + } + + const int BorderSize = 1; + const int MarginSize = 1; + const auto AvailableWidth = static_cast(std::max(0, ObjWidth() - BorderSize * 2 - MarginSize * 2)); + + const auto statusTextLength = static_cast(m_CachedStatusTextLength); + + // Calculate the start and end positions for text status + OutStartX = m_Where.left + BorderSize + static_cast((AvailableWidth - statusTextLength) / 2); + OutEndX = OutStartX + static_cast(statusTextLength) - 1; + + return true; +} bool FileList::IsDizDisplayed() const { diff --git a/far/filelist.hpp b/far/filelist.hpp index b74083c033..b108f22cdf 100644 --- a/far/filelist.hpp +++ b/far/filelist.hpp @@ -198,6 +198,7 @@ class FileList final: public Panel int GetColumnsCount() const override; void SetReturnCurrentFile(bool Mode) override; void GetOpenPanelInfo(OpenPanelInfo *Info) const override; + bool GetBottomStatusTextBounds(int& OutStartX, int& OutEndX) const override; void SetPluginMode(std::unique_ptr&& PluginPanel, string_view PluginFile, bool SendOnFocus = false) override; size_t GetSelCount() const override; bool GetSelName(string *strName, string *strShortName = nullptr, os::fs::find_data *fd = nullptr) override; @@ -487,6 +488,10 @@ class FileList final: public Panel class background_updater; std::unique_ptr m_BackgroundUpdater; + + // Cached status text length for performance optimization + mutable int m_CachedStatusTextLength = -1; + void InvalidateStatusTextCache() const { m_CachedStatusTextLength = -1; } }; #endif // FILELIST_HPP_825FE8AE_1E34_4DFD_B167_2D6A121B1777 diff --git a/far/filepanels.cpp b/far/filepanels.cpp index 170544fde6..be4d1d77fe 100644 --- a/far/filepanels.cpp +++ b/far/filepanels.cpp @@ -61,6 +61,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "diskmenu.hpp" #include "global.hpp" #include "keyboard.hpp" +#include "colormix.hpp" // Platform: #include "platform.env.hpp" @@ -387,6 +388,36 @@ bool FilePanels::ProcessKey(const Manager::Key& Key) { const auto LocalKey = Key(); + // Handle ESC key during resizing to cancel and revert + if (LocalKey == KEY_ESC) + { + if (m_MouseState == MouseState::Resizing) + { + // Cancel width resizing and revert to original state + Global->Opt->WidthDecrement = m_OriginalWidthDecrement; + m_MouseState = MouseState::None; + ClearWidthBorderFeedback(); + m_HoverStartTime = 0; + ResetAllMouseStates(); + SetScreenPosition(); + Global->WindowManager->RefreshWindow(); + return true; + } + else if (m_MouseState == MouseState::HeightResizing) + { + // Cancel height resizing and revert to original state + Global->Opt->LeftHeightDecrement = m_OriginalLeftHeightDecrement; + Global->Opt->RightHeightDecrement = m_OriginalRightHeightDecrement; + m_MouseState = MouseState::None; + ClearHeightBorderFeedback(); + m_HeightHoverStartTime = 0; + ResetAllMouseStates(); + SetScreenPosition(); + Global->WindowManager->RefreshWindow(); + return true; + } + } + if ( any_of(LocalKey, KEY_CTRLLEFT, KEY_CTRLRIGHT, KEY_CTRLNUMPAD4, KEY_CTRLNUMPAD6, @@ -1080,6 +1111,18 @@ void FilePanels::DisplayObject() if (RightPanel()->IsVisible()) RightPanel()->Show(); + // Draw the border feedback if currently resizing + if (m_MouseState == MouseState::Resizing) + { + DrawWidthBorderFeedback(false, true); + } + + // Draw the height border feedback if currently height resizing + if (m_MouseState == MouseState::HeightResizing) + { + DrawHeightBorderFeedback(false, true); + } + #else Panel *PassivePanel=nullptr; int PassiveIsLeftFlag=TRUE; @@ -1126,11 +1169,19 @@ void FilePanels::DisplayObject() #endif } -bool FilePanels::ProcessMouse(const MOUSE_EVENT_RECORD *MouseEvent) +bool FilePanels::ProcessMouse(const MOUSE_EVENT_RECORD* MouseEvent) { - if (!MouseEvent->dwMousePosition.Y) + // Cache essential inputs for better performance + // Defer expensive calculations until needed + const auto& pos = MouseEvent->dwMousePosition; + const DWORD btn = MouseEvent->dwButtonState; + const DWORD flags = MouseEvent->dwEventFlags; + auto& opts = Global->Opt; + + // 1) Far-style title‐bar click + if (pos.Y == 0) { - if (!Global->Opt->ShowColumnTitles) // Sort Mark letter in the menu area + if (!opts->ShowColumnTitles) // Sort Mark letter in the menu area { if (ActivePanel()->ProcessMouse(MouseEvent)) return true; @@ -1138,28 +1189,28 @@ bool FilePanels::ProcessMouse(const MOUSE_EVENT_RECORD *MouseEvent) return true; } - if ((MouseEvent->dwButtonState & 3) && !MouseEvent->dwEventFlags) + if ((btn & 3) && !flags) { - if (!MouseEvent->dwMousePosition.X) + if (pos.X == 0) ProcessKey(Manager::Key(KEY_CTRLO)); else - Global->Opt->ShellOptions(false, MouseEvent); - + opts->ShellOptions(false, MouseEvent); return true; } } - if (MouseEvent->dwButtonState&FROM_LEFT_2ND_BUTTON_PRESSED) + // 2) Middle‐click -> ENTER Key + if (btn & FROM_LEFT_2ND_BUTTON_PRESSED) { - if (!IsMouseButtonEvent(MouseEvent->dwEventFlags)) + if (!IsMouseButtonEvent(flags)) return true; int Key = KEY_ENTER; - if (MouseEvent->dwControlKeyState&SHIFT_PRESSED) + if (MouseEvent->dwControlKeyState & SHIFT_PRESSED) { Key |= KEY_SHIFT; } - if (MouseEvent->dwControlKeyState&(LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) + if (MouseEvent->dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) { Key |= KEY_CTRL; } @@ -1171,11 +1222,311 @@ bool FilePanels::ProcessMouse(const MOUSE_EVENT_RECORD *MouseEvent) return true; } + // 3) Continue/finish a Resizing operation + if (m_MouseState == MouseState::Resizing) + { + const bool leftPressed = (btn & FROM_LEFT_1ST_BUTTON_PRESSED) != 0; + if (leftPressed) + { + const int dx = pos.X - m_ResizeStartX; + const int newDec = m_ResizeStartWidthDecrement - dx; + const int halfXminus10 = ScrX / 2 - 10; // Calculate only when needed + const int clamped = std::clamp(newDec, -halfXminus10, halfXminus10); + if (opts->WidthDecrement != clamped) + { + opts->WidthDecrement = clamped; + Global->WindowManager->ResizeAllWindows(); + } + } + else + { + // mouse released -> stop resizing + m_MouseState = MouseState::None; + ClearWidthBorderFeedback(); + m_HoverStartTime = 0; + ResetAllMouseStates(); + } + return true; + } + + // 3a) Continue/finish a Height Resizing operation + if (m_MouseState == MouseState::HeightResizing) + { + const bool leftPressed = (btn & FROM_LEFT_1ST_BUTTON_PRESSED) != 0; + if (leftPressed) + { + const int dy = m_ResizeStartY - pos.Y; // Inverted: positive dy means mouse moved up (decrease height) + const auto leftPanel = LeftPanel(); + const auto rightPanel = RightPanel(); + const auto leftPanelPos = leftPanel->GetPosition(); + const auto rightPanelPos = rightPanel->GetPosition(); + + // Determine which panel(s) to resize based on mouse X position at start of resize + const int startX = m_ResizeStartX; + + // Calculate boundaries for each panel + const int leftPanelMidX = leftPanelPos.left + (leftPanelPos.right - leftPanelPos.left) / 2; + const int rightPanelMidX = rightPanelPos.left + (rightPanelPos.right - rightPanelPos.left) / 2; + + // First determine which panel the mouse is over + const bool overLeftPanel = (startX >= leftPanelPos.left && startX <= leftPanelPos.right); + const bool overRightPanel = (startX >= rightPanelPos.left && startX <= rightPanelPos.right); + + if (overLeftPanel) + { + // Mouse is over left panel + if (startX <= leftPanelMidX) + { + // Left half of left panel - resize left panel only + const int newLeftDec = m_ResizeStartLeftHeightDecrement + dy; + const int maxDec = ScrY - 7; + const int clampedLeft = std::clamp(newLeftDec, 0, maxDec); + if (opts->LeftHeightDecrement == clampedLeft) + return true; + + opts->LeftHeightDecrement = clampedLeft; + SetScreenPosition(); + Global->WindowManager->RefreshWindow(); + } + else + { + // Right half of left panel (inner half, closer to center) - resize both panels + const int newLeftDec = m_ResizeStartLeftHeightDecrement + dy; + const int newRightDec = m_ResizeStartRightHeightDecrement + dy; + const int maxDec = ScrY - 7; + const int clampedLeft = std::clamp(newLeftDec, 0, maxDec); + const int clampedRight = std::clamp(newRightDec, 0, maxDec); + if (opts->LeftHeightDecrement == clampedLeft && opts->RightHeightDecrement == clampedRight) + return true; + + opts->LeftHeightDecrement = clampedLeft; + opts->RightHeightDecrement = clampedRight; + SetScreenPosition(); + Global->WindowManager->RefreshWindow(); + } + } + else if (overRightPanel) + { + // Mouse is over right panel + if (startX < rightPanelMidX) + { + // Left half of right panel (inner half, closer to center) - resize both panels + const int newLeftDec = m_ResizeStartLeftHeightDecrement + dy; + const int newRightDec = m_ResizeStartRightHeightDecrement + dy; + const int maxDec = ScrY - 7; + const int clampedLeft = std::clamp(newLeftDec, 0, maxDec); + const int clampedRight = std::clamp(newRightDec, 0, maxDec); + if (opts->LeftHeightDecrement == clampedLeft && opts->RightHeightDecrement == clampedRight) + return true; + + opts->LeftHeightDecrement = clampedLeft; + opts->RightHeightDecrement = clampedRight; + SetScreenPosition(); + Global->WindowManager->RefreshWindow(); + } + else + { + // Right half of right panel - resize right panel only + const int newRightDec = m_ResizeStartRightHeightDecrement + dy; + const int maxDec = ScrY - 7; + const int clampedRight = std::clamp(newRightDec, 0, maxDec); + if (opts->RightHeightDecrement == clampedRight) + return true; + + opts->RightHeightDecrement = clampedRight; + SetScreenPosition(); + Global->WindowManager->RefreshWindow(); + } + } + } + else + { + // mouse released -> stop height resizing + m_MouseState = MouseState::None; + ClearHeightBorderFeedback(); + m_HeightHoverStartTime = 0; + ResetAllMouseStates(); + } + return true; + } + + // 4) Border interaction: hover, double‐click, start resize + // Check width border first, but only if NOT already in height resizing mode + const bool overWidthBorder = IsMouseOverPanelInnerBorder(MouseEvent); + const bool overHeightBorder = IsMouseOverPanelBottomBorder(MouseEvent); + + // Priority: if in height resizing mode, ignore width border + // If over both borders, prefer height border (bottom border takes priority) + const bool processWidthBorder = overWidthBorder && !overHeightBorder && + m_MouseState != MouseState::HeightHovering && + m_MouseState != MouseState::HeightResizing; + const bool processHeightBorder = overHeightBorder && + m_MouseState != MouseState::Hovering && + m_MouseState != MouseState::Resizing; + + if (processWidthBorder) + { + // 4a) Double‐click resets to center + if (flags & DOUBLE_CLICK) + { + m_MouseState = MouseState::None; + m_HoverStartTime = 0; + opts->WidthDecrement = 0; + SetScreenPosition(); + Global->WindowManager->RefreshWindow(); + + // Final flush and reset after the refresh to ensure clean state + ResetWidthMouseStates(); + + // Consume the event completely to prevent propagation to panels + return true; + } + + // 4b) Hover (no button pressed) + const bool leftPressed = (btn & FROM_LEFT_1ST_BUTTON_PRESSED) != 0; + if (!leftPressed) + { + const DWORD now = GetTickCount(); + if (m_MouseState == MouseState::None) + { + if (m_HoverStartTime == 0) + { + m_HoverStartTime = now; + return true; + } + + const int hoverThreshold = 300; + if (now - m_HoverStartTime < hoverThreshold) + return true; + + m_MouseState = MouseState::Hovering; + DrawWidthBorderFeedback(true, false); + } + else if (m_MouseState == MouseState::Hovering) + { + DrawWidthBorderFeedback(true, false); + } + return true; + } + + // 4c) Begin resize on first click (no movement yet) + if (m_MouseState == MouseState::Hovering) + { + const bool moved = (flags & MOUSE_MOVED) != 0; + if (!moved) + { + m_MouseState = MouseState::Resizing; + m_ResizeStartX = pos.X; + m_ResizeStartWidthDecrement = opts->WidthDecrement; + m_OriginalWidthDecrement = opts->WidthDecrement; // Save for ESC cancellation + m_HoverStartTime = 0; + + // No ResetWidthMouseStates() here, as we are starting the resize + return true; + } + } + } + else if (m_MouseState == MouseState::Hovering && !overWidthBorder) + { + // left border, but moved off -> clear hover + m_MouseState = MouseState::None; + ClearWidthBorderFeedback(); + m_HoverStartTime = 0; + ResetWidthMouseStates(); + } + + // 4d) Height border interaction: hover, double‐click, start resize + if (processHeightBorder) + { + // 4d1) Double‐click resets to full height + if (flags & DOUBLE_CLICK) + { + m_MouseState = MouseState::None; + m_HeightHoverStartTime = 0; + opts->LeftHeightDecrement = 0; + opts->RightHeightDecrement = 0; + SetScreenPosition(); + Global->WindowManager->RefreshWindow(); + + // Final flush and reset after the refresh to ensure clean state + ResetHeightMouseStates(); + + // Consume the event completely to prevent propagation to panels + return true; + } + + // 4d2) Hover (no button pressed) + const bool leftPressed = (btn & FROM_LEFT_1ST_BUTTON_PRESSED) != 0; + if (!leftPressed) + { + const DWORD now = GetTickCount(); + if (m_MouseState == MouseState::None) + { + if (m_HeightHoverStartTime == 0) + { + m_HeightHoverStartTime = now; + return true; + } + + const int hoverThreshold = 300; + if (now - m_HeightHoverStartTime < hoverThreshold) + return true; + + m_MouseState = MouseState::HeightHovering; + DrawHeightBorderFeedback(true, false); + } + else if (m_MouseState == MouseState::HeightHovering) + { + DrawHeightBorderFeedback(true, false); + } + return true; + } + + // 4d3) Begin height resize on first click (no movement yet) + if (m_MouseState == MouseState::HeightHovering) + { + const bool moved = (flags & MOUSE_MOVED) != 0; + if (!moved) + { + m_MouseState = MouseState::HeightResizing; + m_ResizeStartX = pos.X; // Store X position to determine which panel(s) to resize + m_ResizeStartY = pos.Y; + m_ResizeStartLeftHeightDecrement = opts->LeftHeightDecrement; + m_ResizeStartRightHeightDecrement = opts->RightHeightDecrement; + m_OriginalLeftHeightDecrement = opts->LeftHeightDecrement; // Save for ESC cancellation + m_OriginalRightHeightDecrement = opts->RightHeightDecrement; // Save for ESC cancellation + m_HeightHoverStartTime = 0; + + // No ResetHeightMouseStates() here, as we are starting the resize + return true; + } + } + } + else if (m_MouseState == MouseState::HeightHovering && !overHeightBorder) + { + // left height border, but moved off -> clear hover + m_MouseState = MouseState::None; + ClearHeightBorderFeedback(); + m_HeightHoverStartTime = 0; + ResetHeightMouseStates(); + } + + // 5) Additional safeguard: Don't process double-clicks that might have been + // intended for border but are now over panel area due to resize + if ((flags & DOUBLE_CLICK) && IsMouseOverPanelInnerBorder(MouseEvent)) + { + // This is a double-click that should have been handled by border logic above + // but somehow reached here. Consume it to prevent unwanted panel actions. + return true; + } + if (!ActivePanel()->ProcessMouse(MouseEvent)) { - if (!PassivePanel()->ProcessMouse(MouseEvent)) - if (!m_windowKeyBar->ProcessMouse(MouseEvent)) - CmdLine->ProcessMouse(MouseEvent); + if (!PassivePanel()->ProcessMouse(MouseEvent) && + !m_windowKeyBar->ProcessMouse(MouseEvent)) + { + CmdLine->ProcessMouse(MouseEvent); + } ActivePanel()->SetCurPath(); } @@ -1183,6 +1534,317 @@ bool FilePanels::ProcessMouse(const MOUSE_EVENT_RECORD *MouseEvent) return true; } +bool FilePanels::IsMouseOverPanelInnerBorder(const MOUSE_EVENT_RECORD *MouseEvent) const +{ + const auto MouseX = MouseEvent->dwMousePosition.X; + const auto MouseY = MouseEvent->dwMousePosition.Y; + + // Cache frequently accessed values + const auto& opt = Global->Opt; + const auto BorderX = ScrX / 2 - opt->WidthDecrement; + + // Check a 2-column wide area for the border between panels + if (!(MouseX >= BorderX && MouseX <= BorderX + 1)) + return false; + + // Exclude scroll bar areas from border detection to give scroll bars priority + // But allow 1 additional row below the scrollbar as grip area for width resizing + // Somehow it works only for hightlighting - need to fix + if (opt->ShowPanelScrollbar) + { + const auto leftPanel = LeftPanel(); + const auto leftPanelPos = leftPanel->GetPosition(); + + // Left panel - border (BorderX) is on the right side - we need to avoid the scrollbar area + if (!leftPanel->IsVisible() || MouseX != BorderX) + return true; + + if (MouseX != leftPanelPos.right || leftPanel->GetType() != panel_type::FILE_PANEL) + return true; + + const auto filePanel = std::dynamic_pointer_cast(leftPanel); + if (!filePanel) + return true; + + const int height = leftPanelPos.bottom - leftPanelPos.top - 1; + if (filePanel->GetFileCount() <= static_cast(height)) + return true; + + const auto scrollBarStartY = leftPanelPos.top + 1 + (opt->ShowColumnTitles ? 1 : 0); + // There is conflict with scrollbar area, let's grab one cell from it for the better grip + const auto scrollBarEndY = scrollBarStartY + (height - (opt->ShowColumnTitles ? 1 : 0)) - 1; + if (MouseY >= scrollBarStartY && MouseY < scrollBarEndY) + return false; // This is scroll bar area, not border for width resizing + + // Right panel - scrollbar area doesn't conflict with border (BorderX + 1) - do nothing + + return true; // not scrollbar area or grip area above/below scrollbar + } + + return true; +} + +bool FilePanels::IsMouseOverPanelBottomBorder(const MOUSE_EVENT_RECORD *MouseEvent) const +{ + const auto MouseX = MouseEvent->dwMousePosition.X; + const auto MouseY = MouseEvent->dwMousePosition.Y; + + // Cache frequently accessed values + const auto leftPanel = LeftPanel(); + const auto rightPanel = RightPanel(); + const auto leftPanelPos = leftPanel->GetPosition(); + const auto rightPanelPos = rightPanel->GetPosition(); + + // Check if mouse is over the bottom border of either panel + const auto leftBottomY = leftPanelPos.bottom; + const auto rightBottomY = rightPanelPos.bottom; + + // Left panel bottom border + if (leftPanel->IsVisible() && MouseY == leftBottomY && + MouseX >= leftPanelPos.left && MouseX <= leftPanelPos.right) + { + return true; + } + + // Right panel bottom border + if (rightPanel->IsVisible() && MouseY == rightBottomY && + MouseX >= rightPanelPos.left && MouseX <= rightPanelPos.right) + { + return true; + } + + return false; +} + +FarColor FilePanels::GetBorderFeedbackColor() +{ + // Get the dragging border color first - this respects user's custom color choices + auto Result = colors::PaletteColorToFarColor(COL_PANELDRAGBORDER); + const auto& DragTextColor = colors::PaletteColorToFarColor(COL_PANELDRAGTEXT); + const auto& SelectedTextColor = colors::PaletteColorToFarColor(COL_PANELSELECTEDTEXT); + const auto& PanelTextColor = colors::PaletteColorToFarColor(COL_PANELTEXT); + + // Check if the dragging border color is using the default palette value + // Default palette value for COL_PANELDRAGBORDER is F_YELLOW|B_BLUE + const auto DefaultDragBorderColor = F_YELLOW | B_BLUE; + + // If the current color matches the default palette value, or if it seems uninitialized, + // apply the fallback logic (theme doesn't define this color or user hasn't customized it) + if (const auto CurrentDragBorderRaw = (Result.ForegroundColor & 0x0F) | ((Result.BackgroundColor & 0x0F) << 4); + CurrentDragBorderRaw == DefaultDragBorderColor || + Result.ForegroundColor == Result.BackgroundColor || + Result.ForegroundColor == 0) + { + // Apply fallback logic: foreground from dragging text (or selected text), background from panel + Result.ForegroundColor = DragTextColor.ForegroundColor != 0 ? DragTextColor.ForegroundColor : SelectedTextColor.ForegroundColor; + Result.BackgroundColor = PanelTextColor.BackgroundColor; + } + + return Result; +} + +void FilePanels::DrawWidthBorderFeedback(bool IsHovering, bool IsDragging) +{ + // Show visual feedback on hover and during dragging + if (!IsHovering && !IsDragging) + return; + + // Cache frequently accessed pointers and values + const auto leftPanel = LeftPanel(); + const auto rightPanel = RightPanel(); + const auto leftPanelPos = leftPanel->GetPosition(); + const auto rightPanelPos = rightPanel->GetPosition(); + const auto& opt = Global->Opt; + + const auto BorderX = ScrX / 2 - opt->WidthDecrement; + const auto borderX = static_cast(BorderX); + + const auto BorderColor = GetBorderFeedbackColor(); + + static constexpr wchar_t BorderChar[] = L"║"; + + // Draw full height border feedback + const auto StartY = 1; + const auto EndY = ScrY - 2; + + const int borderXPlus = borderX + 1; + const bool drawLeft = leftPanel->IsVisible(); + const bool drawRight = rightPanel->IsVisible() && borderX < ScrX - 1; + + // Calculate actual drawing boundaries based on panel heights + const auto leftPanelStartY = std::max(StartY, static_cast(leftPanelPos.top + 1)); + const auto leftPanelEndY = std::min(EndY, static_cast(leftPanelPos.bottom)); + const auto rightPanelStartY = std::max(StartY, static_cast(rightPanelPos.top + 1)); + const auto rightPanelEndY = std::min(EndY, static_cast(rightPanelPos.bottom)); + + // Helper function to get scroll bar boundaries for a panel + auto getScrollBarBounds = [&](const panel_ptr& panel) -> std::tuple { + if (!opt->ShowPanelScrollbar || !panel->IsVisible() || panel->GetType() != panel_type::FILE_PANEL) + return {false, 0, 0}; + + const auto filePanel = std::dynamic_pointer_cast(panel); + if (!filePanel) return {false, 0, 0}; + + const auto panelPos = panel->GetPosition(); + const bool hasScrollBar = filePanel->GetFileCount() > static_cast(panelPos.bottom - panelPos.top - 1); + + if (!hasScrollBar) return {false, 0, 0}; + + const auto scrollBarStartY = panelPos.top + 1 + (opt->ShowColumnTitles ? 1 : 0); + // There is conflict with scrollbar area, let's grab one cell from it for the better grip + const auto scrollBarEndY = scrollBarStartY + (panelPos.bottom - panelPos.top - 2 - (opt->ShowColumnTitles ? 1 : 0)) - 1; + + return {true, scrollBarStartY, scrollBarEndY}; + }; + + const auto [leftHasScrollBar, leftScrollBarStart, leftScrollBarEnd] = getScrollBarBounds(LeftPanel()); + + // Draw borders for full height, respecting panel boundaries and scrollbars + for (int y = StartY; y < EndY; ++y) + { + if (drawLeft && y >= leftPanelStartY && y < leftPanelEndY) + { + bool skipForScrollBar = leftHasScrollBar && (borderX == leftPanelPos.right) && + (y >= leftScrollBarStart && y < leftScrollBarEnd); + + if (!skipForScrollBar) + { + GotoXY(borderX, y); + Text({ borderX, y }, BorderColor, BorderChar); + } + } + if (drawRight && y >= rightPanelStartY && y < rightPanelEndY) + { + GotoXY(borderXPlus, y); + Text({ borderXPlus, y }, BorderColor, BorderChar); + } + } + + m_LastWidthFeedbackY = StartY; // Mark that width feedback is drawn +} + +void FilePanels::ClearWidthBorderFeedback() +{ + if (m_LastWidthFeedbackY == -1) + return; + + // Clear feedback by refreshing the window + Global->WindowManager->RefreshWindow(); + m_LastWidthFeedbackY = -1; +} + +std::pair FilePanels::DetermineHeightHighlightPanels(bool IsDragging, const rectangle& leftPanelPos, const rectangle& rightPanelPos) +{ + const int mouseX = IsDragging ? m_ResizeStartX : IntKeyState.MousePos.x; + const int leftPanelMidX = leftPanelPos.left + (leftPanelPos.right - leftPanelPos.left) / 2; + const int rightPanelMidX = rightPanelPos.left + (rightPanelPos.right - rightPanelPos.left) / 2; + + bool highlightLeft = false; + bool highlightRight = false; + + const bool overLeftPanel = (mouseX >= leftPanelPos.left && mouseX <= leftPanelPos.right); + const bool overRightPanel = (mouseX >= rightPanelPos.left && mouseX <= rightPanelPos.right); + + if (overLeftPanel) + { + if (mouseX <= leftPanelMidX) + { + highlightLeft = true; + } + else + { + highlightLeft = true; + highlightRight = true; + } + } + else if (overRightPanel) + { + if (mouseX < rightPanelMidX) + { + highlightLeft = true; + highlightRight = true; + } + else + { + highlightRight = true; + } + } + + return { highlightLeft, highlightRight }; +} + +void FilePanels::DrawPanelBottomBorder(const std::shared_ptr& panel, const rectangle& panelPos, const FarColor& BorderColor, const wchar_t* BorderChar) +{ + if (!panel->IsVisible()) + return; + + const auto bottomY = panelPos.bottom; + int statusStartX = -1, statusEndX = -1; + + if (const auto fileListPanel = std::dynamic_pointer_cast(panel)) + { + fileListPanel->GetBottomStatusTextBounds(statusStartX, statusEndX); + } + + if (statusStartX != -1 && statusEndX != -1) + { + // Draw border segments around status text + for (int x = panelPos.left + 1; x < statusStartX; ++x) + { + GotoXY(x, bottomY); + Text({ x, bottomY }, BorderColor, BorderChar); + } + + for (int x = statusEndX + 3; x < panelPos.right; ++x) + { + GotoXY(x, bottomY); + Text({ x, bottomY }, BorderColor, BorderChar); + } + } + else + { + // Draw full bottom border (except corners) + for (int x = panelPos.left + 1; x < panelPos.right; ++x) + { + GotoXY(x, bottomY); + Text({ x, bottomY }, BorderColor, BorderChar); + } + } +} + +void FilePanels::DrawHeightBorderFeedback(bool IsHovering, bool IsDragging) +{ + if (!IsHovering && !IsDragging) + return; + + const auto leftPanel = LeftPanel(); + const auto rightPanel = RightPanel(); + const auto leftPanelPos = leftPanel->GetPosition(); + const auto rightPanelPos = rightPanel->GetPosition(); + + const auto BorderColor = GetBorderFeedbackColor(); + static constexpr wchar_t BorderChar[] = L"═"; + + const auto [highlightLeft, highlightRight] = DetermineHeightHighlightPanels(IsDragging, leftPanelPos, rightPanelPos); + + if (highlightLeft) + DrawPanelBottomBorder(leftPanel, leftPanelPos, BorderColor, BorderChar); + + if (highlightRight) + DrawPanelBottomBorder(rightPanel, rightPanelPos, BorderColor, BorderChar); + + m_LastHeightFeedbackX = leftPanelPos.left; // Mark that height feedback is drawn +} +void FilePanels::ClearHeightBorderFeedback() +{ + if (m_LastHeightFeedbackX == -1) + return; + + // Clear feedback by refreshing the window + Global->WindowManager->RefreshWindow(); + m_LastHeightFeedbackX = -1; +} + void FilePanels::ShowConsoleTitle() { ActivePanel()->RefreshTitle(); @@ -1302,3 +1964,36 @@ void FilePanels::Show() TopMenuBar->Show(); } } + +void FilePanels::ResetAllMouseStates() +{ + FlushInputBuffer(); + + // Reset Far's internal mouse state tracking + IntKeyState.MouseButtonState = 0; + IntKeyState.PrevMouseButtonState = 0; + IntKeyState.PrevLButtonPressed = false; + IntKeyState.PrevRButtonPressed = false; + IntKeyState.PrevMButtonPressed = false; + IntKeyState.MouseEventFlags = 0; + IntKeyState.PreMouseEventFlags = 0; + + // Reset drag-and-drop state + Panel::EndDrag(); +} + +void FilePanels::ResetWidthMouseStates() const +{ + // Reset width-specific states only + m_HoverStartTime = 0; +} + +void FilePanels::ResetHeightMouseStates() const +{ + // Reset height-specific states only + m_HeightHoverStartTime = 0; + m_LastHeightFeedbackX = -1; + m_ResizeStartY = 0; + m_ResizeStartLeftHeightDecrement = 0; + m_ResizeStartRightHeightDecrement = 0; +} diff --git a/far/filepanels.hpp b/far/filepanels.hpp index 4d9c058072..3890407da0 100644 --- a/far/filepanels.hpp +++ b/far/filepanels.hpp @@ -92,6 +92,8 @@ class FilePanels final: public window, public ViewerContainer bool IsLeftActive() const { return m_ActivePanelIndex == panel_left; } bool IsRightActive() const { return m_ActivePanelIndex == panel_right; } + // Check if currently in resizing mode (for macro ESC key handling) + bool IsInResizingMode() const { return m_MouseState == MouseState::Resizing || m_MouseState == MouseState::HeightResizing; } panel_ptr GetAnotherPanel(panel_ptr Current) const { return GetAnotherPanel(Current.get()); } panel_ptr GetAnotherPanel(const Panel* Current) const; @@ -111,6 +113,26 @@ class FilePanels final: public window, public ViewerContainer static void SetPassivePanelInternal(panel_ptr ToBePassive); void SetActivePanelInternal(panel_ptr ToBeActive); + // Panel border mouse handling for resizing + bool IsMouseOverPanelInnerBorder(const MOUSE_EVENT_RECORD *MouseEvent) const; + void DrawWidthBorderFeedback(bool IsHovering, bool IsDragging); + void ClearWidthBorderFeedback(); + void ResetAllMouseStates(); + void ResetWidthMouseStates() const; + + // Panel height resizing functions + bool IsMouseOverPanelBottomBorder(const MOUSE_EVENT_RECORD *MouseEvent) const; + void DrawHeightBorderFeedback(bool IsHovering, bool IsDragging); + void ClearHeightBorderFeedback(); + void ResetHeightMouseStates() const; + + // Helper functions for height border feedback + std::pair DetermineHeightHighlightPanels(bool IsDragging, const rectangle& leftPanelPos, const rectangle& rightPanelPos); + void DrawPanelBottomBorder(const std::shared_ptr& panel, const rectangle& panelPos, const FarColor& BorderColor, const wchar_t* BorderChar); + + // Common helper for border color calculation + static FarColor GetBorderFeedbackColor(); + panel_ptr CreatePanel(panel_type Type); void SetPanelPositions(bool LeftFullScreen, bool RightFullScreen) const; int SetAnhoterPanelFocus(); @@ -139,6 +161,34 @@ class FilePanels final: public window, public ViewerContainer m_Panels[panels_count]; panel_index m_ActivePanelIndex; + + // Panel resizing state + mutable int m_ResizeStartX = 0; + mutable int m_ResizeStartWidthDecrement = 0; + mutable int m_LastWidthFeedbackY = -1; + mutable DWORD m_HoverStartTime = 0; // For hover delay + + // Panel height resizing state + mutable int m_ResizeStartY = 0; + mutable int m_ResizeStartLeftHeightDecrement = 0; + mutable int m_ResizeStartRightHeightDecrement = 0; + mutable int m_LastHeightFeedbackX = -1; + mutable DWORD m_HeightHoverStartTime = 0; + + // Original state for ESC cancellation + mutable int m_OriginalWidthDecrement = 0; + mutable int m_OriginalLeftHeightDecrement = 0; + mutable int m_OriginalRightHeightDecrement = 0; + + enum class MouseState + { + None, + Hovering, + Resizing, + HeightHovering, + HeightResizing + }; + mutable MouseState m_MouseState = MouseState::None; }; #endif // FILEPANELS_HPP_B2D6495E_DA8B_4E72_80F5_37282A14C316 diff --git a/far/keyboard.cpp b/far/keyboard.cpp index cf20ffce17..84e8a898c5 100644 --- a/far/keyboard.cpp +++ b/far/keyboard.cpp @@ -673,6 +673,13 @@ static bool ProcessMacros(INPUT_RECORD* rec, DWORD& Result) if (const auto MacroKey = Global->CtrlObject->Macro.GetKey()) { + // Block ESC key from being processed by macros during panel resizing + // ESC should only be handled by FilePanels::ProcessKey to cancel resizing + if (MacroKey == KEY_ESC && Global->CtrlObject->Cp()->IsInResizingMode()) + { + return false; // Prevent ESC macro from executing during resizing + } + static int LastMsClickMacroKey = 0; if (const auto MsClickKey = KeyMsClickToButtonState(MacroKey)) { @@ -913,6 +920,13 @@ static DWORD GetInputRecordImpl(INPUT_RECORD *rec,bool ExcludeMacro,bool Process if (NotMacros || ExcludeMacro) return CalcKey; + // Block ESC key from being processed by macros during panel resizing + // ESC should only be handled by FilePanels::ProcessKey to cancel resizing + if (CalcKey == KEY_ESC && Global->CtrlObject && Global->CtrlObject->Cp() && Global->CtrlObject->Cp()->IsInResizingMode()) + { + return CalcKey; // Don't process ESC through macros during resizing, consume the event + } + const FAR_INPUT_RECORD irec{ CalcKey, *rec }; if (!Global->CtrlObject || !Global->CtrlObject->Macro.ProcessEvent(&irec)) return CalcKey; @@ -1075,6 +1089,14 @@ static DWORD GetInputRecordImpl(INPUT_RECORD *rec,bool ExcludeMacro,bool Process console.ReadOneInput(*rec); + // Block ALL keyboard input during panel resizing (except ESC which is handled in FilePanels::ProcessKey) + // This check is AFTER ReadOneInput to ensure the event is consumed from the queue + if (rec->EventType == KEY_EVENT && CalcKey != KEY_NONE && Global->CtrlObject && Global->CtrlObject->Cp() && + Global->CtrlObject->Cp()->IsInResizingMode() && CalcKey != KEY_ESC) + { + return KEY_NONE; // Block all other keyboard keys during resizing + } + if (rec->EventType == FOCUS_EVENT) { return ProcessFocusEvent(rec->Event.FocusEvent.bSetFocus != FALSE); diff --git a/far/palette.cpp b/far/palette.cpp index bf1235d9f6..5e2ab8e85b 100644 --- a/far/palette.cpp +++ b/far/palette.cpp @@ -209,6 +209,7 @@ Init[] {L"WarnDialog.DefaultButton.Selected"sv, F_BLACK|B_LIGHTGRAY, }, // COL_WARNDIALOGSELECTEDDEFAULTBUTTON, {L"WarnDialog.DefaultButton.Highlight"sv, F_YELLOW|B_RED, }, // COL_WARNDIALOGHIGHLIGHTDEFAULTBUTTON, {L"WarnDialog.DefaultButton.Highlight.Selected"sv, F_YELLOW|B_LIGHTGRAY, }, // COL_WARNDIALOGHIGHLIGHTSELECTEDDEFAULTBUTTON, + {L"Panel.DragBorder"sv, F_YELLOW|B_BLUE, }, // COL_PANELDRAGBORDER, }; static_assert(std::size(Init) == COL_LASTPALETTECOLOR); diff --git a/far/panel.hpp b/far/panel.hpp index 5d910ba817..82c26579dd 100644 --- a/far/panel.hpp +++ b/far/panel.hpp @@ -158,6 +158,7 @@ class Panel: public ScreenObject, public std::enable_shared_from_this virtual void SetReturnCurrentFile(bool Mode) {} virtual void QViewDelTempName() {} virtual void GetOpenPanelInfo(OpenPanelInfo* Info) const; + virtual bool GetBottomStatusTextBounds(int& OutStartX, int& OutEndX) const { OutStartX = -1; OutEndX = -1; return false; } virtual void SetPluginMode(std::unique_ptr&& hPlugin, string_view PluginFile, bool SendOnFocus = false) {} virtual void SetPluginModified() {} virtual bool ProcessPluginEvent(int Event,void *Param) {return false;} diff --git a/far/setcolor.cpp b/far/setcolor.cpp index 355abbdb70..9a9809328e 100644 --- a/far/setcolor.cpp +++ b/far/setcolor.cpp @@ -313,6 +313,7 @@ void SetColors() { lng::MSetColorPanelHighlightedInfo, COL_PANELINFOTEXT }, { lng::MSetColorPanelDragging, COL_PANELDRAGTEXT }, { lng::MSetColorPanelBox, COL_PANELBOX }, + { lng::MSetColorPanelDraggingBorder, COL_PANELDRAGBORDER, {}, { COL_PANELDRAGTEXT } }, { lng::MSetColorPanelNormalCursor, COL_PANELCURSOR, {}, { COL_PANELTEXT } }, { lng::MSetColorPanelSelectedCursor, COL_PANELSELECTEDCURSOR, {}, { COL_PANELCURSOR, COL_PANELSELECTEDTEXT, COL_PANELTEXT } }, { lng::MSetColorPanelNormalTitle, COL_PANELTITLE }, diff --git a/far/vbuild.m4 b/far/vbuild.m4 index 24d302ea4b..547a01a89a 100644 --- a/far/vbuild.m4 +++ b/far/vbuild.m4 @@ -1 +1 @@ -6566 +6572 From 02a9690dda74268c5a400d74e40a8b953de5adac Mon Sep 17 00:00:00 2001 From: yulian5 Date: Mon, 27 Oct 2025 23:30:14 -0700 Subject: [PATCH 2/2] Addressed all review feedback. Fixed some help and color files. --- .../Colors_from_Gernichenko.farconfig | 1 + .../Interface/Colors_from_Sadovoj.farconfig | 1 + .../Colors_from_admin_essp_ru.farconfig | 1 + .../Colors/Interface/FARColors242.farconfig | 1 + .../Colors/Interface/GreenMile.farconfig | 1 + .../Interface/Rodion_Doroshkevich.farconfig | 1 + .../Colors/Interface/VaxColors.farconfig | 1 + .../Interface/black_and_white.farconfig | 1 + .../Interface/black_from_Fonarev.farconfig | 1 + .../Interface/black_from_Myodov.farconfig | 1 + .../Interface/black_from_july.farconfig | 1 + .../Addons/Colors/Interface/dn_like.farconfig | 1 + extra/Addons/Colors/Interface/hell.farconfig | 1 + .../Addons/Colors/Interface/nc5pal2.farconfig | 1 + far/FarCze.hlf.m4 | 19 ++++++- far/FarEng.hlf.m4 | 24 ++++---- far/FarGer.hlf.m4 | 18 +++--- far/FarHun.hlf.m4 | 20 ++++++- far/FarPol.hlf.m4 | 55 ++++++++++++------- far/FarRus.hlf.m4 | 8 +-- far/FarSky.hlf.m4 | 27 ++++++--- far/FarUkr.hlf.m4 | 6 +- far/changelog | 45 ++++++++++++++- far/farlang.templ.m4 | 2 +- far/filelist.cpp | 53 +++++++++++++++++- far/filepanels.cpp | 31 +---------- far/filepanels.hpp | 2 - far/keyboard.cpp | 2 + far/vbuild.m4 | 2 +- 29 files changed, 228 insertions(+), 100 deletions(-) diff --git a/extra/Addons/Colors/Interface/Colors_from_Gernichenko.farconfig b/extra/Addons/Colors/Interface/Colors_from_Gernichenko.farconfig index d114c8c272..525d64d354 100644 --- a/extra/Addons/Colors/Interface/Colors_from_Gernichenko.farconfig +++ b/extra/Addons/Colors/Interface/Colors_from_Gernichenko.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/Colors_from_Sadovoj.farconfig b/extra/Addons/Colors/Interface/Colors_from_Sadovoj.farconfig index 0e8537ac39..bb640feb25 100644 --- a/extra/Addons/Colors/Interface/Colors_from_Sadovoj.farconfig +++ b/extra/Addons/Colors/Interface/Colors_from_Sadovoj.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/Colors_from_admin_essp_ru.farconfig b/extra/Addons/Colors/Interface/Colors_from_admin_essp_ru.farconfig index b6101ca70b..3ac1e6eb0d 100644 --- a/extra/Addons/Colors/Interface/Colors_from_admin_essp_ru.farconfig +++ b/extra/Addons/Colors/Interface/Colors_from_admin_essp_ru.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/FARColors242.farconfig b/extra/Addons/Colors/Interface/FARColors242.farconfig index f24ef5b69c..a4b55dc25c 100644 --- a/extra/Addons/Colors/Interface/FARColors242.farconfig +++ b/extra/Addons/Colors/Interface/FARColors242.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/GreenMile.farconfig b/extra/Addons/Colors/Interface/GreenMile.farconfig index 9100474064..1c125c2b41 100644 --- a/extra/Addons/Colors/Interface/GreenMile.farconfig +++ b/extra/Addons/Colors/Interface/GreenMile.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/Rodion_Doroshkevich.farconfig b/extra/Addons/Colors/Interface/Rodion_Doroshkevich.farconfig index dfbd290719..d32406d958 100644 --- a/extra/Addons/Colors/Interface/Rodion_Doroshkevich.farconfig +++ b/extra/Addons/Colors/Interface/Rodion_Doroshkevich.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/VaxColors.farconfig b/extra/Addons/Colors/Interface/VaxColors.farconfig index 1bb0c3fe9c..c2854a4a94 100644 --- a/extra/Addons/Colors/Interface/VaxColors.farconfig +++ b/extra/Addons/Colors/Interface/VaxColors.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/black_and_white.farconfig b/extra/Addons/Colors/Interface/black_and_white.farconfig index 67de8c99d1..a322546675 100644 --- a/extra/Addons/Colors/Interface/black_and_white.farconfig +++ b/extra/Addons/Colors/Interface/black_and_white.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/black_from_Fonarev.farconfig b/extra/Addons/Colors/Interface/black_from_Fonarev.farconfig index 5158656af8..e5c3e4b25b 100644 --- a/extra/Addons/Colors/Interface/black_from_Fonarev.farconfig +++ b/extra/Addons/Colors/Interface/black_from_Fonarev.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/black_from_Myodov.farconfig b/extra/Addons/Colors/Interface/black_from_Myodov.farconfig index a8cc59c7e4..94d5ba48fc 100644 --- a/extra/Addons/Colors/Interface/black_from_Myodov.farconfig +++ b/extra/Addons/Colors/Interface/black_from_Myodov.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/black_from_july.farconfig b/extra/Addons/Colors/Interface/black_from_july.farconfig index a014e37b9e..9f551995ff 100644 --- a/extra/Addons/Colors/Interface/black_from_july.farconfig +++ b/extra/Addons/Colors/Interface/black_from_july.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/dn_like.farconfig b/extra/Addons/Colors/Interface/dn_like.farconfig index 6bc7d5249b..07bd606f79 100644 --- a/extra/Addons/Colors/Interface/dn_like.farconfig +++ b/extra/Addons/Colors/Interface/dn_like.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/hell.farconfig b/extra/Addons/Colors/Interface/hell.farconfig index b0ed094ce4..ca9d6fa3cc 100644 --- a/extra/Addons/Colors/Interface/hell.farconfig +++ b/extra/Addons/Colors/Interface/hell.farconfig @@ -85,6 +85,7 @@ + diff --git a/extra/Addons/Colors/Interface/nc5pal2.farconfig b/extra/Addons/Colors/Interface/nc5pal2.farconfig index b299458f7d..d824405932 100644 --- a/extra/Addons/Colors/Interface/nc5pal2.farconfig +++ b/extra/Addons/Colors/Interface/nc5pal2.farconfig @@ -85,6 +85,7 @@ + diff --git a/far/FarCze.hlf.m4 b/far/FarCze.hlf.m4 index 9328597286..c2abe7702a 100644 --- a/far/FarCze.hlf.m4 +++ b/far/FarCze.hlf.m4 @@ -365,12 +365,15 @@ $ #Ovládání panelů# Skrytí/ukázání levého panelu #Ctrl+F1# Skrytí/ukázání pravého panelu #Ctrl+F2# Změna výšky panelu #Ctrl+Nahoru,Ctrl+Dolů# + Změna výšky aktuálního panelu #Ctrl+Shift+Nahoru,Ctrl+Shift+Dolů# + Změna výšky panelů myší #Přetažení dolní hranice panelů# Změna šířky panelů klávesnicí #Ctrl+Vlevo,Ctrl+Vpravo# (pokud je příkazová řádka prázdná) Změna šířky panelů myší #Přetažení hranice mezi panely# Obnovení nastavení implicitní šířky panelů #Ctrl+Numpad5# - #Dvojklik myší na hranici mezi panely# - Restore default panels height #Ctrl+Alt+Numpad5# + nebo myší #Dvojklik# na hranici mezi panely + Obnovení nastavení implicitní výšky panelů #Ctrl+Alt+Numpad5# + nebo myší #Dvojklik# na dolní hranici panelu Zobrazení/Skrytí panelu funkčních kláves na spodní části. #Ctrl+B# Toggle total and free size show mode #Ctrl+Shift+S# in bytes (if possible) or with size suffixes K/M/G/T @@ -1189,6 +1192,18 @@ pomocí prvního znaku jeho názvu. - ^Najeďte kurzorem myši na hranici mezi levým a pravým panelem, abyste viděli vizuální zpětnou vazbu označující oblast, kterou lze změnit. - ^Klikněte a táhněte hranici doleva nebo doprava pro úpravu šířky panelů. - ^Dvojklikněte na hranici pro obnovení výchozí stejné šířky panelů (rozdělení 50/50). + - ^Stiskněte #Esc# během změny velikosti pro zrušení a návrat k původní šířce panelů. + + #Změna výšky:# + - ^Najeďte kurzorem myši na spodní hranici panelu, abyste viděli vizuální zpětnou vazbu označující oblast, kterou lze změnit. + - ^Klikněte a táhněte spodní hranici nahoru nebo dolů pro úpravu výšky panelu. + - ^Chování změny velikosti závisí na horizontální pozici myši: + - ^Nad spodní hranicí LEVÉHO panelu v levé polovině panelu → Změna velikosti pouze LEVÉHO panelu + - ^Nad spodní hranicí LEVÉHO panelu v pravé polovině panelu → Změna velikosti OBOU panelů + - ^Nad spodní hranicí PRAVÉHO panelu v levé polovině panelu → Změna velikosti OBOU panelů + - ^Nad spodní hranicí PRAVÉHO panelu v pravé polovině panelu → Změna velikosti pouze PRAVÉHO panelu + - ^Dvojklikněte na spodní hranici pro obnovení plné výšky panelu. + - ^Stiskněte #Esc# během změny velikosti pro zrušení a návrat k původní výšce panelů. See also the list of ~macro keys~@KeyMacroShellList@, available in the panels. diff --git a/far/FarEng.hlf.m4 b/far/FarEng.hlf.m4 index db62aec237..7c591e4b61 100644 --- a/far/FarEng.hlf.m4 +++ b/far/FarEng.hlf.m4 @@ -365,13 +365,14 @@ $ #Panel control commands# Hide/show right panel #Ctrl+F2# Change panels height #Ctrl+Up,Ctrl+Down# Change current panel height #Ctrl+Shift+Up,Ctrl+Shift+Down# - Change panels height with mouse #Drag bottom border of panels# + Change panels height with mouse #Drag bottom border# of panels Change panels width with keyboard #Ctrl+Left,Ctrl+Right# - (only when the command line is empty) + (when the command line is empty) Change panels width with mouse #Drag border between panels# - Restore default panels width #Ctrl+Numpad5# - #Mouse double click on border between panels# - Restore default panels height #Ctrl+Alt+Numpad5# + Restore default panels width keyboard #Ctrl+Numpad5# + or with mouse #Double click# on border between panels + Restore default panels height with keyboard #Ctrl+Alt+Numpad5# + or with mouse #Double click# on bottom border of panel Show/Hide functional key bar at the bottom line. #Ctrl+B# Toggle total and free size show mode #Ctrl+Shift+S# in bytes (if possible) or with size suffixes K/M/G/T @@ -887,8 +888,8 @@ default button or does another similar thing). #Mouse# Clicking the #middle mouse button# in the ~panels~@PanelCmd@ has the same - effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, - #Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. +effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, +#Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. Far Manager also supports the ~mouse wheel~@MsWheel@. @@ -903,7 +904,7 @@ $ #Special commands# $ #Mouse: wheel support# #Panels# Rotating the wheel scrolls the file list without changing the cursor position on the screen. - Pressing the #middle button# has the same effect as pressing #Enter#. +Pressing the #middle button# has the same effect as pressing #Enter#. #Editor# Rotating the wheel scrolls the text without changing the cursor position on the screen @@ -917,11 +918,11 @@ $ #Mouse: wheel support# #Menus# Wheel scrolling works as #Up#/#Down# keys. Pressing the #middle button# has the same effect as - pressing #Enter#. It is possible to choose items without moving the cursor. +pressing #Enter#. It is possible to choose items without moving the cursor. #Dialogs# In dialogs, when the wheel is rotated at an edit line with a history list or a combo box, - the drop-down list is opened. In the drop-down list scrolling works the same as in menus. +the drop-down list is opened. In the drop-down list scrolling works the same as in menus. You can specify the number of lines to scroll at a time in the panels, editor and viewer (see ~System.MsWheelDelta~@System.MsWheelDelta@). @@ -1184,9 +1185,6 @@ by the first letters of its name. - ^Double-click on the bottom border to restore full panel height. - ^Press #Esc# during resizing to cancel and revert to the original panel heights. - #Note for ConEmu users:# - ^To avoid duplicated resizing indicators and methods, it's recommended to disable ConEmu's Far Manager panel resize feature by unchecking #Settings → Far Manager → Resize panels by mouse#. - See also the list of ~macro keys~@KeyMacroShellList@, available in the panels. diff --git a/far/FarGer.hlf.m4 b/far/FarGer.hlf.m4 index e4efb4de7d..1d73ef940f 100644 --- a/far/FarGer.hlf.m4 +++ b/far/FarGer.hlf.m4 @@ -368,14 +368,15 @@ $ #Befehl zur Fenstersteuerung# Linkes Fenster anzeigen/verbergen #Strg+F1# Rechtes Fenster anzeigen/verbergen #Strg+F2# Fensterhöhe ändern #Strg+↑,Strg+↓# - Change current panel height #Ctrl+Shift+Up,Ctrl+Shift+Down# + Aktuelle Fensterhöhe ändern #Strg+Shift+↑,Strg+Shift+↓# Fensterhöhe mit Maus ändern #Untere Grenze der Fenster ziehen# Fensterbreite mit Tastatur ändern #Strg+Links,Strg+Rechts# (b.leerer Kommandozeile) Fensterbreite mit Maus ändern #Grenze zwischen Fenstern ziehen# Standardfensterbreite wiederherstellen #Strg+Num5# - #Maus-Doppelklick auf Grenze zwischen Fenstern# - Restore default panels height #Ctrl+Alt+Numpad5# + oder mit Maus #Doppelklick# auf Grenze zwischen Fenstern + Standardfensterhöhe wiederherstellen #Strg+Alt+Num5# + oder mit Maus #Doppelklick# auf untere Grenze der Fenster Show/Hide functional key bar at the bottom line. #Ctrl+B# Toggle total and free size show mode #Ctrl+Shift+S# in bytes (if possible) or with size suffixes K/M/G/T @@ -899,8 +900,8 @@ default button or does another similar thing). #Mouse# Clicking the #middle mouse button# in the ~panels~@PanelCmd@ has the same - effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, - #Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. +effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, +#Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. Far Manager also supports the ~mouse wheel~@MsWheel@. @@ -915,7 +916,7 @@ $ #Special commands# $ #Mouse: wheel support# #Panels# Rotating the wheel scrolls the file list without changing the cursor position on the screen. - Pressing the #middle button# has the same effect as pressing #Enter#. +Pressing the #middle button# has the same effect as pressing #Enter#. #Editor# Rotating the wheel scrolls the text without changing the cursor position on the screen @@ -929,7 +930,7 @@ $ #Mouse: wheel support# #Menus# Wheel scrolling works as #Up#/#Down# keys. Pressing the #middle button# has the same effect as - pressing #Enter#. It is possible to choose items without moving the cursor. +pressing #Enter#. It is possible to choose items without moving the cursor. #Dialogs# In dialogs, when the wheel is rotated at an edit line with a history list or a combo box, @@ -1207,9 +1208,6 @@ staben eines Namens auf die Datei zu springen. - ^Doppelklicken Sie auf die untere Grenze, um die volle Fensterhöhe wiederherzustellen. - ^Drücken Sie #Esc# während der Größenänderung, um abzubrechen und zur ursprünglichen Fensterhöhe zurückzukehren. - #Hinweis für ConEmu-Benutzer:# - ^Um doppelte Größenänderungsindikatoren und -methoden zu vermeiden, wird empfohlen, die Far Manager-Fenstergröße-Funktion in ConEmu zu deaktivieren, indem Sie #Einstellungen → Far Manager → Resize panels by mouse# deaktivieren. - See also the list of ~macro keys~@KeyMacroShellList@, available in the panels. diff --git a/far/FarHun.hlf.m4 b/far/FarHun.hlf.m4 index e331f4a058..822c2b74e8 100644 --- a/far/FarHun.hlf.m4 +++ b/far/FarHun.hlf.m4 @@ -373,14 +373,16 @@ $ #Panelvezérlő parancsok# Elrejti/megmutatja a bal panelt #Ctrl+F1# Elrejti/megmutatja a jobb panelt #Ctrl+F2# A panelek magasságán változtat #Ctrl+Fel,Ctrl+Le# + Az aktuális panel magasságán változtat #Ctrl+Shift+Fel,Ctrl+Shift+Le# A panelek magasságán változtat egérrel #Alsó határ húzása a paneleken# A panelek szélességén változtat billentyűzettel #Ctrl+Jobb,Ctrl+Bal# (ha a parancssor üres) A panelek szélességén változtat egérrel #Határ húzása a panelek között# Visszaállítja a panelszélességek alapértékét #Ctrl+Numpad5# - #Dupla egérkattintás a panelek határán# + vagy egérrel #Dupla kattintás# a panelek határán Visszaállítja a panelmagasságok alapértékét #Ctrl+Alt+Numpad5# + vagy egérrel #Dupla kattintás# a panel alsó határán Megmutatja/elrejti a funkcióbillentyűk sorát #Ctrl+B# a képernyő alján Toggle total and free size show mode #Ctrl+Shift+S# @@ -912,8 +914,8 @@ alapértelmezett gombot vagy más hasonló dolgot művel). #Mouse# Clicking the #middle mouse button# in the ~panels~@PanelCmd@ has the same - effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, - #Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. +effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, +#Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. A Far Manager kezeli az ~egér görgőjét~@MsWheel@. @@ -1196,6 +1198,18 @@ begépelésével a megfelelő fájlra állítja a kurzort. - ^Vigye az egérmutatót a bal és jobb panel közötti határvonalra, hogy lássa az átméretezési terület vizuális jelzését. - ^Kattintson és húzza a határvonalat balra vagy jobbra a panelek szélességének beállításához. - ^Kattintson duplán a határvonalra az alapértelmezett egyenlő panelszélesség visszaállításához (50/50 felosztás). + - ^Nyomja meg az #Esc# billentyűt az átméretezés során a megszakításhoz és az eredeti panelszélességek visszaállításához. + + #Magasság átméretezése:# + - ^Vigye az egérmutatót a panel alsó határvonalára, hogy lássa az átméretezési terület vizuális jelzését. + - ^Kattintson és húzza az alsó határvonalat fel vagy le a panel magasságának beállításához. + - ^Az átméretezés viselkedése az egér vízszintes pozíciójától függ: + - ^A BAL panel alsó határvonala felett a panel bal felében → Csak a BAL panel átméretezése + - ^A BAL panel alsó határvonala felett a panel jobb felében → MINDKÉT panel átméretezése + - ^A JOBB panel alsó határvonala felett a panel bal felében → MINDKÉT panel átméretezése + - ^A JOBB panel alsó határvonala felett a panel jobb felében → Csak a JOBB panel átméretezése + - ^Kattintson duplán az alsó határvonalra a teljes panelmagasság visszaállításához. + - ^Nyomja meg az #Esc# billentyűt az átméretezés során a megszakításhoz és az eredeti panelmagasságok visszaállításához. See also the list of ~macro keys~@KeyMacroShellList@, available in the panels. diff --git a/far/FarPol.hlf.m4 b/far/FarPol.hlf.m4 index 180a5b240c..84fc9f9c40 100644 --- a/far/FarPol.hlf.m4 +++ b/far/FarPol.hlf.m4 @@ -374,8 +374,9 @@ $ #Polecenia kontroli panelu# (tylko gdy wiersz poleceń jest pusty) Zmień szerokość paneli myszą #Przeciągnij granicę między panelami# Przywróć domyślną szerokość paneli #Ctrl+Numpad5# - #Podwójne kliknięcie myszy na granicy paneli# + lub myszą #Podwójne kliknięcie# na granicy między panelami Przywróć domyślną wysokość paneli #Ctrl+Alt+Numpad5# + lub myszą #Podwójne kliknięcie# na dolnej granicy panelu Pokaż/Ukryj pasek skrótów w dolnej linii #Ctrl+B# Przełącz tryb całkowitej i wolnej wielkości #Ctrl+Shift+S# w bajtach (jeżeli możliwe) lub w wielokrotnościach K/M/G/T @@ -1162,6 +1163,18 @@ plików po pierwszej literze jego nazwy. - ^Najedź kursorem myszy na granicę między lewym i prawym panelem, aby zobaczyć wizualną informację o możliwości zmiany rozmiaru. - ^Kliknij i przeciągnij granicę w lewo lub w prawo, aby dostosować szerokość paneli. - ^Kliknij dwukrotnie na granicy, aby przywrócić domyślną równą szerokość paneli (podział 50/50). + - ^Naciśnij #Esc# podczas zmiany rozmiaru, aby anulować i powrócić do oryginalnej szerokości paneli. + + #Zmiana wysokości:# + - ^Najedź kursorem myszy na dolną granicę panelu, aby zobaczyć wizualną informację zwrotną wskazującą obszar, który można zmieniać. + - ^Kliknij i przeciągnij dolną granicę w górę lub w dół, aby dostosować wysokość panelu. + - ^Zachowanie zmiany rozmiaru zależy od poziomej pozycji myszy: + - ^Nad dolną granicą LEWEGO panelu w lewej połowie panelu → Zmiana rozmiaru tylko LEWEGO panelu + - ^Nad dolną granicą LEWEGO panelu w prawej połowie panelu → Zmiana rozmiaru OBU paneli + - ^Nad dolną granicą PRAWEGO panelu w lewej połowie panelu → Zmiana rozmiaru OBU paneli + - ^Nad dolną granicą PRAWEGO panelu w prawej połowie panelu → Zmiana rozmiaru tylko PRAWEGO panelu + - ^Kliknij dwukrotnie na dolną granicę, aby przywrócić pełną wysokość panelu. + - ^Naciśnij #Esc# podczas zmiany rozmiaru, aby anulować i powrócić do oryginalnej wysokości paneli. Zobacz także listę ~klawiszy makropoleceń~@KeyMacroShellList@, dostępnych w panelach. @@ -6618,21 +6631,21 @@ w Edytorze. @Editor.SearchAllUseAltFileNameFormat $ #far:config Editor.SearchAllUseAltFileNameFormat# - This string parameter controls composing of the file name used by the -new Editor containing ~all matching entries~@FindAllMenu@. The value -is one or more ~file masks~@FileMasks@. + Ten parametr łańcuchowy kontroluje tworzenie nazwy pliku używanej przez +nowy Edytor zawierający ~wszystkie pasujące wpisy~@FindAllMenu@. +Wartością jest jedna lub więcej ~masek plików~@FileMasks@. - The new filename is created from the stem filename and the extension -of the file currently opened in the Editor. Depending on the original -file name, the new file name is formatted using one of the two -alternative UI format strings defined in ~.lng files~@CustomizingUI@. -The string with the ID #MEditSearchAllFileNameFormatAlt# is used if the -original file name matches one of the file masks; otherwise, -#MEditSearchAllFileNameFormat# is used. + Nowa nazwa pliku jest tworzona wg nazwy podstawowego pliku i rozszerzenia +pliku aktualnie otwartego w edytorze. W zależoności od oryginalnej nazwy +pliku, nowa nazwa jest formatowana przy użyciu jednego z dwóch alternatywnych +ciągów zdefiniowanych w ~plikach .lng~@CustomizingUI@. +Łańcuch o identyfikatorze #MEditSearchAllFileNameFormatAlt# jest używany, +jeżeli oryginalna nazwa pliku pasuje do jednej z masek plików; +w przeciwnym razie używany jest identyfikator #MEditSearchAllFileNameFormat#. - Default value: #*.txt,*.log,*.md,*.csv,*.ini,*.cmd,*.map# + Wartość domyślna: #*.txt,*.log,*.md,*.csv,*.ini,*.cmd,*.map# - This parameter can be changed via ~far:config~@FarConfig@ only. + Parametr też można zmienić tylko w ~far:config~@FarConfig@. @Panel.ShortcutAlwaysChdir @@ -6901,17 +6914,17 @@ tworzenia, usuwania lub zmiany nazw folderów. @Panel.TreatDotFilesAsHidden $ #far:config Panel.TreatDotFilesAsHidden# - This Boolean parameter controls the filtering of files or folders -starting with a dot (“dotfiles”). It works in combination with the -#Show hidden and system files# option in the -~panel settings~@PanelSettings@ dialog. + Ten parametr logiczny kontroluje filtrowanie plików lub folderów rozpoczynających się +od kropki (“dotfiles”). Działa w połączeniu z opcją #Pokazuj pliki ukryte i systemowe# +w oknie ~ustawień panelu~@PanelSettings@. - False - ^Dotfiles will always be shown. - True - Dotfiles will be hidden/shown together with the Hidden and System files. + Fałsz - ^Pliki zaczynające się kropkami zawsze będę widoczne. + Prawda - Pliki zaczynające się kropkami będą ukrywane/wyświetlane razem z plikami +ukrytymi i systemowymi. - Default value: False (Dotfiles will always be shown.) + Domyślna wartość: Fałsz (pliki zawsze będą wyświetlane.) - This parameter can be changed via ~far:config~@FarConfig@ only. + Ten parametr można zmienić tylko w ~far:config~@FarConfig@. @Index diff --git a/far/FarRus.hlf.m4 b/far/FarRus.hlf.m4 index 4ffe99ca6d..28718e085d 100644 --- a/far/FarRus.hlf.m4 +++ b/far/FarRus.hlf.m4 @@ -380,13 +380,14 @@ $ #Команды управления панелями# Убрать/показать правую панель #Ctrl+F2# Изменить высоту панелей #Ctrl+Up,Ctrl+Down# Изменить высоту текущей панели #Ctrl+Shift+Up,Ctrl+Shift+Down# - Изменить высоту панелей мышью #Перетаскивание нижней границы панелей# + Изменить высоту панелей мышью#Перетаскивание нижней границы панелей# Изменить ширину панелей клавиатурой #Ctrl+Left,Ctrl+Right# (при пустой командной строке) Изменить ширину панелей мышью#Перетаскивание границы между панелями# Восстановить ширину панелей по умолчанию #Ctrl+Numpad5# - #Двойной щелчок мыши по границе между панелями# + или мышью #Двойной щелчок# по границе между панелями Восстановить высоту панелей по умолчанию #Ctrl+Alt+Numpad5# + или мышью #Двойной щелчок# по нижней границе панели Спрятать/Показать линейку функциональных клавиш #Ctrl+B# Переключение режима показа общего размера файлов и #Ctrl+Shift+S# свободного места в байтах (если можно) или с суффиксами К/М/Г/Т @@ -1211,9 +1212,6 @@ $ #Панель файлов# - ^Дважды щёлкните на нижней границе, чтобы восстановить полную высоту панели. - ^Нажмите #Esc# во время изменения размера, чтобы отменить и вернуться к исходной высоте панелей. - #Примечание для пользователей ConEmu:# - ^Чтобы избежать дублирования индикаторов и методов изменения размера, рекомендуется отключить функцию изменения размера панелей Far Manager в ConEmu, сняв флажок #Настройки → Far Manager → Resize panels by mouse#. - См. также список ~макроклавиш~@KeyMacroShellList@, доступных в панелях. diff --git a/far/FarSky.hlf.m4 b/far/FarSky.hlf.m4 index f9236daaf6..539d0b36af 100644 --- a/far/FarSky.hlf.m4 +++ b/far/FarSky.hlf.m4 @@ -363,14 +363,15 @@ $ #Príkazy na ovládanie panelov# Schovaj/zobraz ľavý panel #Ctrl+F1# Schovaj/zobraz pravý panel #Ctrl+F2# Zmeň výšku panelov #Ctrl+Nahor,Ctrl+Nadol# - Change current panel height #Ctrl+Shift+Up,Ctrl+Shift+Down# + Zmeň výšku aktuálneho panelu #Ctrl+Shift+Nahor,Ctrl+Shift+Nadol# Zmeň výšku panelov myšou #Ťahanie dolnej hranice panelov# Zmeň šírku panelov klávesnicou #Ctrl+Doľ,Ctrl+Dopr# (ak je prík. riadok prázdny) Zmeň šírku panelov myšou #Ťahanie hranice medzi panelmi# Vráť štandartnú šírku panelov #Ctrl+NumKlav5# - #Dvojklik myšou na hranicu medzi panelmi# - Restore default panels height #Ctrl+Alt+Numpad5# + alebo myšou #Dvojklik# na hranicu medzi panelmi + Vráť štandartnú výšku panelov #Ctrl+Alt+NumKlav5# + alebo myšou #Dvojklik# na dolnú hranicu panelu Show/Hide functional key bar at the bottom line. #Ctrl+B# Toggle total and free size show mode #Ctrl+Shift+S# in bytes (if possible) or with size suffixes K/M/G/T @@ -884,8 +885,8 @@ default button or does another similar thing). #Mouse# Clicking the #middle mouse button# in the ~panels~@PanelCmd@ has the same - effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, - #Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. +effect as pressing the #Enter# key with the same modifiers (#Ctrl#, #Alt#, +#Shift#). If the ~command line~@CmdLineCmd@ is not empty, its contents will be executed. Far Manager also supports the ~mouse wheel~@MsWheel@. @@ -900,7 +901,7 @@ $ #Special commands# $ #Mouse: wheel support# #Panels# Rotating the wheel scrolls the file list without changing the cursor position on the screen. - Pressing the #middle button# has the same effect as pressing #Enter#. +Pressing the #middle button# has the same effect as pressing #Enter#. #Editor# Rotating the wheel scrolls the text without changing the cursor position on the screen @@ -914,7 +915,7 @@ $ #Mouse: wheel support# #Menus# Wheel scrolling works as #Up#/#Down# keys. Pressing the #middle button# has the same effect as - pressing #Enter#. It is possible to choose items without moving the cursor. +pressing #Enter#. It is possible to choose items without moving the cursor. #Dialogs# In dialogs, when the wheel is rotated at an edit line with a history list or a combo box, @@ -1168,6 +1169,18 @@ požadovaný súbor použitím prvých písmen jeho mena. - ^Navedite kurzor myši na hranicu medzi ľavým a pravým panelom, aby ste videli vizuálnu spätnú väzbu označujúcu oblasť, ktorú možno zmeniť. - ^Kliknite a ťahajte hranicu doľava alebo doprava na úpravu šírky panelov. - ^Dvakrát kliknite na hranicu na obnovenie predvolenej rovnakej šírky panelov (rozdelenie 50/50). + - ^Stlačte #Esc# počas zmeny veľkosti na zrušenie a návrat k pôvodnej šírke panelov. + + #Zmena výšky:# + - ^Navedite kurzor myši na spodnú hranicu panelu, aby ste videli vizuálnu spätnú väzbu označujúcu oblasť, ktorú možno zmeniť. + - ^Kliknite a ťahajte spodnú hranicu hore alebo dole na úpravu výšky panelu. + - ^Správanie zmeny veľkosti závisí od horizontálnej pozície myši: + - ^Nad spodnou hranicou ĽAVÉHO panelu v ľavej polovici panelu → Zmena veľkosti iba ĽAVÉHO panelu + - ^Nad spodnou hranicou ĽAVÉHO panelu v pravej polovici panelu → Zmena veľkosti OBOCH panelov + - ^Nad spodnou hranicou PRAVÉHO panelu v ľavej polovici panelu → Zmena veľkosti OBOCH panelov + - ^Nad spodnou hranicou PRAVÉHO panelu v pravej polovici panelu → Zmena veľkosti iba PRAVÉHO panelu + - ^Dvakrát kliknite na spodnú hranicu na obnovenie plnej výšky panelu. + - ^Stlačte #Esc# počas zmeny veľkosti na zrušenie a návrat k pôvodnej výške panelov. See also the list of ~macro keys~@KeyMacroShellList@, available in the panels. diff --git a/far/FarUkr.hlf.m4 b/far/FarUkr.hlf.m4 index a183587ae2..354596ec59 100644 --- a/far/FarUkr.hlf.m4 +++ b/far/FarUkr.hlf.m4 @@ -367,8 +367,9 @@ $ #Команди керування панелями# (при пустому командному рядку) Змінити ширину панелей мишею #Перетягування межі між панелями# Відновити ширину панелей за замовчуванням #Ctrl+Numpad5# - #Подвійний клік мишею по межі панелей# + або мишею #Подвійний клік# по межі між панелями Відновити висоту панелей за замовчуванням #Ctrl+Alt+Numpad5# + або мишею #Подвійний клік# по нижній межі панелі Сховати/Показати лінійку функціональних клавіш #Ctrl+B# Перемкнути показ загального та вільного розміру #Ctrl+Shift+S# у байтах (якщо можливо) або з суфіксами розміру K/M/G/T @@ -1204,9 +1205,6 @@ NTFS. Деякі файлові системи можуть не підтрим - ^Двічі клацніть на нижній межі, щоб відновити повну висоту панелі. - ^Натисніть #Esc# під час зміни розміру, щоб скасувати та повернутися до початкової висоти панелей. - #Примітка для користувачів ConEmu:# - ^Щоб уникнути дублювання індикаторів та методів зміни розміру, рекомендується відключити функцію зміни розміру панелей Far Manager у ConEmu, знявши прапорець #Налаштування → Far Manager → Resize panels by mouse#. - Дивіться також список ~макроклавіш~@KeyMacroShellList@, доступних у панелях. diff --git a/far/changelog b/far/changelog index d8e025697d..6d7fbacdbf 100644 --- a/far/changelog +++ b/far/changelog @@ -1,8 +1,51 @@ -------------------------------------------------------------------------------- -yulian5 2025-10-07 21:00:00-07:00 - build 6572 +yulian5 2025-10-26 21:00:00-06:00 - build 6579 1. New feature: panel resizing with mouse +-------------------------------------------------------------------------------- +shmuel 2025-10-25 17:09:40+03:00 - build 6578 + +1. Add more stack operations to Macro-API engine. + +-------------------------------------------------------------------------------- +ssvine 2025-10-25 10:12:06+03:00 - build 6577 + +1. gh-1034: Refresh plugin panel after uploading a changed file in ProcessEnter. + +-------------------------------------------------------------------------------- +shmuel 2025-10-24 20:22:16+03:00 - build 6576 + +1. Add a few stack operations to Macro-API engine. + +-------------------------------------------------------------------------------- +drkns 2025-10-20 23:56:08+01:00 - build 6575 + +1. Clarify DI_COMBOBOX and DIF_DROPDOWNLIST behavior in corner cases. + +2. Refactoring. + +3. Warnings. + +-------------------------------------------------------------------------------- +rohitab 2025-10-20 08:50:41+11:00 - build 6574 + +1. gh-1032: Crash if size of name column is less than size of mark character. + +-------------------------------------------------------------------------------- +drkns 2025-10-16 23:42:46+01:00 - build 6573 + +1. Continue gh-1031. + Save the history if the user touched the control or if the control is visible. + +-------------------------------------------------------------------------------- +drkns 2025-10-16 20:22:16+01:00 - build 6572 + +1. gh-1031: History saved for hidden edit controls. + Only save the history if the user touched the control. + +2. Minor fix in color processing. + -------------------------------------------------------------------------------- zg 2025-10-05 23:11:22+03:00 - build 6571 diff --git a/far/farlang.templ.m4 b/far/farlang.templ.m4 index 2f9977ce03..5c8811a5d9 100644 --- a/far/farlang.templ.m4 +++ b/far/farlang.templ.m4 @@ -18801,7 +18801,7 @@ MSetColorPanelDraggingBorder "Texto arrastrado" "Potiahnutý okraj" "Spostamento Bordo" -"Межа перетягув." +"Межа перетягуванні" "Мяжа пераносу" "Tempiama riba" upd:"Dragging border" diff --git a/far/filelist.cpp b/far/filelist.cpp index abd8f1b5f5..24e59d789a 100644 --- a/far/filelist.cpp +++ b/far/filelist.cpp @@ -121,6 +121,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. static_assert(static_cast(panel_sort::BY_USER) == static_cast(OPENPANELINFO_SORTMODES::SM_USER)); + constexpr auto operator+(panel_sort const Value) noexcept { return std::to_underlying(Value); @@ -134,7 +135,6 @@ static const struct sort_mode std::initializer_list> DefaultLayers; } - SortModes[] { { lng::MMenuUnsorted, 5, KEY_CTRLF7, { { panel_sort::UNSORTED, sort_order::ascend, }, }, }, @@ -197,6 +197,7 @@ static auto compare_fat_write_time(os::chrono::time_point First, os::chrono::tim return First <=> Second; } + enum SELECT_MODES { SELECT_INVERT, @@ -552,6 +553,7 @@ FileList::~FileList() dispose(); } + FileList::list_data& FileList::list_data::operator=(FileList::list_data&& rhs) noexcept { clear(); @@ -594,6 +596,7 @@ void FileList::ToBegin() ShowFileList(); } + void FileList::ToEnd() { m_CurFile = is_data_empty()? 0 : static_cast(data_size() - 1); @@ -719,6 +722,7 @@ class list_less return false; } + private: std::strong_ordering compare(panel_sort const SortMode, bool const Reverse, FileListItem const& Item1, FileListItem const& Item2) const { @@ -801,6 +805,7 @@ class list_less bool m_IgnorePaths; }; + void FileList::SortFileList(bool KeepPosition) { if (is_data_empty() || m_InsideGetFindData) @@ -1773,6 +1778,7 @@ bool FileList::ProcessKey(const Manager::Key& Key) ProcessHostFile(); return true; } + case KEY_F3: case KEY_NUMPAD5: case KEY_SHIFTNUMPAD5: case KEY_ALTF3: @@ -2625,6 +2631,7 @@ bool FileList::ProcessKey(const Manager::Key& Key) return false; } + void FileList::Select(FileListItem& SelItem, bool Selection) { if (IsParentDirectory(SelItem) || SelItem.Selected == Selection) @@ -2835,13 +2842,26 @@ void FileList::ProcessEnter(bool EnableExec,bool SeparateWindow,bool EnableAssoc { int PutCode = Global->CtrlObject->Plugins->PutFiles(GetPluginHandle(), { &PanelItem.Item, 1 }, false, OPM_EDIT); if (PutCode == 1 || PutCode == 2) + { SetPluginModified(); + + Update(UPDATE_KEEP_SELECTION); + Redraw(); + const auto AnotherPanel = Parent()->GetAnotherPanel(this); + + if (AnotherPanel->GetMode() == panel_mode::NORMAL_PANEL) + { + AnotherPanel->Update(UPDATE_KEEP_SELECTION); + AnotherPanel->Redraw(); + } + } } } } } } + bool FileList::SetCurDir(string_view const NewDir, bool ClosePanel, bool IsUpdated, bool const Silent) { const auto DataLock = lock_data(); @@ -3388,6 +3408,7 @@ bool FileList::ProcessMouse(const MOUSE_EVENT_RECORD *MouseEvent) return false; } + /* $ 12.09.2000 SVS + Опциональное поведение для правой клавиши мыши на пустой панели */ @@ -3653,6 +3674,7 @@ long FileList::FindNext(int StartPos, string_view const Name) return -1; } + bool FileList::IsSelected(string_view const Name) { const auto DataLock = lock_data(); @@ -4012,6 +4034,7 @@ bool FileList::GetSelName(string* strName, string* strShortName, os::fs::find_da return false; } + void FileList::ClearLastGetSelection() { if (LastSelPosition < 0 || LastSelPosition >= static_cast(data_size())) @@ -4359,6 +4382,7 @@ void FileList::UpdateViewPanel() RefreshTitle(); } + void FileList::CompareDir() { const auto Another = std::dynamic_pointer_cast(Parent()->GetAnotherPanel(this)); @@ -4619,6 +4643,7 @@ void FileList::ClearSelection() SortFileList(true); } + void FileList::SaveSelection() { const auto DataLock = lock_data(); @@ -4630,6 +4655,7 @@ void FileList::SaveSelection() } } + void FileList::RestoreSelection() { const auto DataLock = lock_data(); @@ -4646,6 +4672,8 @@ void FileList::RestoreSelection() Redraw(); } + + bool FileList::GetFileName(string& strName, int Pos, os::fs::attributes& FileAttr) const { if (Pos >= static_cast(data_size())) @@ -5049,6 +5077,7 @@ void FileList::SelectSortMode() } } + void FileList::DeleteDiz(const string_view Name, const string_view ShortName) { if (m_PanelMode == panel_mode::NORMAL_PANEL) @@ -5062,6 +5091,7 @@ void FileList::FlushDiz() Diz.Flush(m_CurDir); } + string FileList::GetDizName() const { return m_PanelMode == panel_mode::NORMAL_PANEL? Diz.GetDizName() : string(); @@ -5148,11 +5178,13 @@ void FileList::DescribeFiles() }*/ } + void FileList::SetReturnCurrentFile(bool Mode) { ReturnCurrentFile=Mode; } + bool FileList::ApplyCommand() { static string strPrevCommand; @@ -5221,6 +5253,7 @@ bool FileList::ApplyCommand() return true; } + void FileList::CountDirSize(bool IsRealNames) { unsigned long SelDirCount=0; @@ -5348,11 +5381,13 @@ void FileList::CountDirSize(bool IsRealNames) InitFSWatcher(true); } + int FileList::GetPrevViewMode() const { return (m_PanelMode == panel_mode::PLUGIN_PANEL && !PluginsList.empty())?PluginsList.front()->m_PrevViewMode:m_ViewMode; } + panel_sort FileList::GetPrevSortMode() const { return (m_PanelMode == panel_mode::PLUGIN_PANEL && !PluginsList.empty())?PluginsList.front()->m_PrevSortMode:m_SortMode; @@ -5428,6 +5463,7 @@ void FileList::SetAndUpdateFilePlugin(const string& FileName, std::unique_ptrRedraw(); } + void FileList::ProcessCopyKeys(unsigned const Key) { if (is_data_empty() || !SetCurPath()) @@ -5582,6 +5618,7 @@ string FileList::GetPluginPrefix() const return {}; } + void FileList::GoHome(string_view const Drive) { const auto FarRoot = extract_root_directory(Global->g_strFarModuleName); @@ -6035,6 +6072,7 @@ FileListItem::FileListItem(const PluginPanelItem& pi) m_StreamsSize = FileSize; } + std::unique_ptr FileList::OpenPluginForFile(const string& FileName, os::fs::attributes const FileAttr, OPENFILEPLUGINTYPE const Type, bool* const StopProcessing) { if (FileName.empty() || FileAttr & FILE_ATTRIBUTE_DIRECTORY) @@ -6105,6 +6143,7 @@ void FileList::PluginDelete() AnotherPanel->Redraw(); } + void FileList::PutDizToPlugin(FileList *DestPanel, std::span const ItemList, bool Delete, bool Move, DizList *SrcDiz) const { Global->CtrlObject->Plugins->GetOpenPanelInfo(DestPanel->GetPluginHandle(), &m_CachedOpenPanelInfo); @@ -6181,6 +6220,7 @@ void FileList::PutDizToPlugin(FileList *DestPanel, std::span co DeleteFileWithFolder(strDizName); } + void FileList::PluginGetFiles(const string& DestPath, bool Move) { SaveSelection(); @@ -6243,6 +6283,7 @@ void FileList::PluginGetFiles(const string& DestPath, bool Move) AnotherPanel->Redraw(); } + void FileList::PluginToPluginFiles(bool Move) { const auto AnotherFilePanel = std::dynamic_pointer_cast(Parent()->GetAnotherPanel(this)); @@ -6373,6 +6414,7 @@ void FileList::PluginHostGetFiles() AnotherPanel->Redraw(); } + void FileList::PluginPutFilesToNew() { const auto DataLock = lock_data(); @@ -6422,6 +6464,7 @@ void FileList::PluginPutFilesToNew() } } + /* $ 12.04.2002 IS PluginPutFilesToAnother теперь int - возвращает то, что возвращает PutFiles: @@ -6475,6 +6518,7 @@ int FileList::PluginPutFilesToAnother(bool Move, panel_ptr AnotherPanel) return PutCode; } + void FileList::GetOpenPanelInfo(OpenPanelInfo *Info) const { *Info = {}; @@ -6483,6 +6527,7 @@ void FileList::GetOpenPanelInfo(OpenPanelInfo *Info) const Global->CtrlObject->Plugins->GetOpenPanelInfo(GetPluginHandle(), Info); } + /* Функция для вызова команды "Архивные команды" (Shift-F3) */ @@ -7623,6 +7668,7 @@ void FileList::UpdatePlugin(bool const KeepSelection, bool const UpdateEvenIfPan RefreshTitle(); } + void FileList::ReadDiz(std::span const Items) { if (DizRead) @@ -7709,6 +7755,7 @@ void FileList::ReadDiz(std::span const Items) } } + void FileList::ReadSortGroups(bool UpdateFilterCurrentTime) { if (SortGroupsRead) @@ -8072,6 +8119,7 @@ void FileList::ShowFileList(bool Fast) Parent()->ShowChildren(); } + FarColor FileList::GetShowColor(int Position, bool FileColor) const { if (static_cast(Position) >= data_size()) @@ -8406,6 +8454,7 @@ void FileList::PrepareViewSettings(int ViewMode) UpdateHeight(); } + void FileList::PreparePanelView() { PrepareColumnWidths(m_ViewSettings.StatusColumns, (m_ViewSettings.Flags&PVS_FULLSCREEN) != 0); @@ -8413,6 +8462,7 @@ void FileList::PreparePanelView() PrepareStripes(m_ViewSettings.PanelColumns); } + void FileList::PrepareColumnWidths(std::vector& Columns, bool FullScreen) const { int ZeroLengthCount = 0; @@ -8574,6 +8624,7 @@ void FileList::PrepareStripes(const std::vector& Columns) m_ColumnsInStripe = ColumnsSize; } + void FileList::HighlightBorder(int Level, int ListPos) const { if (Level == m_ColumnsInStripe) diff --git a/far/filepanels.cpp b/far/filepanels.cpp index be4d1d77fe..cae9bd9297 100644 --- a/far/filepanels.cpp +++ b/far/filepanels.cpp @@ -1616,33 +1616,6 @@ bool FilePanels::IsMouseOverPanelBottomBorder(const MOUSE_EVENT_RECORD *MouseEve return false; } -FarColor FilePanels::GetBorderFeedbackColor() -{ - // Get the dragging border color first - this respects user's custom color choices - auto Result = colors::PaletteColorToFarColor(COL_PANELDRAGBORDER); - const auto& DragTextColor = colors::PaletteColorToFarColor(COL_PANELDRAGTEXT); - const auto& SelectedTextColor = colors::PaletteColorToFarColor(COL_PANELSELECTEDTEXT); - const auto& PanelTextColor = colors::PaletteColorToFarColor(COL_PANELTEXT); - - // Check if the dragging border color is using the default palette value - // Default palette value for COL_PANELDRAGBORDER is F_YELLOW|B_BLUE - const auto DefaultDragBorderColor = F_YELLOW | B_BLUE; - - // If the current color matches the default palette value, or if it seems uninitialized, - // apply the fallback logic (theme doesn't define this color or user hasn't customized it) - if (const auto CurrentDragBorderRaw = (Result.ForegroundColor & 0x0F) | ((Result.BackgroundColor & 0x0F) << 4); - CurrentDragBorderRaw == DefaultDragBorderColor || - Result.ForegroundColor == Result.BackgroundColor || - Result.ForegroundColor == 0) - { - // Apply fallback logic: foreground from dragging text (or selected text), background from panel - Result.ForegroundColor = DragTextColor.ForegroundColor != 0 ? DragTextColor.ForegroundColor : SelectedTextColor.ForegroundColor; - Result.BackgroundColor = PanelTextColor.BackgroundColor; - } - - return Result; -} - void FilePanels::DrawWidthBorderFeedback(bool IsHovering, bool IsDragging) { // Show visual feedback on hover and during dragging @@ -1659,7 +1632,7 @@ void FilePanels::DrawWidthBorderFeedback(bool IsHovering, bool IsDragging) const auto BorderX = ScrX / 2 - opt->WidthDecrement; const auto borderX = static_cast(BorderX); - const auto BorderColor = GetBorderFeedbackColor(); + const auto BorderColor = colors::PaletteColorToFarColor(COL_PANELDRAGBORDER); static constexpr wchar_t BorderChar[] = L"║"; @@ -1822,7 +1795,7 @@ void FilePanels::DrawHeightBorderFeedback(bool IsHovering, bool IsDragging) const auto leftPanelPos = leftPanel->GetPosition(); const auto rightPanelPos = rightPanel->GetPosition(); - const auto BorderColor = GetBorderFeedbackColor(); + const auto BorderColor = colors::PaletteColorToFarColor(COL_PANELDRAGBORDER); static constexpr wchar_t BorderChar[] = L"═"; const auto [highlightLeft, highlightRight] = DetermineHeightHighlightPanels(IsDragging, leftPanelPos, rightPanelPos); diff --git a/far/filepanels.hpp b/far/filepanels.hpp index 3890407da0..a190e999bc 100644 --- a/far/filepanels.hpp +++ b/far/filepanels.hpp @@ -130,8 +130,6 @@ class FilePanels final: public window, public ViewerContainer std::pair DetermineHeightHighlightPanels(bool IsDragging, const rectangle& leftPanelPos, const rectangle& rightPanelPos); void DrawPanelBottomBorder(const std::shared_ptr& panel, const rectangle& panelPos, const FarColor& BorderColor, const wchar_t* BorderChar); - // Common helper for border color calculation - static FarColor GetBorderFeedbackColor(); panel_ptr CreatePanel(panel_type Type); void SetPanelPositions(bool LeftFullScreen, bool RightFullScreen) const; diff --git a/far/keyboard.cpp b/far/keyboard.cpp index 84e8a898c5..f3ef49684a 100644 --- a/far/keyboard.cpp +++ b/far/keyboard.cpp @@ -1302,6 +1302,8 @@ bool CheckForEscSilent() return true; } + SCOPED_ACTION(auto)(message_manager::instance().suppressor()); + INPUT_RECORD rec; bool Processed = true; /* TODO: Здесь, в общем то - ХЗ, т.к. diff --git a/far/vbuild.m4 b/far/vbuild.m4 index 547a01a89a..f1f8de3e8b 100644 --- a/far/vbuild.m4 +++ b/far/vbuild.m4 @@ -1 +1 @@ -6572 +6579