ADD: Option "Show icons"

This commit is contained in:
Alexander Koblov 2007-09-25 19:31:44 +00:00
commit 2f605d63fb
15 changed files with 97 additions and 46 deletions

View file

@ -2,7 +2,7 @@ Compiling Double Commander
What you need?
At first must download FreePascal. I use FPC 2.1.4 (or higher).
At first must download FreePascal. I use FPC 2.2.1 (or higher).
After this download Lazarus. I use Lazarus 0.9.23 (or higher).

View file

@ -9,4 +9,5 @@
Можно указать для одного цвета несколько масок, разделяя их точкой с запятой,
например, *.zip;*.rar;*.arj.
09.09.2007 Добавил опции "Вид окна"
16.09.2007 Все опции на вкладке "Layout" теперь работают
16.09.2007 Все опции на вкладке "Layout" теперь работают
25.09.2007 ADD: Возможность отключения показа иконок

View file

@ -1,2 +1,3 @@
$$$*** This is unit history file ***$$$ ###encoding="UTF-8"###
09.06.2007 Добавил возможность более детальной настройки цветов в файловой панели
09.06.2007 Добавил возможность более детальной настройки цветов в файловой панели
25.09.2007 ADD: Возможность отключения показа иконок

View file

@ -1,3 +1,4 @@
$$$*** This is unit history file ***$$$ ###encoding="UTF-8"###
24.08.2007 ADD: Поддержка вложенных архивов
30.08.2007 ADD: Вывод списка VFS
30.08.2007 ADD: Вывод списка VFS
25.09.2007 ADD: Возможность отключения показа иконок

View file

@ -4,11 +4,11 @@ inherited frmMain: TfrmMain
Top = 81
Width = 540
HorzScrollBar.Page = 539
VertScrollBar.Page = 316
VertScrollBar.Page = 315
VertScrollBar.Range = 79
ActiveControl = pnlNotebooks
Caption = 'Double Commander'
ClientHeight = 317
ClientHeight = 316
ClientWidth = 540
Font.Color = clBlack
Font.Height = 13
@ -79,35 +79,35 @@ inherited frmMain: TfrmMain
end
end
object pnlNotebooks: TPanel
Height = 241
Height = 240
Top = 49
Width = 540
Align = alClient
ClientHeight = 241
ClientHeight = 240
ClientWidth = 540
FullRepaint = False
TabOrder = 1
TabStop = True
object MainSplitter: TSplitter
Left = 171
Height = 201
Height = 200
Top = 1
Width = 4
ResizeStyle = rsLine
end
object pnlLeft: TPanel
Left = 1
Height = 201
Height = 200
Top = 1
Width = 170
Align = alLeft
BevelOuter = bvNone
Caption = 'pnlLeft'
ClientHeight = 201
ClientHeight = 200
ClientWidth = 170
TabOrder = 0
object nbLeft: TNotebook
Height = 177
Height = 176
Hint = 'Left'
Top = 24
Width = 170
@ -175,17 +175,17 @@ inherited frmMain: TfrmMain
end
object pnlRight: TPanel
Left = 175
Height = 201
Height = 200
Top = 1
Width = 364
Align = alClient
BevelOuter = bvNone
Caption = 'pnlRight'
ClientHeight = 201
ClientHeight = 200
ClientWidth = 364
TabOrder = 1
object nbRight: TNotebook
Height = 177
Height = 176
Hint = 'Right'
Top = 24
Width = 364
@ -254,7 +254,7 @@ inherited frmMain: TfrmMain
object pnlCommand: TPanel
Left = 1
Height = 38
Top = 202
Top = 201
Width = 538
Align = alBottom
Anchors = [akLeft, akRight]
@ -302,7 +302,7 @@ inherited frmMain: TfrmMain
end
object pnlKeys: TPanel
Height = 27
Top = 290
Top = 289
Width = 540
Align = alBottom
Anchors = [akLeft, akRight]

View file

@ -1258,7 +1258,7 @@ begin
Exit;
end;
// handle ctrl+left
if (Key=VK_Right) then
if (Key=VK_Left) then
begin
if (PanelSelected = fpRight) then
SetNotActFrmByActFrm;
@ -2736,6 +2736,8 @@ begin
begin
pnlHeader.Visible := gCurDir; // Current directory
pnlFooter.Visible := gStatusBar; // Status bar
if gShowIcons then
pnlFile.FileList.UpdateFileInformation(pnlFile.PanelMode);
end;
for I := 0 to nbRight.PageCount - 1 do // change on all tabs
@ -2743,6 +2745,8 @@ begin
begin
pnlHeader.Visible := gCurDir; // Current directory
pnlFooter.Visible := gStatusBar; // Status bar
if gShowIcons then
pnlFile.FileList.UpdateFileInformation(pnlFile.PanelMode);
end;
for I := 0 to pnlKeys.ControlCount - 1 do // function keys

