Project Inspector: Add an option to hide the properties pane.

This commit is contained in:
ACTom 2022-05-26 12:53:52 +08:00 committed by Juha
parent 16321fbd3e
commit c933dc2131
5 changed files with 52 additions and 8 deletions

View File

@ -480,6 +480,7 @@ type
FHideIDEOnRun: boolean; FHideIDEOnRun: boolean;
FAutoAdjustIDEHeight: boolean; FAutoAdjustIDEHeight: boolean;
FAutoAdjustIDEHeightFullCompPal: boolean; FAutoAdjustIDEHeightFullCompPal: boolean;
FProjectInspectorShowProps: boolean;
// window menu // window menu
FIDENameForDesignedFormList: boolean; FIDENameForDesignedFormList: boolean;
// CompletionWindow // CompletionWindow
@ -535,6 +536,8 @@ type
property EditorToolBarOptions: TEditorToolBarOptions read FEditorToolBarOptions; property EditorToolBarOptions: TEditorToolBarOptions read FEditorToolBarOptions;
property ComponentPaletteOptions: TCompPaletteOptions read FComponentPaletteOptions; property ComponentPaletteOptions: TCompPaletteOptions read FComponentPaletteOptions;
property ObjectInspectorOptions: TDesktopOIOptions read FObjectInspectorOptions; property ObjectInspectorOptions: TDesktopOIOptions read FObjectInspectorOptions;
property ProjectInspectorShowProps: boolean read FProjectInspectorShowProps
write FProjectInspectorShowProps;
end; end;
{ TUnsupportedDesktopOpt } { TUnsupportedDesktopOpt }
@ -2044,6 +2047,8 @@ begin
FComponentPaletteOptions:=TCompPaletteOptions.Create; FComponentPaletteOptions:=TCompPaletteOptions.Create;
// object inspector // object inspector
FObjectInspectorOptions:=TDesktopOIOptions.Create; FObjectInspectorOptions:=TDesktopOIOptions.Create;
// project inspector
FProjectInspectorShowProps := true;
// Windows layout // Windows layout
InitLayoutList; InitLayoutList;
@ -2109,6 +2114,8 @@ begin
FComponentPaletteOptions.Assign(Source.FComponentPaletteOptions); FComponentPaletteOptions.Assign(Source.FComponentPaletteOptions);
// object inspector // object inspector
FObjectInspectorOptions.Assign(Source.FObjectInspectorOptions); FObjectInspectorOptions.Assign(Source.FObjectInspectorOptions);
// project inspector
FProjectInspectorShowProps := Source.FProjectInspectorShowProps;
if IsCompatible and Assigned(FDockedOpt) then if IsCompatible and Assigned(FDockedOpt) then
FDockedOpt.Assign(Source.FDockedOpt); FDockedOpt.Assign(Source.FDockedOpt);
@ -2135,6 +2142,8 @@ begin
// CompletionWindow // CompletionWindow
FCompletionWindowWidth:=FXMLCfg.GetValue(Path+'CompletionWindowOptions/Width/Value', FCompletionWindowWidth); FCompletionWindowWidth:=FXMLCfg.GetValue(Path+'CompletionWindowOptions/Width/Value', FCompletionWindowWidth);
FCompletionWindowHeight:=FXMLCfg.GetValue(Path+'CompletionWindowOptions/Height/Value', 6); FCompletionWindowHeight:=FXMLCfg.GetValue(Path+'CompletionWindowOptions/Height/Value', 6);
// Project Inspector
FProjectInspectorShowProps := FXMLCfg.GetValue(Path+'ProjectInspectorShowProps/Value', true);
if not FXMLCfg.HasPath(Path+'IDECoolBarOptions/', True) then if not FXMLCfg.HasPath(Path+'IDECoolBarOptions/', True) then
Path := ''; // Toolbars and palette were at the top level in XML. Path := ''; // Toolbars and palette were at the top level in XML.
@ -2197,6 +2206,8 @@ begin
// CompletionWindow // CompletionWindow
FXMLCfg.SetValue(Path+'CompletionWindowOptions/Width/Value',FCompletionWindowWidth); FXMLCfg.SetValue(Path+'CompletionWindowOptions/Width/Value',FCompletionWindowWidth);
FXMLCfg.SetDeleteValue(Path+'CompletionWindowOptions/Height/Value',FCompletionWindowHeight, 6); FXMLCfg.SetDeleteValue(Path+'CompletionWindowOptions/Height/Value',FCompletionWindowHeight, 6);
// Project Inspector
FXMLCfg.SetDeleteValue(Path+'ProjectInspectorShowProps/Value', FProjectInspectorShowProps, true);
// IDE Coolbar // IDE Coolbar
FIDECoolBarOptions.Save(FXMLCfg, Path); FIDECoolBarOptions.Save(FXMLCfg, Path);
// Editor Toolbar // Editor Toolbar

