Copy link to clipboard
Copied
In a custom section of the plug-in manager I want to center a logo.
I tried several things, but nothing works. Seems that most layout properties work on the text controls.
Any suggestions?
I've always found layout of controls fussy. To center a picture or any other control, I generally use this idiom:
f:row {fill_horizontal = 1,
f:spacer {fill_horizontal = 1},
f:picture {...},
f:spacer {fill_horizontal = 1}}
The row will expand to fill the width of its container, and the two spacers will then expand equally in that width. You can omit the row if the container has a width determined by its other contents.
To left-justify the control, omit the second spacer, and to right-j
...Copy link to clipboard
Copied
I've always found layout of controls fussy. To center a picture or any other control, I generally use this idiom:
f:row {fill_horizontal = 1,
f:spacer {fill_horizontal = 1},
f:picture {...},
f:spacer {fill_horizontal = 1}}
The row will expand to fill the width of its container, and the two spacers will then expand equally in that width. You can omit the row if the container has a width determined by its other contents.
To left-justify the control, omit the second spacer, and to right-justify it, omit the first spacer.
Copy link to clipboard
Copied
John, you are a hero!
Smart solution. Works great.