View file

@ -1,7 +1,7 @@
inherited frmOptions: TfrmOptions
Left = 229
Left = 179
Height = 409
Top = 207
Top = 85
Width = 577
HorzScrollBar.Page = 576
VertScrollBar.Page = 408
@ -116,13 +116,14 @@ inherited frmOptions: TfrmOptions
Top = 24
Width = 454
Align = alClient
PageIndex = 8
OnPageChanged = nbNotebookPageChanged
PageIndex = 1
ShowTabs = False
TabOrder = 0
object pgLng: TPage
Caption = 'pgLng'
ClientWidth = 446
ClientHeight = 333
ClientHeight = 315
object lngList: TListBox
Height = 300
Width = 446
@ -133,7 +134,7 @@ inherited frmOptions: TfrmOptions
object pgBehav: TPage
Caption = 'pgBehav'
ClientWidth = 446
ClientHeight = 333
ClientHeight = 315
object lblTerm: TLabel
Left = 8
Height = 14
@ -230,9 +231,9 @@ inherited frmOptions: TfrmOptions
ClientWidth = 184
TabOrder = 3
object lblIconsSize: TLabel
Left = 6
Left = 14
Height = 14
Top = 4
Top = 112
Width = 53
Caption = 'Icons Size:'
ParentColor = False
@ -240,9 +241,10 @@ inherited frmOptions: TfrmOptions
object cbIconsSize: TComboBox
Left = 86
Height = 21
Top = -3
Top = 105
Width = 91
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
Enabled = False
ItemHeight = 13
ItemIndex = 0
Items.Strings = (
@ -258,17 +260,26 @@ inherited frmOptions: TfrmOptions
object cbDropReadOnlyFlag: TCheckBox
Left = 6
Height = 13
Top = 26
Top = -3
Width = 106
Caption = 'Drop readonly flag'
TabOrder = 1
end
object cbShowIcons: TCheckBox
Left = 6
Height = 13
Top = 84
Width = 75
Caption = 'Show icons'
OnChange = cbShowIconsChange
TabOrder = 2
end
end
end
object pgTools: TPage
Caption = 'pgTools'
ClientWidth = 446
ClientHeight = 333
ClientHeight = 315
object cbExtEditor: TCheckBox
Left = 3
Height = 13
@ -327,7 +338,7 @@ inherited frmOptions: TfrmOptions
object pgFonts: TPage
Caption = 'pgFonts'
ClientWidth = 446
ClientHeight = 333
ClientHeight = 315
object lblMainFont: TLabel
Left = 6
Height = 14
@ -488,7 +499,7 @@ inherited frmOptions: TfrmOptions
object pgColor: TPage
Caption = 'pgColor'
ClientWidth = 446
ClientHeight = 333
ClientHeight = 315
object cTextLabel: TLabel
Left = 25
Height = 14
@ -828,7 +839,7 @@ inherited frmOptions: TfrmOptions
object pgHotKey: TPage
Caption = 'pgHotKey'
ClientWidth = 446
ClientHeight = 333
ClientHeight = 315
object lblActions: TLabel
Left = 6
Height = 14
@ -893,9 +904,9 @@ inherited frmOptions: TfrmOptions
object pgPlugins: TPage
Caption = 'pgPlugins'
ClientWidth = 446
ClientHeight = 333
ClientHeight = 315
object pcPluginsTypes: TPageControl
Height = 333
Height = 315
Width = 446
ActivePage = tsWCX
Align = alClient
@ -903,7 +914,7 @@ inherited frmOptions: TfrmOptions
TabOrder = 0
object tsWCX: TTabSheet
Caption = 'Packer plugins (.WCX)'
ClientHeight = 307
ClientHeight = 289
ClientWidth = 438
OnShow = tsWCXShow
object lblAbout: TLabel
@ -992,7 +1003,7 @@ inherited frmOptions: TfrmOptions
object tsWFX: TTabSheet
Caption = 'File system plugins (.WFX)'
ChildSizing.LeftRightSpacing = 239
ClientHeight = 307
ClientHeight = 289
ClientWidth = 438
OnShow = tsWFXShow
object lblInstalledPlugins: TLabel
@ -1056,7 +1067,7 @@ inherited frmOptions: TfrmOptions
object pgFileTypesColors: TPage
Caption = 'pgFileTypesColors'
ClientWidth = 446
ClientHeight = 333
ClientHeight = 315
object gbFileTypesColors: TGroupBox
Left = 10
Height = 274

View file

@ -82,6 +82,7 @@ type
cbDropReadOnlyFlag: TCheckBox;
cbFlatInterface: TCheckBox;
cbFlatToolBar: TCheckBox;
cbShowIcons: TCheckBox;
clbWFXList: TCheckListBox;
clbWCXList: TCheckListBox;
cbBackColor2: TColorBox;
@ -188,6 +189,7 @@ type
procedure cbColorBoxChange(Sender: TObject);
procedure cbExtChange(Sender: TObject);
procedure cbShowDiskPanelChange(Sender: TObject);
procedure cbShowIconsChange(Sender: TObject);
procedure clbWCXListClick(Sender: TObject);
procedure cbTextColorChange(Sender: TObject);
procedure cbColorBoxDropDown(Sender: TObject);
@ -209,6 +211,7 @@ type
procedure edHotKeyKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState
);
procedure lbCategoriesClick(Sender: TObject);
procedure nbNotebookPageChanged(Sender: TObject);
procedure pbExamplePaint(Sender: TObject);
procedure tsWCXShow(Sender: TObject);
procedure tsWFXShow(Sender: TObject);
@ -323,6 +326,11 @@ begin
cbFlatDiskPanel.Enabled := cbShowDiskPanel.Checked;
end;
procedure TfrmOptions.cbShowIconsChange(Sender: TObject);
begin
cbIconsSize.Enabled := cbShowIcons.Checked;
end;
procedure TfrmOptions.clbWCXListClick(Sender: TObject);
begin
cbWCXPath.Text := clbWCXList.Items[clbWCXList.ItemIndex];
@ -437,6 +445,8 @@ begin
cbCursorText.Selection := gCursorText;
cbCursorText.Color := gCursorText;
cbShowIcons.Checked := gShowIcons;
{ Icons sizes in file panels }
cbIconsSize.Text := IntToStr(gIconsSize) + 'x' + IntToStr(gIconsSize);
// ToDo lang to tsColor tsHotKey
@ -525,6 +535,8 @@ begin
gCursorColor := cbCursorColor.Color;
gCursorText := cbCursorText.Color;
gShowIcons := cbShowIcons.Checked;
frmMain.UpdateWindowView;
frmMain.Repaint; // for panels repaint
frmMain.SaveShortCuts;
@ -956,6 +968,13 @@ begin
end;
end;
procedure TfrmOptions.nbNotebookPageChanged(Sender: TObject);
begin
// temporally this is hack for bug http://www.freepascal.org/mantis/view.php?id=9635
nbNotebook.Page[nbNotebook.PageIndex].Height := nbNotebook.Height - 8;
nbNotebook.Page[nbNotebook.PageIndex].Height := nbNotebook.Height - 8;
end;
procedure TfrmOptions.bbtnAddCategoryClick(Sender: TObject);
var
iIndex : Integer;

