Option button text align?

If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.

Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.

Moderator: Klaus

Post Reply
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Option button text align?

Post by bogs »

While I was playing with buttons today, I noticed something a bit 'quirky' about the option button text.

By default, the text is aligned centered (theoretically) on the button, however, if you choose the align right instead, the text actually moves left about a space. This only happens if you leave the button at its default size or smaller, and apparently goes all the way back to version 3 of the IDE. Rev 2.2.1 notably does not do this, but 3.x through 8.1.2 do.

Pics from 8.1.2 -
Text align center...
Text align center...
Text align right...
Text align right...
I am guessing it has something to do with the margin and how Lc determines boundaries on the buttons label, since if you increase the width of the button it works correctly, but should this be reported as a bug and fixed? Obviously it isn't difficult to work around, but I can't imagine too many people want to make their buttons wider than they have to.
Image
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Option button text align?

Post by dunbarx »

Bogs.

I don't see this in v.8.10.

The text "centers" itself (quotes because the "center" is exclusive of the tiny arrows) or aligns itself in a normal manner. The margins seem to work as they should.

Craig
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Option button text align?

Post by jmburnod »

Hi bogs,
Works as expected for me (OSX 10.13 LC 9.0.1
best
Jean-Marc
https://alternatic.ch
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Option button text align?

Post by bogs »

Well, what I am seeing looks like "center" doesn't take the | and arrows into account, but when you "align right", those features of the button are taken into account (to different degrees) in the different versions, except 2.x which appears to take the end design of the button into account for all alignments.

I believe the margins are working as they should be, as far as what they do, but I think they are based on 2 different points of this particular button, which is why "right" align pushes the text to the left, if you see what I mean. The pictures in the first post are from 8.1.2, the last version I can get to run (somewhat) reliably on this system.

This is how it aligns in 2.x -
Align center...
Align center...
Selection_001.png (11.66 KiB) Viewed 4694 times
Align right...
Align right...
Of course, I am seeing this on 'nix, I'll go test on Windows and see if it is the same or no.

Thank you for testing it out on Mac, Jean-Marc :D

*Edit - On Windows 7 the align works as I would think it should no matter the size of the button, so I am beginning to think this is a 'nix only issue :roll:
Image
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Option button text align?

Post by bogs »

So, after 3 hours of playing with this across 3 OSes, it appears this is a 'nix only issue. Since it only happens on 'nix, I'm thinking bug.

*Edit - I've been going through the bug db, so far the two closest reports I have found are
5782 CONFIRMED --- Option menu buttons under GNOME don't look and behave as ... 2016-07-12
for 'nix and
Bug 11415 - Incorrect text alignment in buttons
for Mac. Of the two, the mac one is closer to the actual issue, so even though it has been resolved on Mac, I'll tack this onto the end of it.
Image
Post Reply