[Lazarus] ObjectInspector DefaultItemHeight issue

Sandro Cumerlato sandro.cumerlato at gmail.com
Sun Nov 23 17:37:08 CET 2014


Please review attached patch:

- uniform DefaultItemHeight to 22 pixels;
- avoid DefaultItemHeight < ComboBox Height (- 3).

Apply if OK, thanx.

Sandro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141123/79585775/attachment-0002.html>
-------------- next part --------------
Index: components/ideintf/objectinspector.pp
===================================================================
--- components/ideintf/objectinspector.pp	(revisione 46970)
+++ components/ideintf/objectinspector.pp	(copia locale)
@@ -474,7 +474,7 @@
     property CurrentEditValue: string read GetCurrentEditValue
                                       write SetCurrentEditValue;
     property DefaultItemHeight:integer read FDefaultItemHeight
-                                       write FDefaultItemHeight default 25;
+                                       write FDefaultItemHeight default 22;
     property DrawHorzGridLines: Boolean read FDrawHorzGridLines write
       SetDrawHorzGridLines default True;
     property ExpandedProperties: TStringList read FExpandedProperties
@@ -994,10 +994,8 @@
   FHintManager := THintWindowManager.Create;
   FActiveRowBmp := CreateBitmapFromResourceName(HInstance, 'pg_active_row');
 
-  if DefItemHeight<3 then
-    FDefaultItemHeight:=ValueComboBox.Height-3
-  else
-    FDefaultItemHeight:=DefItemHeight;
+  if DefItemHeight<ValueComboBox.Height-3 then
+    FDefaultItemHeight:=ValueComboBox.Height-3;
 
   BuildPropertyList;
   Application.AddOnUserInputHandler(@OnUserInput,true);
@@ -1005,7 +1003,7 @@
 
 constructor TOICustomPropertyGrid.Create(TheOwner: TComponent);
 begin
-  CreateWithParams(TheOwner,nil,AllTypeKinds,25);
+  CreateWithParams(TheOwner,nil,AllTypeKinds,22);
 end;
 
 destructor TOICustomPropertyGrid.Destroy;
@@ -3655,7 +3653,7 @@
   FHeight:=400;
   for p:=Low(TObjectInspectorPage) to High(TObjectInspectorPage) do
     FGridSplitterX[p]:=110;
-  FDefaultItemHeight:=20;
+  FDefaultItemHeight:=22;
   FShowComponentTree:=true;
   FComponentTreeHeight:=160;
   FInfoBoxHeight:=80;
@@ -3709,8 +3707,8 @@
       if FGridSplitterX[Page]<10 then
         FGridSplitterX[Page]:=10;
 
-    FDefaultItemHeight:=ConfigStore.GetValue(Path+'Bounds/DefaultItemHeight',20);
-    if FDefaultItemHeight<0 then FDefaultItemHeight:=20;
+    FDefaultItemHeight:=ConfigStore.GetValue(Path+'Bounds/DefaultItemHeight',22);
+    if FDefaultItemHeight<0 then FDefaultItemHeight:=22;
     FShowComponentTree:=ConfigStore.GetValue(Path+'ComponentTree/Show/Value',True);
     FComponentTreeHeight:=ConfigStore.GetValue(Path+'ComponentTree/Height/Value',160);
 
@@ -3764,7 +3762,7 @@
     for Page:=Low(TObjectInspectorPage) to High(TObjectInspectorPage) do
       ConfigStore.SetDeleteValue(Path+'Bounds/'+DefaultOIPageNames[Page]+'/SplitterX',
                                  FGridSplitterX[Page],110);
-    ConfigStore.SetDeleteValue(Path+'Bounds/DefaultItemHeight',FDefaultItemHeight,20);
+    ConfigStore.SetDeleteValue(Path+'Bounds/DefaultItemHeight',FDefaultItemHeight,22);
     ConfigStore.SetDeleteValue(Path+'ComponentTree/Show/Value',FShowComponentTree,True);
     ConfigStore.SetDeleteValue(Path+'ComponentTree/Height/Value',FComponentTreeHeight,160);
 
@@ -5511,7 +5509,7 @@
   Hook:=TPropertyEditorHook.Create(Self);
   FAutoFreeHook:=true;
   FSaveOnChangeTIObject:=true;
-  CreateWithParams(TheOwner,Hook,AllTypeKinds,25);
+  CreateWithParams(TheOwner,Hook,AllTypeKinds,22);
 end;
 
 destructor TCustomPropertiesGrid.Destroy;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oi_combobox_height.png
Type: image/png
Size: 4551 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141123/79585775/attachment-0002.png>


More information about the Lazarus mailing list