more scaling adjustments

This commit is contained in:
Basile Burg 2018-01-22 06:24:31 +01:00
parent 9be04dd9d0
commit 3c77a1187e
19 changed files with 156 additions and 1315 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
icons/other/html_go.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

BIN
icons/other/html_go24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
icons/other/html_go32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
icons/other/shortcuts.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

BIN
icons/other/shortcuts24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

BIN
icons/other/shortcuts32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -13,7 +13,7 @@
<DpiAware Value="True/PM"/> <DpiAware Value="True/PM"/>
</XPManifest> </XPManifest>
<Icon Value="0"/> <Icon Value="0"/>
<Resources Count="364"> <Resources Count="373">
<Resource_0 FileName="..\icons\arrow\arrow_up.png" Type="RCDATA" ResourceName="ARROW_UP"/> <Resource_0 FileName="..\icons\arrow\arrow_up.png" Type="RCDATA" ResourceName="ARROW_UP"/>
<Resource_1 FileName="..\icons\arrow\arrow_down.png" Type="RCDATA" ResourceName="ARROW_DOWN"/> <Resource_1 FileName="..\icons\arrow\arrow_down.png" Type="RCDATA" ResourceName="ARROW_DOWN"/>
<Resource_2 FileName="..\icons\arrow\arrow_divide.png" Type="RCDATA" ResourceName="ARROW_DIVIDE"/> <Resource_2 FileName="..\icons\arrow\arrow_divide.png" Type="RCDATA" ResourceName="ARROW_DIVIDE"/>
@ -378,6 +378,15 @@
<Resource_361 FileName="../icons/other/indent_less.png" Type="RCDATA" ResourceName="INDENT_LESS"/> <Resource_361 FileName="../icons/other/indent_less.png" Type="RCDATA" ResourceName="INDENT_LESS"/>
<Resource_362 FileName="../icons/book/book_grey32.png" Type="RCDATA" ResourceName="BOOK_GREY32"/> <Resource_362 FileName="../icons/book/book_grey32.png" Type="RCDATA" ResourceName="BOOK_GREY32"/>
<Resource_363 FileName="../icons/book/book_grey24.png" Type="RCDATA" ResourceName="BOOK_GREY24"/> <Resource_363 FileName="../icons/book/book_grey24.png" Type="RCDATA" ResourceName="BOOK_GREY24"/>
<Resource_364 FileName="../icons/other/shortcuts.png" Type="RCDATA" ResourceName="SHORTCUTS"/>
<Resource_365 FileName="../icons/other/shortcuts24.png" Type="RCDATA" ResourceName="SHORTCUTS24"/>
<Resource_366 FileName="../icons/other/shortcuts32.png" Type="RCDATA" ResourceName="SHORTCUTS32"/>
<Resource_367 FileName="../icons/other/html_go.png" Type="RCDATA" ResourceName="HTML_GO"/>
<Resource_368 FileName="../icons/other/html_go24.png" Type="RCDATA" ResourceName="HTML_GO24"/>
<Resource_369 FileName="../icons/other/html_go32.png" Type="RCDATA" ResourceName="HTML_GO32"/>
<Resource_370 FileName="../icons/folder/move_to_folder.png" Type="RCDATA" ResourceName="MOVE_TO_FOLDER"/>
<Resource_371 FileName="../icons/folder/move_to_folder24.png" Type="RCDATA" ResourceName="MOVE_TO_FOLDER24"/>
<Resource_372 FileName="../icons/folder/move_to_folder32.png" Type="RCDATA" ResourceName="MOVE_TO_FOLDER32"/>
</Resources> </Resources>
</General> </General>
<i18n> <i18n>

View File

