Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DotNetCMD/Application/AppForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private void CreateEditMenu(ToolStripMenuItem parent)
parent.DropDownItems.Clear();
parent.DropDownItems.Add(CreateMenuItem("copy", Button_Copy));
parent.DropDownItems.Add(CreateMenuItem("cut", Edit_Cut));
parent.DropDownItems.Add(CreateMenuItem("past", Edit_Paste));
parent.DropDownItems.Add(CreateMenuItem("paste", Edit_Paste));
parent.DropDownItems.Add(new ToolStripSeparator());
parent.DropDownItems.Add(CreateMenuItem("rename", Edit_Rename));
}
Expand Down Expand Up @@ -536,7 +536,7 @@ private void FileBrowser_AdjacentPanelRequested(object sender, EventArgs e)
}

/*
* Comand Buttons (e.g.: Copy, Past)
* Comand Buttons (e.g.: Copy, Paste)
*/
private void Button_View(object sender, EventArgs e)
{
Expand Down
8 changes: 6 additions & 2 deletions DotNetCMD/Browsers/Archives/ArchiveBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace DotNetCommander
internal sealed class ArchiveBrowser : BrowserPanelBase
{
private readonly TextBox locationBox;
private readonly ListView archiveView;
private readonly BufferedListView archiveView;
private readonly Label loadingLabel;
private readonly List<ArchiveCatalogEntry> catalog = new List<ArchiveCatalogEntry>();
private readonly List<BrowserItemInfo> visibleItems = new List<BrowserItemInfo>();
Expand Down Expand Up @@ -45,7 +45,7 @@ public ArchiveBrowser()
};
locationPanel.Controls.Add(locationBox);

archiveView = new ListView
archiveView = new BufferedListView
{
AllowColumnReorder = true,
Dock = DockStyle.Fill,
Expand Down Expand Up @@ -246,6 +246,8 @@ public void ApplyUserSettings(Font browserFont, FileBrowser.BrowserColumnWidths
archiveView.View = view;
UpdateItemTextForView();
QueueIconLoading();
BrowserRowColoring.Apply(archiveView, Properties.Settings.Default.BrowserRowColorMode);

}

private async Task RefreshAsync()
Expand Down Expand Up @@ -337,6 +339,8 @@ private void ApplySorting()
{
archiveView.ListViewItemSorter = new ArchiveListViewItemComparer(sortColumn, sortAscending);
archiveView.Sort();
BrowserRowColoring.Apply(archiveView, Properties.Settings.Default.BrowserRowColorMode);

}

private void RenderCurrentPath(string preferredEntry = null)
Expand Down
7 changes: 5 additions & 2 deletions DotNetCMD/Browsers/Compound/CompoundBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal sealed class CompoundBrowser : BrowserPanelBase
{
private readonly CompoundFileCatalogService catalogService = new CompoundFileCatalogService();
private readonly AddressBar addressBar;
private readonly ListView compoundView;
private readonly BufferedListView compoundView;
private readonly Label loadingLabel;
private readonly List<CompoundCatalogEntry> catalog = new List<CompoundCatalogEntry>();
private readonly List<BrowserItemInfo> visibleItems = new List<BrowserItemInfo>();
Expand All @@ -30,7 +30,7 @@ public CompoundBrowser()
addressBar.RefreshClick += (_, __) => RefreshPanel();
addressBar.ButtonClick += AddressBar_ButtonClick;

compoundView = new ListView
compoundView = new BufferedListView
{
AllowColumnReorder = true,
Dock = DockStyle.Fill,
Expand Down Expand Up @@ -100,6 +100,7 @@ public void ApplyUserSettings(Font browserFont, FileBrowser.BrowserColumnWidths
compoundView.Columns[3].Width = Math.Max(60, widths.SizeWidth);
compoundView.Columns[4].Width = Math.Max(80, widths.DateWidth);
compoundView.View = view == System.Windows.Forms.View.Details ? view : System.Windows.Forms.View.Details;
BrowserRowColoring.Apply(compoundView, Properties.Settings.Default.BrowserRowColorMode);
}

public async Task<bool> OpenCompoundAsync(string path, bool reportFailure = true)
Expand Down Expand Up @@ -320,6 +321,8 @@ private void RenderCurrentPath(string preferredEntry = null)
{
compoundView.EndUpdate();
}
BrowserRowColoring.Apply(compoundView, Properties.Settings.Default.BrowserRowColorMode);


addressBar.Path = DisplayLocation;
RaiseLocationChanged(DisplayLocation);
Expand Down
2 changes: 2 additions & 0 deletions DotNetCMD/Browsers/DataSets/DataSetBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ public void ApplyUserSettings(Font browserFont)
grid.ColumnHeadersDefaultCellStyle.Font = browserFont;
grid.ColumnHeadersHeight = Math.Max(24, browserFont.Height + 8);
grid.RowTemplate.Height = Math.Max(22, browserFont.Height + 8);
BrowserRowColoring.Apply(grid, Properties.Settings.Default.BrowserRowColorMode);
}

private void ActivateSelectedItem()
Expand Down Expand Up @@ -319,6 +320,7 @@ private void RenderCurrentLocation()
else if (internalPath.StartsWith("relation/", StringComparison.OrdinalIgnoreCase))
RenderRelationDetails();

BrowserRowColoring.Apply(grid, Properties.Settings.Default.BrowserRowColorMode);
addressBar.Path = DisplayLocation;
grid.ResumeLayout();
RaiseLocationChanged(DisplayLocation);
Expand Down
4 changes: 2 additions & 2 deletions DotNetCMD/Browsers/FileSystem/FileBrowser.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions DotNetCMD/Browsers/FileSystem/FileBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ public FileBrowser() {
browserView.ShowGroups = false;

// Mindestens 1 Item muss im ContextMenü vorhanden sein
ToolStripMenuItem toolItem = new ToolStripMenuItem(Language.getString("past"));
toolItem.Tag = "past";
ToolStripMenuItem toolItem = new ToolStripMenuItem(Language.getString("paste"));
toolItem.Tag = "paste";
contextMenu.Items.Add(toolItem);


Expand Down Expand Up @@ -579,6 +579,8 @@ public void ApplyUserSettings()
browserView.ShowGroups = browserView.View == System.Windows.Forms.View.Details &&
Properties.Settings.Default.FileBrowserDirectoriesFirst;
ApplySorting();
BrowserRowColoring.Apply(browserView, Properties.Settings.Default.BrowserRowColorMode);

}

/**
Expand Down Expand Up @@ -687,6 +689,8 @@ public String browseTo(String path) {
{
browserView.Items.AddRange(pendingItems.ToArray());
}
BrowserRowColoring.Apply(browserView, Properties.Settings.Default.BrowserRowColorMode);

}
finally
{
Expand Down Expand Up @@ -921,7 +925,7 @@ private void contextMenu_ItemClicked(object sender, ToolStripItemClickedEventArg
}
Clipboard.SetFileDropList(paths);
}
else if (tag == "past") {
else if (tag == "paste") {
StringCollection paths = Clipboard.GetFileDropList();
CopyWindow = new FormCopy(paths, CurrentPath);
CopyWindow.ActionComplete += new FormCopy.ActionCompleteHandler(this.CopyComplete);
Expand Down Expand Up @@ -956,8 +960,8 @@ private void contextMenu_Opening(object sender, CancelEventArgs e) {
contextMenu.Items.Add(toolItem);
}

toolItem = new ToolStripMenuItem(Language.getString("past"));
toolItem.Tag = "past";
toolItem = new ToolStripMenuItem(Language.getString("paste"));
toolItem.Tag = "paste";
contextMenu.Items.Add(toolItem);

if (browserView.SelectedItems.Count > 0) {
Expand Down
9 changes: 7 additions & 2 deletions DotNetCMD/Browsers/Gedcom/GedcomBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal sealed class GedcomBrowser : BrowserPanelBase
private const string TagPathPrefix = "tag/";

private readonly AddressBar addressBar;
private readonly ListView browserView;
private readonly BufferedListView browserView;
private readonly Label loadingLabel;
private readonly ImageList sexIconsSmall;
private readonly ImageList sexIconsLarge;
Expand Down Expand Up @@ -51,7 +51,7 @@ public GedcomBrowser()
sexIconsSmall = CreateSexImageList(16);
sexIconsLarge = CreateSexImageList(32);

browserView = new ListView
browserView = new BufferedListView
{
AllowColumnReorder = true,
Dock = DockStyle.Fill,
Expand Down Expand Up @@ -269,8 +269,11 @@ public void ApplyUserSettings(Font browserFont, FileBrowser.BrowserColumnWidths
browserView.View = view;
if (catalog != null)
RenderCurrentLocation();
BrowserRowColoring.Apply(browserView, Properties.Settings.Default.BrowserRowColorMode);
}



private void ActivateSelectedItem()
{
ViewEntry entry = GetCurrentEntry();
Expand Down Expand Up @@ -336,6 +339,8 @@ private void RenderCurrentLocation()
{
browserView.EndUpdate();
}
BrowserRowColoring.Apply(browserView, Properties.Settings.Default.BrowserRowColorMode);


addressBar.Path = DisplayLocation;
RaiseLocationChanged(DisplayLocation);
Expand Down
8 changes: 6 additions & 2 deletions DotNetCMD/Browsers/Search/SearchBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal sealed class SearchBrowser : BrowserPanelBase
{
private readonly SearchService searchService = new SearchService();
private readonly AddressBar addressBar;
private readonly ListView resultView;
private readonly BufferedListView resultView;
private readonly Label statusLabel;
private readonly Button cancelButton;
private readonly List<BrowserItemInfo> visibleItems = new List<BrowserItemInfo>();
Expand All @@ -35,7 +35,7 @@ public SearchBrowser()
addressBar.ParentClick += (_, __) => LeaveRequested?.Invoke(this, EventArgs.Empty);
addressBar.RefreshClick += (_, __) => RefreshPanel();

resultView = new ListView
resultView = new BufferedListView
{
AllowColumnReorder = true,
Dock = DockStyle.Fill,
Expand Down Expand Up @@ -128,6 +128,8 @@ public void ApplyUserSettings(Font browserFont, FileBrowser.BrowserColumnWidths
resultView.Columns[4].Width = Math.Max(70, widths.SizeWidth);
resultView.Columns[5].Width = Math.Max(90, widths.DateWidth);
resultView.View = view == System.Windows.Forms.View.Details ? view : System.Windows.Forms.View.Details;
BrowserRowColoring.Apply(resultView, Properties.Settings.Default.BrowserRowColorMode);

}

public async Task StartSearchAsync(SearchQuery query)
Expand Down Expand Up @@ -284,6 +286,8 @@ private void PopulateResults(IReadOnlyList<BrowserItemInfo> results)
finally
{
resultView.EndUpdate();
BrowserRowColoring.Apply(resultView, Properties.Settings.Default.BrowserRowColorMode);

}
}

Expand Down
1 change: 1 addition & 0 deletions DotNetCMD/CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- **[ux]** Детермінований progress bar показує пакет і кількість оброблених файлів, минулий час, адаптивну оцінку залишку та очікуваний час завершення; локально відхилені й пропущені моделлю рядки залишаються у preview з конкретними причинами.
- **[feat]** Додано summary-only режим без файлових операцій; великі папки описуються по пакетах із фінальним об’єднанням часткових підсумків, а Auto читає вміст лише коли він потрібний запиту.
- **[ux]** `Options -> AI organizer -> Models...` відкриває фільтровану таблицю моделей із `/api/tags`: parameters, quantization, context, disk size, family, digest і capabilities; у формі організатора показується коротка картка вибраної моделі, embedding-only моделі не пропонуються для планування.
- **[ux]** `Options -> View` тепер дозволяє вимкнути кольори рядків, увімкнути чергування або розфарбувати рядки за типом файла; вибір зберігається для користувача й застосовується до всіх browser-панелей.

## [1.9.0] - 2026-09-11

Expand Down
144 changes: 144 additions & 0 deletions DotNetCMD/Controls/BrowserRowColoring.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;

namespace DotNetCommander
{
internal static class BrowserRowColoring
{
internal const string None = "None";
internal const string Striped = "Striped";
internal const string ByExtension = "ByExtension";


internal static string NormalizeMode(string mode)
{
if (string.Equals(mode, Striped, StringComparison.OrdinalIgnoreCase))
return Striped;
if (string.Equals(mode, ByExtension, StringComparison.OrdinalIgnoreCase))
return ByExtension;
return None;
}

internal static void Apply(ListView listView, string mode)
{
if (listView == null)
return;

string normalizedMode = NormalizeMode(mode);
Color baseColor = listView.BackColor.IsEmpty ? SystemColors.Window : listView.BackColor;
Color foregroundColor = listView.ForeColor.IsEmpty ? SystemColors.WindowText : listView.ForeColor;

for (int index = 0; index < listView.Items.Count; index++)
{
ListViewItem item = listView.Items[index];
Color rowColor = GetRowColor(normalizedMode, index, GetItemName(item), baseColor);
item.UseItemStyleForSubItems = normalizedMode != None;
item.BackColor = rowColor;
item.ForeColor = normalizedMode == None ? Color.Empty : foregroundColor;
}
}

internal static void Apply(DataGridView grid, string mode)
{
if (grid == null)
return;

string normalizedMode = NormalizeMode(mode);
Color baseColor = grid.BackgroundColor.IsEmpty ? SystemColors.Window : grid.BackgroundColor;
Color foregroundColor = grid.ForeColor.IsEmpty ? SystemColors.WindowText : grid.ForeColor;

for (int index = 0; index < grid.Rows.Count; index++)
{
DataGridViewRow row = grid.Rows[index];
if (row.IsNewRow)
continue;

string rowName = row.Cells.Count == 0 ? string.Empty : row.Cells[0].Value?.ToString();
Color rowColor = GetRowColor(normalizedMode, index, rowName, baseColor);
row.DefaultCellStyle.BackColor = rowColor;
row.DefaultCellStyle.ForeColor = normalizedMode == None ? Color.Empty : foregroundColor;
}
}

internal static Color GetRowColor(string mode, int rowIndex, string name, Color baseColor)
{
switch (NormalizeMode(mode))
{
case Striped:
return rowIndex % 2 == 0 ? baseColor : GetTint(baseColor, Color.FromArgb(125, 155, 190));
case ByExtension:
return GetExtensionColor(name, baseColor);
default:
return Color.Empty;
}
}

private static Color GetExtensionColor(string name, Color baseColor)
{
string extension = Path.GetExtension(name ?? string.Empty);
if (string.IsNullOrEmpty(extension))
return baseColor;

switch (extension.ToLowerInvariant())
{
case ".png":
case ".jpg":
case ".jpeg":
case ".gif":
case ".bmp":
case ".svg":
return GetTint(baseColor, Color.FromArgb(80, 140, 205));
case ".zip":
case ".tar":
case ".gz":
case ".tgz":
case ".7z":
case ".rar":
return GetTint(baseColor, Color.FromArgb(215, 145, 60));
case ".cs":
case ".cpp":
case ".c":
case ".h":
case ".java":
case ".js":
case ".ts":
case ".py":
case ".json":
case ".xml":
return GetTint(baseColor, Color.FromArgb(75, 160, 105));
case ".txt":
case ".md":
case ".rtf":
case ".doc":
case ".docx":
case ".pdf":
return GetTint(baseColor, Color.FromArgb(145, 105, 185));
default:
return baseColor;
}
}

private static string GetItemName(ListViewItem item)
{
return item?.SubItems.Count > 1
? item.SubItems[1].Text
: item?.Text;
}

private static Color GetTint(Color baseColor, Color accent)
{
const double tintStrength = 0.16;
return Color.FromArgb(
Blend(baseColor.R, accent.R, tintStrength),
Blend(baseColor.G, accent.G, tintStrength),
Blend(baseColor.B, accent.B, tintStrength));
}

private static int Blend(int source, int target, double amount)
{
return (int)Math.Round(source + (target - source) * amount);
}
}
}
Loading
Loading