-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Branch: FormBackgroundStyleHook #570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
martijnlaan
wants to merge
86
commits into
main
Choose a base branch
from
FormBackgroundStyleHook
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
86 commits
Select commit
Hold shift + click to select a range
728b580
Add test style hook for custom backgrounds.
martijnlaan 70a3520
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 5227c55
Make the hook use TBitmapImageImplementation so it can paint images a…
martijnlaan fff9135
Add missing ParentBackground properties.
martijnlaan 58f0284
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 5eb30ab
Improve hook + make it support Setup.
martijnlaan fbe2cc6
Add WizardBackColor and WizardBackColorDynamicDark directives.
martijnlaan e15344e
Improve hook to not keep a reference but make a temporary copy instead.
martijnlaan cae60fc
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 13b1242
Add support for empty bitmaps.
martijnlaan 46b819d
Add support for not having wizard images. Does not change layout.
martijnlaan 4096d37
Cleanup.
martijnlaan 569e84f
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 75bd74c
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 1b07cd5
Enable unstyled light buttons when auto-using the windows11 style. (T…
martijnlaan 077d20e
Add WizardBackImage and WizardBackImageDynamicDark directives.
martijnlaan 0f7e98c
Fix for 46b819d6.
martijnlaan 31598ef
Adjust clWindow/clBtnFace also if only BackColor is used.
martijnlaan 225cda7
Automatically stop using built-in wizard images if a back image is sp…
martijnlaan b355bfd
Bevel tweaks.
martijnlaan 244dddc
Improve hook.
martijnlaan b46eee1
Add smart WizardBackColor(DynamicDark) defaults.
martijnlaan 3720a28
Cleanup.
martijnlaan 8b2ab69
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 9faad06
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 7b322f5
Add transparency support to TNewCheckListBox when it's styled and in …
martijnlaan bc962e6
Improve scroll handling.
martijnlaan 409407d
Whitespace / semicolon cleanup.
martijnlaan baf1000
Improve scroll handling some more.
martijnlaan 5b4443e
Fix warning.
martijnlaan 9c167b6
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 297c0a4
Implement opacity handling for back image.
martijnlaan c36442e
Improve smart defaults from b46eee19.
martijnlaan 10c97ff
Add separate WizardBackImageOpacity because sharing it with the regul…
martijnlaan d117466
Update more existing topics.
martijnlaan 44bac2d
Add WizardBackImageFile sizes. Rest of topic todo later.
martijnlaan 343772e
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 91f47f2
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 96c5907
Add documentation. Still have to double-check for typos and completen…
martijnlaan 9e1e2ad
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 9611501
Add more documentation + make clWindow as background color work better.
martijnlaan 1ecc166
Fix typo (there will probably be more).
martijnlaan 96efa2c
Add extra info.
martijnlaan 9efaf29
Mini cleanup.
martijnlaan b1951c8
Add comment.
martijnlaan 049e68a
Add WizardBackColor support to Uninstall. This requires a bump of Uni…
martijnlaan d5baa96
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 8a3ccf9
Fix BeveledLabel custom back color.
martijnlaan 5cdcf39
Clarify.
martijnlaan ee29143
Add extra info.
martijnlaan a674b48
Add example use cases.
martijnlaan d92ac33
Improve one of the examples.
martijnlaan 711b420
Fix dynamic WizardBackColor support for Uninstall.
martijnlaan 21a54e8
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 948850c
Update whatsnew + fix typo in help.
martijnlaan 958198e
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan ea8b93c
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 32c93bb
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 1777ff5
Update for new directives.
martijnlaan afe15e0
Changing UninstallLogID will prevent Setup from appending to an exist…
martijnlaan 1df6854
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 1637c90
Add workaround for clBack vs TUninstallLogHeader.
martijnlaan face993
Update for MainPanel's ParentBackground being dynamic now.
martijnlaan bb7effe
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 53230cd
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan d2debe3
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan c9e4e6e
Deal with clBack vs TUninstallLogHeader in the proper way.
martijnlaan da0b072
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 8c76bbb
Up to 1054 on branch. Can/should be reverted if there's no release be…
martijnlaan b0323e1
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan de1ee09
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan f9dc122
Update.
martijnlaan c53c066
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan a1121b0
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan a4dcbec
Allow [Code] to update or remove the wizard background image (but not…
martijnlaan 5c6c462
ROPS update for previous.
martijnlaan 3e59a9c
Add WizardSetBackImage documentation & examples + finishing touches.
martijnlaan 8c10e4c
Am I crazy or is WizardImageStretch=no help wrong? Unrelated to branc…
martijnlaan 487e955
Tweak.
martijnlaan 58a4c14
Whitespace.
martijnlaan 50fd30e
Clarify.
martijnlaan 6e42428
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan eebe7ab
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 084b526
Fix 6.6.1 release date
martijnlaan df006f0
Merge branch 'main' into FormBackgroundStyleHook
martijnlaan 9458262
VCL Styles has this 'CN_CTLCOLORMSGBOX..CN_CTLCOLORSTATIC' check ever…
martijnlaan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| unit FormBackgroundStyleHook; | ||
|
|
||
| { | ||
| Inno Setup | ||
| Copyright (C) 1997-2025 Jordan Russell | ||
| Portions by Martijn Laan | ||
| For conditions of distribution and use, see LICENSE.TXT. | ||
|
|
||
| Style hook for custom form backgrounds | ||
| } | ||
|
|
||
| interface | ||
|
|
||
| uses | ||
| Vcl.Forms, Vcl.Controls, Vcl.Graphics {$IFDEF VCLSTYLES}, BitmapImage {$ENDIF}; | ||
|
|
||
| type | ||
| TFormBackgroundStyleHook = class(TFormStyleHook) | ||
| {$IFDEF VCLSTYLES} | ||
| private | ||
| class constructor Create; | ||
| class destructor Destroy; | ||
| class var FBitmapImageImpl: TBitmapImageImplementation; | ||
| class var FBitmapImageImplInitialized: Boolean; | ||
| class var FGraphic: TGraphic; | ||
| {$ENDIF} | ||
| class var FBackColor: TColor; | ||
| class var FCenter: Boolean; | ||
| class var FGraphicTarget: TControl; | ||
| class var FOpacity: Byte; | ||
| class var FStretch: Boolean; | ||
| class procedure SetGraphic(Value: TGraphic); static; | ||
| {$IFDEF VCLSTYLES} | ||
| protected | ||
| procedure PaintBackground(Canvas: TCanvas); override; | ||
| {$ENDIF} | ||
| public | ||
| class property BackColor: TColor write FBackColor; | ||
| class property Center: Boolean write FCenter; | ||
| class property Graphic: TGraphic write SetGraphic; | ||
| class property GraphicTarget: TControl write FGraphicTarget; | ||
| class property Opacity: Byte write FOpacity; | ||
| class property Stretch: Boolean write FStretch; | ||
| end; | ||
|
|
||
| implementation | ||
|
|
||
| {$IFDEF VCLSTYLES} | ||
|
|
||
| uses | ||
| System.Classes, System.SysUtils; | ||
|
|
||
| { TFormBackgroundStyleHook } | ||
|
|
||
| class constructor TFormBackgroundStyleHook.Create; | ||
| begin | ||
| FBackColor := clNone; | ||
| end; | ||
|
|
||
| class destructor TFormBackgroundStyleHook.Destroy; | ||
| begin | ||
| if FBitmapImageImplInitialized then | ||
| FBitmapImageImpl.DeInit; | ||
| FGraphic.Free; | ||
| end; | ||
|
|
||
| procedure TFormBackgroundStyleHook.PaintBackground(Canvas: TCanvas); | ||
| begin | ||
| var R := Rect(0, 0, Control.ClientWidth, Control.ClientHeight); | ||
|
|
||
| if (FGraphicTarget = Control) and (FBitmapImageImplInitialized or (FGraphic <> nil)) then begin | ||
| if not FBitmapImageImplInitialized then begin | ||
| FBitmapImageImpl.Init(Control); | ||
| FBitmapImageImpl.SetGraphic(FGraphic); | ||
| FreeAndNil(FGraphic); | ||
| FBitmapImageImplInitialized := True; | ||
| end; | ||
| FBitmapImageImpl.BackColor := FBackColor; | ||
| FBitmapImageImpl.Center := FCenter; | ||
| FBitmapImageImpl.Opacity := FOpacity; | ||
| FBitmapImageImpl.Stretch := FStretch; | ||
| FBitmapImageImpl.Paint(Control, Canvas, R); | ||
| end else if (FBackColor <> clNone) and (FBackColor <> clWindow) then begin | ||
| Canvas.Brush.Color := TBitmapImageImplementation.AdjustColorForStyle(Control, FBackColor); | ||
| Canvas.FillRect(R); | ||
| end else | ||
| inherited; | ||
| end; | ||
|
|
||
| {$ENDIF} | ||
|
|
||
| class procedure TFormBackgroundStyleHook.SetGraphic(Value: TGraphic); | ||
| begin | ||
| {$IFDEF VCLSTYLES} | ||
| if FBitmapImageImplInitialized then begin | ||
| FBitmapImageImpl.DeInit; | ||
| FBitmapImageImplInitialized := False; | ||
| end; | ||
| if FGraphic <> nil then | ||
| FreeAndNil(FGraphic); | ||
| if Value <> nil then begin | ||
| FGraphic := TGraphicClass(Value.ClassType).Create; | ||
| FGraphic.Assign(Value); | ||
| end; | ||
| {$ENDIF} | ||
| end; | ||
|
|
||
| end. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.