@ -101,6 +101,10 @@ type
procedure updateEditor; procedure updateEditor;
protected protected
procedure SetVisible(Value: Boolean); override; procedure SetVisible(Value: Boolean); override;
private
fCloneBtn: TBitBtn;
fAddBtn: TBitBtn;
fDelBtn: TBitBtn;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
@ -288,9 +292,30 @@ begin
fEditor.Font.Assign(EditorOptions.font); fEditor.Font.Assign(EditorOptions.font);
fEditor.Font.Size:=12; fEditor.Font.Size:=12;
fEditor.Font.Name:=EditorOptions.font.Name; fEditor.Font.Name:=EditorOptions.font.Name;
fEditor.Height:= scaleY(160,96);
if firstTime then if firstTime then
fList.ItemIndex := 0; fList.ItemIndex := 0;
lstBoxSelChange(nil); lstBoxSelChange(nil);
case GetIconScaledSize of
iss16:
begin
AssignPng(fAddBtn, 'DOCUMENT_ADD');
AssignPng(fDelBtn, 'DOCUMENT_DELETE');
AssignPng(fCloneBtn, 'DOCUMENT_PLUS');
end;
iss24:
begin
AssignPng(fAddBtn, 'DOCUMENT_ADD24');
AssignPng(fDelBtn, 'DOCUMENT_DELETE24');
AssignPng(fCloneBtn, 'DOCUMENT_PLUS24');
end;
iss32:
begin
AssignPng(fAddBtn, 'DOCUMENT_ADD32');
AssignPng(fDelBtn, 'DOCUMENT_DELETE32');
AssignPng(fCloneBtn, 'DOCUMENT_PLUS32');
end;
end;
end; end;
end; end;
@ -554,47 +579,29 @@ begin
fList.AutoSize := true; fList.AutoSize := true;
updateList; updateList;
//TODO-cbugfix: always iss16 is returned at this point (order of init problem ?) fAddBtn := TBitBtn.Create(self);
isc := GetIconScaledSize; fAddBtn.Parent := pnl;
fAddBtn.AutoSize := true;
fAddBtn.Width:= ScaleX(28,96);
fAddBtn.Align:= alRight;
fAddBtn.OnClick:=@btnAddClick;
fAddBtn.Hint:='add preset';
btn := TBitBtn.Create(self); fDelBtn := TBitBtn.Create(self);
btn.Parent := pnl; fDelBtn.Parent := pnl;
btn.AutoSize := true; fDelBtn.AutoSize := true;
btn.Width:= ScaleX(28,96); fDelBtn.Width:= ScaleX(28,96);
btn.Align:= alRight; fDelBtn.Align:= alRight;
btn.OnClick:=@btnAddClick; fDelBtn.OnClick:=@btnDelClick;
btn.Hint:='add preset'; fDelBtn.Hint:='delete preset';
case isc of
iss16: AssignPng(btn, 'DOCUMENT_ADD');
iss24: AssignPng(btn, 'DOCUMENT_ADD24');
iss32: AssignPng(btn, 'DOCUMENT_ADD32');
end;
btn := TBitBtn.Create(self); fCloneBtn := TBitBtn.Create(self);
btn.Parent := pnl; fCloneBtn.Parent := pnl;
btn.AutoSize := true; fCloneBtn.AutoSize := true;
btn.Width:= ScaleX(28,96); fCloneBtn.Width:= ScaleX(28,96);
btn.Align:= alRight; fCloneBtn.Align:= alRight;
btn.OnClick:=@btnDelClick; fCloneBtn.OnClick:=@btnCloneClick;
btn.Hint:='delete preset'; fCloneBtn.Hint:='clone preset';
case isc of
iss16: AssignPng(btn, 'DOCUMENT_DELETE');
iss24: AssignPng(btn, 'DOCUMENT_DELETE24');
iss32: AssignPng(btn, 'DOCUMENT_DELETE32');
end;
btn := TBitBtn.Create(self);
btn.Parent := pnl;
btn.AutoSize := true;
btn.Width:= ScaleX(28,96);
btn.Align:= alRight;
btn.OnClick:=@btnCloneClick;
btn.Hint:='clone preset';
case isc of
iss16: AssignPng(btn, 'DOCUMENT_PLUS');
iss24: AssignPng(btn, 'DOCUMENT_PLUS24');
iss32: AssignPng(btn, 'DOCUMENT_PLUS32');
end;
fPropEd := TTIPropertyGrid.Create(self); fPropEd := TTIPropertyGrid.Create(self);
fPropEd.Parent := self; fPropEd.Parent := self;
@ -603,7 +610,6 @@ begin
fPropEd.OnModified:=@propEdModified; fPropEd.OnModified:=@propEdModified;
fPropEd.CheckboxForBoolean:=true; fPropEd.CheckboxForBoolean:=true;
fPropEd.PropertyEditorHook.AddHandlerModified(@propEdModified); fPropEd.PropertyEditorHook.AddHandlerModified(@propEdModified);
fPropEd.DefaultItemHeight:=ScaleY(22, 96);
fList.ItemIndex := 0; fList.ItemIndex := 0;
EntitiesConnector.addObserver(self); EntitiesConnector.addObserver(self);