View File

@ -129,4 +129,17 @@ object WindowOptionsFrame: TWindowOptionsFrame
ShowHint = True ShowHint = True
TabOrder = 7 TabOrder = 7
end end
object ProjectInspectorShowPropsCheckBox: TCheckBox
AnchorSideLeft.Control = AutoAdjustIDEHeightFullCompPalCheckBox
AnchorSideTop.Control = AutoAdjustIDEHeightFullCompPalCheckBox
AnchorSideTop.Side = asrBottom
Left = 0
Height = 24
Top = 211
Width = 295
Caption = 'ProjectInspectorShowPropsCheckBox'
ParentShowHint = False
ShowHint = True
TabOrder = 8
end
end end

View File

@ -40,6 +40,7 @@ type
TWindowOptionsFrame = class(TAbstractIDEOptionsEditor) TWindowOptionsFrame = class(TAbstractIDEOptionsEditor)
AutoAdjustIDEHeightFullCompPalCheckBox: TCheckBox; AutoAdjustIDEHeightFullCompPalCheckBox: TCheckBox;
ProjectInspectorShowPropsCheckBox: TCheckBox;
lblShowingWindows: TDividerBevel; lblShowingWindows: TDividerBevel;
NameForDesignedFormList: TCheckBox; NameForDesignedFormList: TCheckBox;
AutoAdjustIDEHeightCheckBox: TCheckBox; AutoAdjustIDEHeightCheckBox: TCheckBox;
@ -89,6 +90,8 @@ begin
AutoAdjustIDEHeightFullCompPalCheckBox.Hint:=lisAutoAdjustIDEHeightFullComponentPaletteHint; AutoAdjustIDEHeightFullCompPalCheckBox.Hint:=lisAutoAdjustIDEHeightFullComponentPaletteHint;
ProjectDirInIdeTitleCheckBox.Caption:=lisIDETitleShowsProjectDir; ProjectDirInIdeTitleCheckBox.Caption:=lisIDETitleShowsProjectDir;
ProjectDirInIdeTitleCheckBox.Hint:=lisProjectDirectoryIsShowedInIdeTitleBar; ProjectDirInIdeTitleCheckBox.Hint:=lisProjectDirectoryIsShowedInIdeTitleBar;
ProjectInspectorShowPropsCheckBox.Caption:=lisProjectInspectorShowProps;
ProjectInspectorShowPropsCheckBox.Hint:=lisProjectInspectorShowPropsHint;
end; end;
procedure TWindowOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions); procedure TWindowOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
@ -104,6 +107,7 @@ begin
AutoAdjustIDEHeightCheckBox.Checked:=AutoAdjustIDEHeight; AutoAdjustIDEHeightCheckBox.Checked:=AutoAdjustIDEHeight;
AutoAdjustIDEHeightFullCompPalCheckBox.Checked:=AutoAdjustIDEHeightFullCompPal; AutoAdjustIDEHeightFullCompPalCheckBox.Checked:=AutoAdjustIDEHeightFullCompPal;
ProjectDirInIdeTitleCheckBox.Checked:=IDEProjectDirectoryInIdeTitle; ProjectDirInIdeTitleCheckBox.Checked:=IDEProjectDirectoryInIdeTitle;
ProjectInspectorShowPropsCheckBox.Checked:=ProjectInspectorShowProps;
end; end;
end; end;
@ -120,6 +124,7 @@ begin
AutoAdjustIDEHeight := AutoAdjustIDEHeightCheckBox.Checked; AutoAdjustIDEHeight := AutoAdjustIDEHeightCheckBox.Checked;
AutoAdjustIDEHeightFullCompPal := AutoAdjustIDEHeightFullCompPalCheckBox.Checked; AutoAdjustIDEHeightFullCompPal := AutoAdjustIDEHeightFullCompPalCheckBox.Checked;
IDEProjectDirectoryInIdeTitle:=ProjectDirInIdeTitleCheckBox.Checked; IDEProjectDirectoryInIdeTitle:=ProjectDirInIdeTitleCheckBox.Checked;
ProjectInspectorShowProps:=ProjectInspectorShowPropsCheckBox.Checked;
end; end;
end; end;

