Skip to main content
Inspiring
April 16, 2022
Answered

SDK center image (logo) in the custom sections to the Plug-in Manager

  • April 16, 2022
  • 1 reply
  • 293 views

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?

This topic has been closed for replies.
Correct answer johnrellis

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.

1 reply

johnrellis
johnrellisCorrect answer
Legend
April 16, 2022

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.

Inspiring
April 16, 2022

John, you are a hero!

 

Smart solution. Works great.