View File

@ -17,6 +17,7 @@ inherited CEDfmtWidget: TCEDfmtWidget
ClientWidth = 450 ClientWidth = 450
inherited Content: TPanel inherited Content: TPanel
Height = 321 Height = 321
Top = 36
Width = 450 Width = 450
ClientHeight = 321 ClientHeight = 321
ClientWidth = 450 ClientWidth = 450
@ -59,6 +60,7 @@ inherited CEDfmtWidget: TCEDfmtWidget
AutoSize = True AutoSize = True
BorderSpacing.Left = 2 BorderSpacing.Left = 2
BorderSpacing.Around = 2 BorderSpacing.Around = 2
Flat = True
end end
object btnApply: TSpeedButton object btnApply: TSpeedButton
Left = 435 Left = 435
@ -70,6 +72,7 @@ inherited CEDfmtWidget: TCEDfmtWidget
AutoSize = True AutoSize = True
BorderSpacing.Left = 2 BorderSpacing.Left = 2
BorderSpacing.Around = 2 BorderSpacing.Around = 2
Flat = True
end end
end end
end end

View File

@ -128,6 +128,7 @@ begin
end; end;
dfmtOptionEditor.TIObject := fDmtWrapper; dfmtOptionEditor.TIObject := fDmtWrapper;
dfmtOptionEditor.DefaultItemHeight:=scaleY(24,96);
end; end;
destructor TCEDfmtWidget.destroy; destructor TCEDfmtWidget.destroy;

File diff suppressed because it is too large Load Diff

View File

@ -145,7 +145,6 @@ type
actEdUnIndent: TAction; actEdUnIndent: TAction;
Actions: TActionList; Actions: TActionList;
ApplicationProperties1: TApplicationProperties; ApplicationProperties1: TApplicationProperties;
imgList: TImageList;
mainMenu: TMainMenu; mainMenu: TMainMenu;
MenuItem1: TMenuItem; MenuItem1: TMenuItem;
MenuItem10: TMenuItem; MenuItem10: TMenuItem;
@ -1421,6 +1420,12 @@ begin
i := LoadIcon('INDENT_LESS'); i := LoadIcon('INDENT_LESS');
actEdUnIndent.ImageIndex:= i; actEdUnIndent.ImageIndex:= i;
i := LoadIcon('HTML_GO');
actFileHtmlExport.ImageIndex:=i;
i := LoadIcon('MOVE_TO_FOLDER');
actFileAddToProj.ImageIndex:=i;
end; end;
procedure TCEMainForm.InitWidgets; procedure TCEMainForm.InitWidgets;

View File

