Skip to content

Commit dbca69d

Browse files
committed
feat: full support for different icon packs, Silk and Icons8
1 parent 769afa5 commit dbca69d

30 files changed

+40234
-40006
lines changed

source/about.lfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ object AboutBox: TAboutBox
397397
OnClick = lnklblWebpageClick
398398
end
399399
object popupLabels: TPopupMenu
400-
Images = MainForm.ImageListIcons8
400+
Images = MainForm.ImageListMain
401401
Left = 40
402402
Top = 180
403403
object menuCopyLabel: TMenuItem

source/apphelpers.pas

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ TAppSettings = class(TObject)
435435
function GetCommandLine: String;
436436
// This returns a stable, lowercase name "heidisql", used for configuration files and translations
437437
function GetApplicationName: String;
438+
procedure CopyImageList(SourceList, TargetList: TImageList);
438439

439440
var
440441
AppSettings: TAppSettings;
@@ -1903,7 +1904,7 @@ procedure TDBObjectEditor.Init(Obj: TDBObject);
19031904
Continue;
19041905

19051906
popup := TPopupMenu.Create(Self);
1906-
popup.Images := MainForm.VirtualImageListMain;
1907+
popup.Images := MainForm.ImageListMain;
19071908

19081909
Item := TMenuItem.Create(popup);
19091910
Item.Action := MainForm.actCopy;
@@ -3126,6 +3127,32 @@ function GetApplicationName: String;
31263127
Result := LowerCase(APPNAME);
31273128
end;
31283129

3130+
procedure CopyImageList(SourceList, TargetList: TImageList);
3131+
var
3132+
i, j, ResIdx, ResWidth: Integer;
3133+
TempBitmap: TBitmap;
3134+
TempBitmapList: Array of TRasterImage;
3135+
const
3136+
Resolutions: Array of Integer = [16, 24, 32, 48];
3137+
begin
3138+
// TImageList.AddImages copies only the current PPI versions of images. Following code copies all resolutions.
3139+
TargetList.Clear;
3140+
TargetList.RegisterResolutions(Resolutions);
3141+
for i:=0 to SourceList.Count-1 do
3142+
begin
3143+
SetLength(TempBitmapList, 0);
3144+
SetLength(TempBitmapList, Length(Resolutions));
3145+
for ResIdx:=Low(Resolutions) to High(Resolutions) do begin
3146+
ResWidth := Resolutions[ResIdx];
3147+
TempBitmap := TBitmap.Create;
3148+
SourceList.Resolution[ResWidth].GetBitmap(i, TempBitmap);
3149+
TempBitmapList[ResIdx] := TempBitmap;
3150+
end;
3151+
TargetList.AddMultipleResolutions(TempBitmapList);
3152+
end;
3153+
end;
3154+
3155+
31293156
{ Threading stuff }
31303157

31313158
constructor TQueryThread.Create(Connection: TDBConnection; Batch: TSQLBatch; TabNumber: Integer);

source/bineditor.lfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ object frmBinEditor: TfrmBinEditor
6363
Anchors = [akLeft, akBottom]
6464
BorderSpacing.Around = 6
6565
Caption = 'tlbStandard'
66-
Images = MainForm.ImageListIcons8
66+
Images = MainForm.ImageListMain
6767
ParentShowHint = False
6868
ShowHint = True
6969
TabOrder = 1

source/change_password.lfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ object frmPasswordChange: TfrmPasswordChange
121121
Anchors = [akRight, akBottom]
122122
Caption = 'Copy'
123123
ImageIndex = 3
124-
Images = MainForm.ImageListIcons8
124+
Images = MainForm.ImageListMain
125125
OnClick = btnCopyToClipboardClick
126126
end
127127
object progressbarPasswordStrength: TProgressBar

