MUI: Header Image behind text
When I use a custom MUI_HEADERIMAGE, why are there no option to put it behind the text instead of aside?
How can I change this?
Archive: MUI: Header Image behind text
MUI: Header Image behind text
When I use a custom MUI_HEADERIMAGE, why are there no option to put it behind the text instead of aside?
How can I change this?
Because MUI is an 'installer style' with customizations, rather than a template. You could either reshack the modern ui file, or you can achieve what you want by moving the image around yourself:
!addplugindir "."
!addincludedir "."
!include "nsDialogs.nsh"
!include "winmessages.nsh"
!include "logiclib.nsh"
!include "MUI2.nsh"
!define MUI_HEADERIMAGE
; This is an image that measure 497x57 pixels here.
!define MUI_HEADERIMAGE_BITMAP "gradient.bmp"
!define MUI_HEADERIMAGE_RIGHT
; Make sure the text has a transparent background
!define MUI_HEADER_TRANSPARENT_TEXT
OutFile "test.exe"
Page Custom test
Function test
!insertmacro MUI_HEADER_TEXT "Title text" "Subtitle text"
nsDialogs::Create 1018
Pop $0
GetDlgItem $0 $HWNDPARENT 0x416 ; Header image
GetDlgItem $1 $HWNDPARENT 0x40A ; Header
; Move the header image to the top-left corner and behind the text (just above the header window itself)
System::Call "User32::SetWindowPos(i, i, i, i, i, i, i) b ($0, $1, 0, 0, 497, 57, 0)" ; hwnd hwndafterZdepth x y w h flags
nsDialogs::Show
FunctionEnd
Section ""
SectionEnd
!insertmacro MUI_LANGUAGE "English"
Aww that's pretty sexy :) I take it theres no way to make it top-right, except for calculating how wide the window are... I'm thinking something would look weird if a user has a non-default dpi setting?
I looked a bit in the MUI .nsh-files, but had to give it... Can I put the code inside the function (except of course the macro) into one of the .nsh-files, to make it permanent?
...or how do I include it, if I don't create a custom page?
Can you explain what you mean by "make it top-right"?
The window's size can be retrieved using a similar System plugin call (GetWindowRect, I suppose).
Can deal with a header/something later, for now you can just stick those 3 pertinent lines anywhere in your code; .onGuiInit (see the MUI notes on setting a custom GUI INIT function) would be appropriate.