@ -1,37 +1,38 @@
inherited CEOptionEditorWidget: TCEOptionEditorWidget inherited CEOptionEditorWidget: TCEOptionEditorWidget
Left = 594 Left = 594
Height = 493 Height = 514
Top = 257 Top = 257
Width = 575 Width = 637
BorderIcons = [biSystemMenu, biMinimize, biMaximize] BorderIcons = [biSystemMenu, biMinimize, biMaximize]
Caption = 'Options editor' Caption = 'Options editor'
ClientHeight = 493 ClientHeight = 514
ClientWidth = 575 ClientWidth = 637
OnCloseQuery = FormCloseQuery OnCloseQuery = FormCloseQuery
inherited Back: TPanel inherited Back: TPanel
Height = 493 Height = 514
Width = 575 Width = 637
ClientHeight = 493 ClientHeight = 514
ClientWidth = 575 ClientWidth = 637
inherited Content: TPanel inherited Content: TPanel
Height = 457 Height = 478
Width = 575 Top = 36
ClientHeight = 457 Width = 637
ClientWidth = 575 ClientHeight = 478
ClientWidth = 637
object pnlBody: TPanel[0] object pnlBody: TPanel[0]
Left = 4 Left = 4
Height = 431 Height = 452
Top = 4 Top = 4
Width = 567 Width = 629
Align = alClient Align = alClient
BorderSpacing.Around = 4 BorderSpacing.Around = 4
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 431 ClientHeight = 452
ClientWidth = 567 ClientWidth = 629
TabOrder = 0 TabOrder = 0
object selCat: TTreeView object selCat: TTreeView
Left = 0 Left = 0
Height = 431 Height = 452
Top = 0 Top = 0
Width = 182 Width = 182
Align = alLeft Align = alLeft
@ -48,19 +49,19 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget
end end
object pnlEd: TPanel object pnlEd: TPanel
Left = 188 Left = 188
Height = 431 Height = 452
Top = 0 Top = 0
Width = 379 Width = 441
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 431 ClientHeight = 452
ClientWidth = 379 ClientWidth = 441
TabOrder = 1 TabOrder = 1
object inspector: TTIPropertyGrid object inspector: TTIPropertyGrid
Left = 0 Left = 0
Height = 431 Height = 452
Top = 0 Top = 0
Width = 379 Width = 441
Align = alClient Align = alClient
CheckboxForBoolean = False CheckboxForBoolean = False
DefaultValueFont.Color = clWindowText DefaultValueFont.Color = clWindowText
@ -76,7 +77,7 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget
end end
object Splitter1: TSplitter object Splitter1: TSplitter
Left = 182 Left = 182
Height = 431 Height = 452
Top = 0 Top = 0
Width = 6 Width = 6
end end
@ -84,17 +85,17 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget
object pnlFooter: TPanel[1] object pnlFooter: TPanel[1]
Left = 4 Left = 4
Height = 14 Height = 14
Top = 439 Top = 460
Width = 567 Width = 629
Align = alBottom Align = alBottom
AutoSize = True AutoSize = True
BorderSpacing.Around = 4 BorderSpacing.Around = 4
BevelOuter = bvLowered BevelOuter = bvLowered
ClientHeight = 14 ClientHeight = 14
ClientWidth = 567 ClientWidth = 629
TabOrder = 1 TabOrder = 1
object btnCancel: TSpeedButton object btnCancel: TSpeedButton
Left = 548 Left = 610
Height = 4 Height = 4
Hint = 'cancel and revert the modifications of the category' Hint = 'cancel and revert the modifications of the category'
Top = 5 Top = 5
@ -103,10 +104,11 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget
AutoSize = True AutoSize = True
BorderSpacing.Left = 2 BorderSpacing.Left = 2
BorderSpacing.Around = 4 BorderSpacing.Around = 4
Flat = True
OnClick = btnCancelClick OnClick = btnCancelClick
end end
object btnAccept: TSpeedButton object btnAccept: TSpeedButton
Left = 558 Left = 620
Height = 4 Height = 4
Hint = 'accept the modifications of the category' Hint = 'accept the modifications of the category'
Top = 5 Top = 5
@ -115,12 +117,13 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget
AutoSize = True AutoSize = True
BorderSpacing.Left = 2 BorderSpacing.Left = 2
BorderSpacing.Around = 4 BorderSpacing.Around = 4
Flat = True
OnClick = btnAcceptClick OnClick = btnAcceptClick
end end
end end
end end
inherited toolbar: TCEToolBar inherited toolbar: TCEToolBar
Width = 567 Width = 629
end end
end end
inherited contextMenu: TPopupMenu inherited contextMenu: TPopupMenu