View File

@ -1426,6 +1426,8 @@ resourcestring
lisAutoAdjustIDEHeightFullComponentPalette = 'Show complete component palette'; lisAutoAdjustIDEHeightFullComponentPalette = 'Show complete component palette';
lisAutoAdjustIDEHeightFullComponentPaletteHint = lisAutoAdjustIDEHeightFullComponentPaletteHint =
'If component palette spans over more lines, show them all and not only one.'; 'If component palette spans over more lines, show them all and not only one.';
lisProjectInspectorShowProps = 'Show properties in Project Inspector';
lisProjectInspectorShowPropsHint = 'Properties are in the lower pane';
lisWindowMenuWithNameForDesignedForm = 'Window menu shows designed form''s name instead of caption'; lisWindowMenuWithNameForDesignedForm = 'Window menu shows designed form''s name instead of caption';
lisWindowMenuWithNameForDesignedFormHint = 'Useful especially if the caption is left empty.'; lisWindowMenuWithNameForDesignedFormHint = 'Useful especially if the caption is left empty.';
lisTitleInTaskbarShowsForExampleProject1LpiLazarus = 'Title in taskbar ' lisTitleInTaskbarShowsForExampleProject1LpiLazarus = 'Title in taskbar '

View File

@ -208,6 +208,7 @@ type
function CreateToolButton(AName, ACaption, AHint, AImageName: String; function CreateToolButton(AName, ACaption, AHint, AImageName: String;
AOnClick: TNotifyEvent): TToolButton; AOnClick: TNotifyEvent): TToolButton;
function CreateDivider: TToolButton; function CreateDivider: TToolButton;
procedure OptionsChanged(Sender: TObject; {%H-}Restore: boolean);
procedure SetDependencyDefaultFilename(AsPreferred: boolean); procedure SetDependencyDefaultFilename(AsPreferred: boolean);
procedure SetIdleConnected(AValue: boolean); procedure SetIdleConnected(AValue: boolean);
procedure SetLazProject(const AValue: TProject); procedure SetLazProject(const AValue: TProject);
@ -1297,6 +1298,12 @@ begin
Result.Parent := ToolBar; Result.Parent := ToolBar;
end; end;
procedure TProjectInspectorForm.OptionsChanged(Sender: TObject; Restore: boolean);
begin
PropsGroupBox.Visible := EnvironmentOptions.Desktop.ProjectInspectorShowProps;
Splitter1.Visible := PropsGroupBox.Visible;
end;
procedure TProjectInspectorForm.SetupComponents; procedure TProjectInspectorForm.SetupComponents;
begin begin
ImageIndexFiles := IDEImages.LoadImage('pkg_files'); ImageIndexFiles := IDEImages.LoadImage('pkg_files');
@ -1341,6 +1348,9 @@ begin
FDependenciesNode.ImageIndex:=FPropGui.ImageIndexRequired; FDependenciesNode.ImageIndex:=FPropGui.ImageIndexRequired;
FDependenciesNode.SelectedIndex:=FDependenciesNode.ImageIndex; FDependenciesNode.SelectedIndex:=FDependenciesNode.ImageIndex;
end; end;
EnvironmentOptions.AddHandlerAfterWrite(@OptionsChanged);
OptionsChanged(Nil, False);
end; end;
function TProjectInspectorForm.TreeViewGetImageIndex(Str: String; Data: TObject; function TProjectInspectorForm.TreeViewGetImageIndex(Str: String; Data: TObject;
@ -1704,16 +1714,16 @@ end;
procedure TProjectInspectorForm.UpdateProperties(Immediately: boolean); procedure TProjectInspectorForm.UpdateProperties(Immediately: boolean);
var var
CurDependency, SingleSelectedDep: TPkgDependency; CurDependency, SingleSelectedDep: TPkgDependency;
TVNode, SingleSelectedDirectory: TTreeNode; TVNode, DepHeaderNode, SingleSelectedDirectory: TTreeNode;
NodeData: TPENodeData; NodeData: TPENodeData;
Item: TObject; Item: TObject;
i, SelFileCount, SelDepCount, SelUnitCount, SelDirCount: Integer; i, SelFileCount, SelDepCount, SelUnitCount, SelDirCount: Integer;
SingleSelectedRemoved: Boolean; SingleSelectedRemoved: Boolean;
begin begin
if not CanUpdate(pefNeedUpdateProperties,Immediately) then exit; if not CanUpdate(pefNeedUpdateProperties,Immediately) then exit;
//GuiToFileOptions(False);
// check selection // check selection
DepHeaderNode:=nil;
SingleSelectedDep:=nil; SingleSelectedDep:=nil;
SingleSelectedDirectory:=nil; SingleSelectedDirectory:=nil;
SingleSelectedRemoved:=false; SingleSelectedRemoved:=false;
@ -1735,11 +1745,11 @@ begin
SingleSelectedDep:=CurDependency; SingleSelectedDep:=CurDependency;
SingleSelectedRemoved:=NodeData.Removed; SingleSelectedRemoved:=NodeData.Removed;
end; end;
end else if IsDirectoryNode(TVNode) or (TVNode=FFilesNode) then begin end else if IsDirectoryNode(TVNode) then begin
inc(SelDirCount); inc(SelDirCount);
SingleSelectedDirectory:=TVNode; SingleSelectedDirectory:=TVNode;
end //else if TVNode=FRequiredPackagesNode then end else if TVNode=FDependenciesNode then
// DebugLn('UpdatePEProperties: Required packages selected'); DepHeaderNode:=TVNode;
end; end;
if (SelFileCount+SelDepCount+SelDirCount>1) then begin if (SelFileCount+SelDepCount+SelDirCount>1) then begin
@ -1768,12 +1778,15 @@ begin
FPropGui.UpdateApplyDependencyButton; FPropGui.UpdateApplyDependencyButton;
end end
else if SingleSelectedDirectory<>nil then begin else if SingleSelectedDirectory<>nil then begin
//PropsGroupBox.Enabled:=true; PropsGroupBox.Enabled:=true;
//PropsGroupBox.Caption:=lisPckEditFileProperties; PropsGroupBox.Caption:=lisPckEditFileProperties;
end end
else begin else begin
PropsGroupBox.Enabled:=false; PropsGroupBox.Enabled:=false;
PropsGroupBox.Caption:=lisPckEditDependencyProperties; if Assigned(DepHeaderNode) then
PropsGroupBox.Caption:=lisPckEditDependencyProperties
else
PropsGroupBox.Caption:=lisPckEditFileProperties;
end; end;
finally finally
EnableAlign; EnableAlign;