mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-28 03:02:37 +02:00
IDE: load High-DPI images
This commit is contained in:
parent
560b8bb852
commit
da539c7b9c
@ -94,7 +94,7 @@ begin
|
||||
BtnPanel.CancelButton.Caption := oisCancel;
|
||||
BtnPanel.HelpButton.Caption := cActionListEditorHelpCategory;
|
||||
BtnPanel.CloseButton.Kind := bkCustom;
|
||||
BtnPanel.CloseButton.LoadGlyphFromStock(idButtonYes);
|
||||
BtnPanel.CloseButton.LoadGlyphFromResource(idButtonYes);
|
||||
BtnPanel.CloseButton.Caption := sccsTrEdtApply;
|
||||
BtnPanel.CloseButton.OnClick := @ApplyCheck;
|
||||
|
||||
|
@ -1051,9 +1051,7 @@ begin
|
||||
CompileAdvancedButton.Caption := lisLazBuildBuildMany;
|
||||
IDEImages.AssignImage(CompileAdvancedButton, 'menu_build_all');
|
||||
SaveSettingsButton.Caption := lisSaveSettings;
|
||||
SaveSettingsButton.LoadGlyphFromStock(idButtonSave);
|
||||
if SaveSettingsButton.Glyph.Empty then
|
||||
IDEImages.AssignImage(SaveSettingsButton, 'laz_save');
|
||||
IDEImages.AssignImage(SaveSettingsButton, 'laz_save');
|
||||
CancelButton.Caption := lisCancel;
|
||||
HelpButton.Caption := lisMenuHelp;
|
||||
|
||||
|
@ -393,9 +393,9 @@ begin
|
||||
ExportAction.Caption := lisExportSelected;
|
||||
ExportAllAction.Caption := lisExportAll;
|
||||
ImportAction.Hint := lisImport;
|
||||
ExportBitBtn.LoadGlyphFromStock(idButtonSave);
|
||||
IDEImages.AssignImage(ExportBitBtn, 'laz_save');
|
||||
ExportBitBtn.Caption := lisExportSub;
|
||||
ImportBitBtn.LoadGlyphFromStock(idButtonOpen);
|
||||
IDEImages.AssignImage(ImportBitBtn, 'laz_open');
|
||||
ImportBitBtn.Caption := lisImport;
|
||||
|
||||
ButtonPanel1.HelpButton.TabOrder := 0;
|
||||
|
@ -359,9 +359,7 @@ begin
|
||||
OpenInEditorButton.Caption:=lisDiffDlgOpenDiffInEditor;
|
||||
HelpButton.Caption:=lisMenuHelp;
|
||||
|
||||
OpenInEditorButton.LoadGlyphFromStock(idButtonOpen);
|
||||
if OpenInEditorButton.Glyph.Empty then
|
||||
IDEImages.AssignImage(OpenInEditorButton, 'laz_open');
|
||||
IDEImages.AssignImage(OpenInEditorButton, 'laz_open');
|
||||
|
||||
// dialogs
|
||||
dlgOpen.Title:=lisOpenExistingFile;
|
||||
|
@ -239,7 +239,7 @@ begin
|
||||
IDEImages.AssignImage(RemoveBtn, 'laz_delete');
|
||||
ButtonPanel1.CloseButton.Caption := lisSave;
|
||||
ButtonPanel1.OKButton.Caption := lisOk;
|
||||
//ButtonPanel1.CloseButton.LoadGlyphFromStock(idButtonSave);
|
||||
//ButtonPanel1.CloseButton.LoadGlyphFromResource(idButtonSave);
|
||||
//if btnSave.Glyph.Empty then
|
||||
// btnSave.LoadGlyphFromResourceName(HInstance, 'laz_save');
|
||||
try
|
||||
|
@ -642,7 +642,7 @@ begin
|
||||
btnCheck := CreateButton(lisCompTest);
|
||||
btnCheck.ModalResult := mrNone;
|
||||
btnCheck.OnClick := @DoCheck;
|
||||
btnCheck.LoadGlyphFromStock(idButtonYes);
|
||||
btnCheck.LoadGlyphFromResource(idButtonYes);
|
||||
|
||||
ADialog.AddButtonSeparator;
|
||||
|
||||
@ -650,14 +650,12 @@ begin
|
||||
btnExport := CreateButton(lisExport);
|
||||
btnExport.OnClick := @DoExport;
|
||||
btnExport.Hint := dlgCOLoadSaveHint;
|
||||
btnExport.LoadGlyphFromStock(idButtonSave);
|
||||
IDEImages.AssignImage(btnExport, 'laz_save');
|
||||
// Import
|
||||
btnLoadSave := CreateButton(lisImport);
|
||||
btnLoadSave.OnClick := @DoImport;
|
||||
btnLoadSave.Hint := dlgCOLoadSaveHint;
|
||||
btnLoadSave.LoadGlyphFromStock(idButtonOpen);
|
||||
if btnLoadSave.Glyph.Empty then
|
||||
IDEImages.AssignImage(btnLoadSave, 'laz_save');
|
||||
IDEImages.AssignImage(btnLoadSave, 'laz_save');
|
||||
|
||||
ADialog.AddButtonSeparator;
|
||||
|
||||
|
@ -294,13 +294,10 @@ begin
|
||||
DefaultIconButton.Caption := dlgPODefaultIcon;
|
||||
SaveIconButton.Caption := dlgPOSaveIcon;
|
||||
ClearIconButton.Caption := dlgPOClearIcon;
|
||||
LoadIconButton.LoadGlyphFromStock(idButtonOpen);
|
||||
if LoadIconButton.Glyph.Empty then
|
||||
IDEImages.AssignImage(LoadIconButton, 'laz_open');
|
||||
IDEImages.AssignImage(LoadIconButton, 'laz_open');
|
||||
SaveIconButton.LoadGlyphFromStock(idButtonSave);
|
||||
IDEImages.AssignImage(DefaultIconButton, 'restore_default');
|
||||
if SaveIconButton.Glyph.Empty then
|
||||
IDEImages.AssignImage(SaveIconButton, 'laz_save');
|
||||
IDEImages.AssignImage(SaveIconButton, 'laz_save');
|
||||
IDEImages.AssignImage(ClearIconButton, 'menu_clean');
|
||||
IconImage.KeepOriginXWhenClipped := True;
|
||||
IconImage.KeepOriginYWhenClipped := True;
|
||||
|
@ -291,9 +291,7 @@ begin
|
||||
|
||||
with ButtonPanel1 do begin
|
||||
OKButton.Caption:=lisIECOLoadFromFile;
|
||||
OKButton.LoadGlyphFromStock(idButtonOpen);
|
||||
if OKButton.Glyph.Empty then
|
||||
IDEImages.AssignImage(OKButton, 'laz_open');
|
||||
IDEImages.AssignImage(OKButton, 'laz_open');
|
||||
OKButton.Enabled:=False;
|
||||
OKButton.OnClick:=@OpenButtonCLICK;
|
||||
end;
|
||||
@ -312,9 +310,7 @@ begin
|
||||
ExportRadioGroup.Enabled:=False;
|
||||
with ButtonPanel1 do begin
|
||||
OKButton.Caption:=lisIECOSaveToFile;
|
||||
OKButton.LoadGlyphFromStock(idButtonSave);
|
||||
if OKButton.Glyph.Empty then
|
||||
IDEImages.AssignImage(OKButton, 'laz_save');
|
||||
IDEImages.AssignImage(OKButton, 'laz_save');
|
||||
OKButton.Enabled:=False;
|
||||
OKButton.OnClick:=@SaveButtonCLICK;
|
||||
end;
|
||||
|
@ -56,6 +56,8 @@ type
|
||||
bsHot // button is under mouse
|
||||
);
|
||||
|
||||
TButtonImage = idButtonOk..idButtonNoToAll;
|
||||
|
||||
{
|
||||
TNumGlyphs holds the number of glyphs in an image.
|
||||
If we change this the code in SetNumGlyphs for @link(TCustomSpeedButton)
|
||||
@ -207,7 +209,8 @@ type
|
||||
procedure Click; override;
|
||||
procedure LoadGlyphFromResourceName(Instance: THandle; const AName: String);
|
||||
procedure LoadGlyphFromLazarusResource(const AName: String);
|
||||
procedure LoadGlyphFromStock(idButton: Integer);
|
||||
procedure LoadGlyphFromStock(idButton: Integer); // not DPI-aware, uses widgetset themed icons if available
|
||||
procedure LoadGlyphFromResource(idButton: TButtonImage); // DPI-aware
|
||||
function CanShowGlyph(const AWithShowMode: Boolean = False): Boolean;
|
||||
public
|
||||
property Caption stored IsCaptionStored;
|
||||
@ -511,7 +514,6 @@ type
|
||||
}
|
||||
type
|
||||
TGetDefaultBitBtnGlyph = function(Kind: TBitBtnKind; var Handled: Boolean): TBitmap;
|
||||
TButtonImage = idButtonOk..idButtonNoToAll;
|
||||
var
|
||||
GetDefaultBitBtnGlyph: TGetDefaultBitBtnGlyph = nil;
|
||||
|
||||
|
@ -77,6 +77,11 @@ begin
|
||||
Buttons.LoadGlyphFromLazarusResource(FButtonGlyph, AName);
|
||||
end;
|
||||
|
||||
procedure TCustomBitBtn.LoadGlyphFromResource(idButton: TButtonImage);
|
||||
begin
|
||||
Buttons.LoadGlyphFromResource(FButtonGlyph, idButton);
|
||||
end;
|
||||
|
||||
procedure TCustomBitBtn.LoadGlyphFromStock(idButton: Integer);
|
||||
begin
|
||||
Buttons.LoadGlyphFromStock(FButtonGlyph, idButton);
|
||||
|
Loading…
Reference in New Issue
Block a user