View file

@ -503,7 +503,7 @@ begin
end;
end;
0:begin
if iIconID>=0 then
if (iIconID >= 0) and gShowIcons then
begin
PixMapManager.DrawBitmap(iIconID, Canvas, Rect);
end;
@ -511,8 +511,11 @@ begin
s:=sNameNoExt
else
s:=sName;
Canvas.TextOut(Rect.Left + gIconsSize + 2 ,iTextTop,s);
end;
if gShowIcons then
Canvas.TextOut(Rect.Left + gIconsSize + 2 ,iTextTop,s)
else
Canvas.TextOut(Rect.Left + 2 ,iTextTop,s);
end; // 0:
end; //case
end; //with
end;

View file

@ -155,6 +155,7 @@ begin
p^.fTimeI := fi^.fTimeI;
p^.sTime := fi^.sTime;
p^.iMode := fi^.iMode;
p^.bSysFile := fi^.bSysFile;
p^.bExecutable := fi^.bExecutable;
p^.sModeStr := fi^.sModeStr;
p^.iIconID:= fi^.iIconID;

View file

@ -80,6 +80,7 @@ begin
fr.iDirSize:=0;
fr.iMode:=0;
fr.bExecutable:=False;
fr.bSysFile := False;
fr.bIsLink:=False;
fr.sLinkTo:='';
fr.bLinkIsDir:=False;
@ -106,10 +107,12 @@ begin
fr.sGroup:=GIDToStr(fr.iGroup);
{/mate}
fr.iMode:=sb.st_mode;
fr.bSysFile := (sr.Name[1] = '.') and (sr.Name <> '..');
fr.fTimeI:= FileStampToDateTime(sb.st_mtime); // EncodeDate (1970, 1, 1) + (sr.Time / 86400.0);
{$ELSE} // Windows
fr.iSize:= sr.Size;
fr.iMode:= sr.Attr;
fr.bSysFile := Boolean(sr.Attr and faSysFile) or Boolean(sr.Attr and faHidden);
fr.fTimeI:= FileDateToDateTime(sr.Time);
{$ENDIF}