source/column_selection.lfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ object frmColumnSelection: TfrmColumnSelection
8888
Anchors = [akTop, akLeft, akRight]
8989
BorderSpacing.Around = 6
9090
ButtonWidth = 29
91-
Images = MainForm.ImageListIcons8
91+
Images = MainForm.ImageListMain
9292
ImageIndex = 146
9393
MaxLength = 0
9494
NumGlyphs = 1

source/connections.lfm

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ object connform: Tconnform
1313
Constraints.MinWidth = 550
1414
DesignTimePPI = 120
1515
ShowHint = True
16+
LCLVersion = '4.2.0.0'
1617
OnClose = FormClose
1718
OnCloseQuery = FormCloseQuery
1819
OnCreate = FormCreate
@@ -34,7 +35,7 @@ object connform: Tconnform
3435
Width = 656
3536
ActivePage = tabSettings
3637
Align = alClient
37-
Images = MainForm.ImageListIcons8
38+
Images = MainForm.ImageListMain
3839
TabIndex = 1
3940
TabOrder = 1
4041
OnChange = PageControlDetailsChange
@@ -60,7 +61,7 @@ object connform: Tconnform
6061
Width = 597
6162
Anchors = [akTop, akLeft, akRight]
6263
Caption = 'Import settings ...'
63-
Images = MainForm.ImageListIcons8
64+
Images = MainForm.ImageListMain
6465
ImageIndex = 101
6566
OnClick = btnImportSettingsClick
6667
end
@@ -204,7 +205,7 @@ object connform: Tconnform
204205
Anchors = [akTop, akLeft, akRight]
205206
BorderSpacing.Around = 6
206207
ButtonWidth = 29
207-
Images = MainForm.ImageListIcons8
208+
Images = MainForm.ImageListMain
208209
ImageIndex = 75
209210
MaxLength = 0
210211
NumGlyphs = 1
@@ -225,7 +226,7 @@ object connform: Tconnform
225226
Anchors = [akTop, akLeft, akRight]
226227
BorderSpacing.Around = 6
227228
ButtonWidth = 29
228-
Images = MainForm.ImageListIcons8
229+
Images = MainForm.ImageListMain
229230
ImageIndex = 75
230231
MaxLength = 0
231232
NumGlyphs = 1
@@ -246,7 +247,7 @@ object connform: Tconnform
246247
Anchors = [akTop, akLeft, akRight]
247248
BorderSpacing.Around = 6
248249
DropDownCount = 12
249-
Images = MainForm.ImageListIcons8
250+
Images = MainForm.ImageListMain
250251
ItemHeight = 20
251252
ItemsEx = <>
252253
Style = csExDropDownList
@@ -303,7 +304,7 @@ object connform: Tconnform
303304
Anchors = [akTop, akLeft, akRight]
304305
BorderSpacing.Around = 6
305306
ButtonWidth = 29
306-
Images = MainForm.ImageListIcons8
307+
Images = MainForm.ImageListMain
307308
ImageIndex = 75
308309
MaxLength = 0
309310
NumGlyphs = 1
@@ -492,7 +493,7 @@ object connform: Tconnform
492493
Anchors = [akTop, akLeft, akRight]
493494
BorderSpacing.Around = 6
494495
ButtonWidth = 29
495-
Images = MainForm.ImageListIcons8
496+
Images = MainForm.ImageListMain
496497
ImageIndex = 51
497498
MaxLength = 0
498499
NumGlyphs = 1
@@ -659,7 +660,7 @@ object connform: Tconnform
659660
Anchors = [akTop, akLeft, akRight]
660661
BorderSpacing.Around = 6
661662
ButtonWidth = 29
662-
Images = MainForm.ImageListIcons8
663+
Images = MainForm.ImageListMain
663664
ImageIndex = 51
664665
MaxLength = 0
665666
NumGlyphs = 1
@@ -765,7 +766,7 @@ object connform: Tconnform
765766
BorderSpacing.Around = 6
766767
ButtonWidth = 29
767768
Enabled = False
768-
Images = MainForm.ImageListIcons8
769+
Images = MainForm.ImageListMain
769770
ImageIndex = 51
770771
MaxLength = 0
771772
NumGlyphs = 1
@@ -882,7 +883,7 @@ object connform: Tconnform
882883
Anchors = [akTop, akLeft, akRight]
883884
BorderSpacing.Around = 6
884885
ButtonWidth = 29
885-
Images = MainForm.ImageListIcons8
886+
Images = MainForm.ImageListMain
886887
ImageIndex = 51
887888
MaxLength = 0
888889
NumGlyphs = 1
@@ -904,7 +905,7 @@ object connform: Tconnform
904905
Anchors = [akTop, akLeft, akRight]
905906
BorderSpacing.Around = 6
906907
ButtonWidth = 29
907-
Images = MainForm.ImageListIcons8
908+
Images = MainForm.ImageListMain
908909
ImageIndex = 51
909910
MaxLength = 0
910911
NumGlyphs = 1
@@ -926,7 +927,7 @@ object connform: Tconnform
926927
Anchors = [akTop, akLeft, akRight]
927928
BorderSpacing.Around = 6
928929
ButtonWidth = 29
929-
Images = MainForm.ImageListIcons8
930+
Images = MainForm.ImageListMain
930931
ImageIndex = 51
931932
MaxLength = 0
932933
NumGlyphs = 1
@@ -1106,7 +1107,7 @@ object connform: Tconnform
11061107
Header.PopupMenu = MainForm.popupListHeader
11071108
Header.SortColumn = 0
11081109
HintMode = hmTooltip
1109-
Images = MainForm.ImageListIcons8
1110+
Images = MainForm.ImageListMain
11101111
IncrementalSearch = isAll
11111112
PopupMenu = popupSessions
11121113
TabOrder = 0
@@ -1134,7 +1135,7 @@ object connform: Tconnform
11341135
Align = alTop
11351136
BorderSpacing.Bottom = 6
11361137
ButtonWidth = 29
1137-
Images = MainForm.ImageListIcons8
1138+
Images = MainForm.ImageListMain
11381139
ImageIndex = 193
11391140
MaxLength = 0
11401141
NumGlyphs = 1
@@ -1162,7 +1163,7 @@ object connform: Tconnform
11621163
Top = 8
11631164
Width = 62
11641165
Caption = 'Save'
1165-
Images = MainForm.ImageListIcons8
1166+
Images = MainForm.ImageListMain
11661167
ImageIndex = 10
11671168
OnClick = btnSaveClick
11681169
end
@@ -1195,7 +1196,7 @@ object connform: Tconnform
11951196
Top = 8
11961197
Width = 62
11971198
Caption = 'New'
1198-
Images = MainForm.ImageListIcons8
1199+
Images = MainForm.ImageListMain
11991200
ImageIndex = 45
12001201
OnClick = btnNewDropdown
12011202
end
@@ -1205,7 +1206,7 @@ object connform: Tconnform
12051206
Top = 8
12061207
Width = 62
12071208
Caption = 'Delete'
1208-
Images = MainForm.ImageListIcons8
1209+
Images = MainForm.ImageListMain
12091210
ImageIndex = 46
12101211
OnClick = btnDeleteClick
12111212
end
@@ -1220,7 +1221,7 @@ object connform: Tconnform
12201221
end
12211222
end
12221223
object popupSessions: TPopupMenu
1223-
Images = MainForm.ImageListIcons8
1224+
Images = MainForm.ImageListMain
12241225
Left = 29
12251226
Top = 104
12261227
object menuRename: TMenuItem
@@ -1280,7 +1281,7 @@ object connform: Tconnform
12801281
Top = 44
12811282
end
12821283
object popupNew: TPopupMenu
1283-
Images = MainForm.ImageListIcons8
1284+
Images = MainForm.ImageListMain
12841285
Left = 136
12851286
Top = 103
12861287
object menuNewSessionInRoot: TMenuItem
@@ -1305,7 +1306,7 @@ object connform: Tconnform
13051306
end
13061307
end
13071308
object popupMore: TPopupMenu
1308-
Images = MainForm.ImageListIcons8
1309+
Images = MainForm.ImageListMain
13091310
Left = 30
13101311
Top = 180
13111312
object Preferences1: TMenuItem
@@ -1335,7 +1336,7 @@ object connform: Tconnform
13351336
Top = 180
13361337
end
13371338
object popupHost: TPopupMenu
1338-
Images = MainForm.ImageListIcons8
1339+
Images = MainForm.ImageListMain
13391340
Left = 30
13401341
Top = 260
13411342
object menuFindDatabaseFiles: TMenuItem
@@ -1350,7 +1351,7 @@ object connform: Tconnform
13501351
end
13511352
end
13521353
object ActionListConnections: TActionList
1353-
Images = MainForm.ImageListIcons8
1354+
Images = MainForm.ImageListMain
13541355
Left = 140
13551356
Top = 260
13561357
object actFilter: TAction

