Image and Caption distance in TsButton is too big

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #68915
    HeDiBo
    Participant

    In the attached project I was not able to reduce the distance between caption and image. Imagemargins are all 0. Manipulating the ContentMargin does not bring image and caption more together.
    Am I missing something?

    Attachments:
    You must be logged in to view attached files.
    #68920
    Stephane Senecal
    Participant

    I think you’ll have better control with a TsBitBtn

    Stephane Senecal
    CIS Group
    Delphi programmer since 2001

    #68921
    HeDiBo
    Participant

    <p zoompage-fontsize=”14″>I think you’ll have better control with a TsBitBtn

    Why should I use a different button?
    This worked before, but it’s hampered in AC 15.08 (the distance between image and caption has become larger).

    #68922
    Stephane Senecal
    Participant

    Just to be sure, is this what you have?

    Attachments:
    You must be logged in to view attached files.

    Stephane Senecal
    CIS Group
    Delphi programmer since 2001

    #68924
    Stephane Senecal
    Participant

    Please disregard my previous post. I had the wrong version of AlphaSkins.
    I can reproduce your issue. I will let AlphaSkins staff respond.

    Stephane Senecal
    CIS Group
    Delphi programmer since 2001

    #68926
    HeDiBo
    Participant

    It’s actually very nice you had this. This proves that a previous version of AC went OK.
    Thank you for your efforts.

    #68930
    HeDiBo
    Participant

    No change in 15.09

    #68939
    Stephane Senecal
    Participant

    I think I found the culprit if you can’t wait for a fix by AlphaSkins.

    In the sButton.pas unit, in the function CaptionRect(), at line 400, you can read the line “Result.Left := ImageMargins.Left + 2 * FContentMargin + ImgW + ContentSpacing(Self) + ImageMargins.Right;”

    If you remove the “2 * “, it seems to produce the correct result. It will keep 6px between the icon and the caption.
    If you don’t even want that spacing, remove “ContentSpacing(Self) + “.

    Stephane Senecal
    CIS Group
    Delphi programmer since 2001

    #68940
    HeDiBo
    Participant

    Thanks 🎈

    #68957
    Support
    Keymaster

    I will check and will change it soon. Thank you Stephane.

    #68967
    Support
    Keymaster

    The issue will be solved in the nearest release.
    Also, text position is depended from ImageMargins property, which may be changed in the Object Inspector (do not remove “ContentSpacing(Self)”).

    #68972
    HeDiBo
    Participant

    My ImageMargins have remained unchanged to all zeroes.

    #69006
    HeDiBo
    Participant

    In v15.10 all’s well again 🍰
    Please close this topic

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Image and Caption distance in TsButton is too big’ is closed to new replies.