View file

@ -166,7 +166,7 @@ begin
pfri:=fFileList.GetItem(i);
with pfri^ do
begin
if not gShowSystemFiles and (sName[1]='.') and (sName<>'..') then Continue;
if (not gShowSystemFiles) and bSysFile then Continue;
fRefList.Add(pfri);
end;
end;
@ -296,7 +296,8 @@ begin
end;
fActiveDir := fVFS.ArcFullName + DirectorySeparator;
end;
fFileList.UpdateFileInformation(fPanelMode);
if gShowIcons then
fFileList.UpdateFileInformation(fPanelMode);
Sort;
Exit;
end;
@ -308,7 +309,8 @@ begin
begin
fPanelMode := pmDirectory;
fActiveDir := PathDelim;
fFileList.UpdateFileInformation(PanelMode);
if gShowIcons then
fFileList.UpdateFileInformation(PanelMode);
Sort;
end;
end;
@ -337,7 +339,8 @@ begin
LoadFilesbyDir(fActiveDir, fFileList);
end;
end; // case
fFileList.UpdateFileInformation(fPanelMode);
if gShowIcons then
fFileList.UpdateFileInformation(fPanelMode);
Sort; // and Update panel
fPanel.Invalidate;
// writeln('TFilePanel.LoadPanel DONE');
@ -369,7 +372,7 @@ end;
procedure TFilePanel.InvertFileSection(frp:PFileRecItem);
begin
if not gShowSystemFiles and (frp^.sName[1]='.') then Exit;
if not gShowSystemFiles and (frp^.bSysFile) then Exit;
frp^.bSelected:=not frp^.bSelected;
end;
@ -462,7 +465,7 @@ begin
for i:=0 to fFileList.Count-1 do
begin
fr:=fFileList.GetItem(i);
if not gShowSystemFiles and (fr^.sName[1]='.') then
if not gShowSystemFiles and (fr^.bSysFile) then
// system files is always not selected if not showed
fr^.bSelected:=False
else

View file

@ -96,6 +96,7 @@ var
gCursorColor, //Cursor color
gCursorText : TColor; //text color under cursor
gShowIcons : Boolean;
gIconsSize : Integer;
gDirTabOptions,
gDirTabLimit : Integer;
@ -265,6 +266,7 @@ begin
gCursorColor := gIni.ReadInteger('Colors', 'CursorColor', clHighlight);
gCursorText := gIni.ReadInteger('Colors', 'CursorText', clHighlightedText);
gShowIcons := gIni.ReadBool('Configuration', 'ShowIcons', True);
gIconsSize := gIni.ReadInteger('Configuration', 'IconsSize', 16);
gpPixmapPath := gpPixmapPath + IntToStr(gIconsSize) + 'x' + IntToStr(gIconsSize) + PathDelim;
@ -382,7 +384,7 @@ begin
gIni.WriteInteger('Colors', 'CursorText', gCursorText);
gIni.WriteBool('Configuration', 'ShowIcons', gShowIcons);
gIni.WriteInteger('Configuration', 'IconsSize', gIconsSize);
gIni.WriteBool('Configuration', 'UseMmapInSearch', gUseMmapInSearch);

View file

@ -34,6 +34,7 @@ type
bExecutable : Boolean;
sModeStr : String[11];
iMode : Cardinal; // from stats
bSysFile : Boolean;
iIconID : Integer; // index ICO in imagelist
sOwner : AnsiString;
sGroup : AnsiString;

View file

@ -120,6 +120,7 @@ begin
fi.sNameNoExt:=fi.sName;
fi.bSelected:=False;
fi.bExecutable:=False;
fi.bSysFile := False;
fi.sModeStr:='drwxr-xr-x';
fi.iMode:=ModeStr2Mode(fi.sModeStr); //!!!!
fi.iDirSize:=0;