View File

@ -76,8 +76,6 @@ begin
inspector.DefaultItemHeight := scaleY(22, 96); inspector.DefaultItemHeight := scaleY(22, 96);
selCat.Width := ScaleX(180, 96); selCat.Width := ScaleX(180, 96);
width := ScaleX(600, 96); width := ScaleX(600, 96);
inspector.SplitterX := inspector.width div 2 + ScaleX(20, 96);
inspector.PreferredSplitterX := inspector.SplitterX;
case GetIconScaledSize of case GetIconScaledSize of
iss16: iss16:
@ -110,7 +108,12 @@ end;
procedure TCEOptionEditorWidget.UpdateShowing; procedure TCEOptionEditorWidget.UpdateShowing;
begin begin
inherited; inherited;
if Visible then updateCategories; if Visible then
begin
updateCategories;
inspector.SplitterX := inspector.width div 2;
inspector.PreferredSplitterX := inspector.SplitterX;
end;
end; end;
{$ENDREGION} {$ENDREGION}

View File

@ -1,26 +1,28 @@
object CEShortcutEditor: TCEShortcutEditor object CEShortcutEditor: TCEShortcutEditor
Left = 0 Left = 0
Height = 432 Height = 449
Top = 0 Top = 0
Width = 424 Width = 424
ClientHeight = 432 AutoSize = True
ClientHeight = 449
ClientWidth = 424 ClientWidth = 424
TabOrder = 0 TabOrder = 0
DesignLeft = 1365 DesignLeft = 1365
DesignTop = 176 DesignTop = 176
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Height = 432 Height = 449
Top = 0 Top = 0
Width = 424 Width = 424
Align = alClient Align = alClient
AutoSize = True
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 432 ClientHeight = 449
ClientWidth = 424 ClientWidth = 424
TabOrder = 0 TabOrder = 0
object fltItems: TTreeFilterEdit object fltItems: TTreeFilterEdit
Left = 2 Left = 2
Height = 25 Height = 27
Top = 2 Top = 2
Width = 420 Width = 420
OnFilterItem = fltItemsFilterItem OnFilterItem = fltItemsFilterItem
@ -34,8 +36,8 @@ object CEShortcutEditor: TCEShortcutEditor
end end
object tree: TTreeView object tree: TTreeView
Left = 2 Left = 2
Height = 347 Height = 373
Top = 31 Top = 33
Width = 420 Width = 420
Align = alClient Align = alClient
AutoExpand = True AutoExpand = True
@ -51,19 +53,18 @@ object CEShortcutEditor: TCEShortcutEditor
end end
object Panel2: TPanel object Panel2: TPanel
Left = 2 Left = 2
Height = 50 Height = 39
Top = 380 Top = 408
Width = 420 Width = 420
Align = alBottom Align = alBottom
AutoSize = True
BorderSpacing.Around = 2 BorderSpacing.Around = 2
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 50 ClientHeight = 39
ClientWidth = 420 ClientWidth = 420
TabOrder = 2 TabOrder = 2
object btnClear: TSpeedButton object btnClear: TSpeedButton
Left = 2 Left = 2
Height = 46 Height = 35
Hint = 'clear shortcut' Hint = 'clear shortcut'
Top = 2 Top = 2
Width = 4 Width = 4
@ -75,7 +76,7 @@ object CEShortcutEditor: TCEShortcutEditor
end end
object propedit: TTIPropertyGrid object propedit: TTIPropertyGrid
Left = 14 Left = 14
Height = 50 Height = 39
Top = 0 Top = 0
Width = 406 Width = 406
Align = alClient Align = alClient
@ -85,11 +86,13 @@ object CEShortcutEditor: TCEShortcutEditor
Indent = 10 Indent = 10
NameFont.Color = clWindowText NameFont.Color = clWindowText
OnModified = propeditModified OnModified = propeditModified
PreferredSplitterX = 200
SplitterX = 200
ValueFont.Color = clMaroon ValueFont.Color = clMaroon
end end
object btnEdit: TSpeedButton object btnEdit: TSpeedButton
Left = 8 Left = 8
Height = 46 Height = 35
Hint = 'edit selected shortcut' Hint = 'edit selected shortcut'
Top = 2 Top = 2
Width = 4 Width = 4