source/copytable.lfm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ object CopyTableForm: TCopyTableForm
102102
Header.AutoSizeIndex = 0
103103
Header.Columns = <>
104104
Header.MainColumn = -1
105-
Images = MainForm.ImageListIcons8
105+
Images = MainForm.ImageListMain
106106
TabOrder = 2
107107
TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScroll, toAutoScrollOnExpand, toAutoTristateTracking, toAutoDeleteMovedNodes, toAutoChangeScale]
108108
TreeOptions.MiscOptions = [toAcceptOLEDrop, toCheckSupport, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning, toEditOnClick]
@@ -206,7 +206,7 @@ object CopyTableForm: TCopyTableForm
206206
Anchors = [akRight, akBottom]
207207
BorderSpacing.Around = 6
208208
Caption = 'Recent filters'
209-
Images = MainForm.ImageListIcons8
209+
Images = MainForm.ImageListMain
210210
ImageIndex = 108
211211
OnClick = btnRecentFiltersClick
212212
end

source/customize_highlighter.lfm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ object frmCustomizeHighlighter: TfrmCustomizeHighlighter
133133
BorderSpacing.Around = 6
134134
ButtonHint = 'Color picker'
135135
ButtonWidth = 29
136-
Images = MainForm.ImageListIcons8
136+
Images = MainForm.ImageListMain
137137
ImageIndex = 33
138138
MaxLength = 0
139139
NumGlyphs = 1
@@ -153,7 +153,7 @@ object frmCustomizeHighlighter: TfrmCustomizeHighlighter
153153
BorderSpacing.Around = 6
154154
ButtonHint = 'Color picker'
155155
ButtonWidth = 29
156-
Images = MainForm.ImageListIcons8
156+
Images = MainForm.ImageListMain
157157
ImageIndex = 33
158158
MaxLength = 0
159159
NumGlyphs = 1

source/data_sorting.lfm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ object frmDataSorting: TfrmDataSorting
99
ClientWidth = 255
1010
Color = clBtnFace
1111
DesignTimePPI = 120
12+
LCLVersion = '4.2.0.0'
1213
OnClose = FormClose
1314
OnCreate = FormCreate
1415
OnDeactivate = FormDeactivate
15-
LCLVersion = '3.8.0.0'
1616
object pnlBevel: TPanel
1717
Left = 0
1818
Height = 121
@@ -66,7 +66,7 @@ object frmDataSorting: TfrmDataSorting
6666
Width = 156
6767
Action = MainForm.actDataResetSorting
6868
Anchors = [akRight, akBottom]
69-
Images = MainForm.ImageListIcons8
69+
Images = MainForm.ImageListMain
7070
ImageIndex = 139
7171
end
7272
end

0 commit comments

Comments
 (0)