View File

@ -76,7 +76,9 @@ type
fBackup: TShortCutCollection; fBackup: TShortCutCollection;
fHasChanged: boolean; fHasChanged: boolean;
propvalue: TEditableShortcut; propvalue: TEditableShortcut;
fHasScaled: boolean;
// //
procedure updateScaling;
function optionedWantCategory(): string; function optionedWantCategory(): string;
function optionedWantEditorKind: TOptionEditorKind; function optionedWantEditorKind: TOptionEditorKind;
function optionedWantContainer: TPersistent; function optionedWantContainer: TPersistent;
@ -185,12 +187,9 @@ begin
fObservers := TCEEditableShortCutSubject.create; fObservers := TCEEditableShortCutSubject.create;
fShortcuts := TShortCutCollection.create(self); fShortcuts := TShortCutCollection.create(self);
fBackup := TShortCutCollection.create(self); fBackup := TShortCutCollection.create(self);
AssignPng(btnClear, 'CLEAN');
AssignPng(btnEdit, 'KEYBOARD_PENCIL');
EntitiesConnector.addObserver(self); EntitiesConnector.addObserver(self);
propedit.TIObject := propvalue; propedit.TIObject := propvalue;
propedit.PropertyEditorHook.AddHandlerModified(@propeditModified); propedit.PropertyEditorHook.AddHandlerModified(@propeditModified);
propedit.DefaultItemHeight:= scaleY(22, 96);
end; end;
destructor TCEShortcutEditor.destroy; destructor TCEShortcutEditor.destroy;
@ -200,6 +199,36 @@ begin
inherited; inherited;
end; end;
procedure TCEShortcutEditor.updateScaling;
begin
if fHasScaled then
exit;
fHasScaled := true;
case GetIconScaledSize of
iss16:
begin
AssignPng(btnClear, 'CLEAN');
AssignPng(btnEdit, 'SHORTCUTS');
AssignPng(fltItems.Glyph, 'FILTER_CLEAR')
end;
iss24:
begin
AssignPng(btnClear, 'CLEAN24');
AssignPng(btnEdit, 'SHORTCUTS24');
AssignPng(fltItems.Glyph, 'FILTER_CLEAR24')
end;
iss32:
begin
AssignPng(btnClear, 'CLEAN32');
AssignPng(btnEdit, 'SHORTCUTS32');
AssignPng(fltItems.Glyph, 'FILTER_CLEAR32')
end;
end;
panel2.Height:=scaleY(30, 96);
propedit.DefaultItemHeight:= scaleY(26, 96);
propedit.BuildPropertyList();
end;
function TCEShortcutEditor.anItemIsSelected: boolean; function TCEShortcutEditor.anItemIsSelected: boolean;
begin begin
result := true; result := true;
@ -221,6 +250,7 @@ end;
function TCEShortcutEditor.optionedWantContainer: TPersistent; function TCEShortcutEditor.optionedWantContainer: TPersistent;
begin begin
updateScaling;
receiveShortcuts; receiveShortcuts;
exit(self); exit(self);
end; end;