Lazarus

Programming => LCL => Topic started by: d7_2_laz on March 05, 2021, 07:01:09 pm

Title: ATTabs little Q. caption innerspacing after text
Post by: d7_2_laz on March 05, 2021, 07:01:09 pm
Not an issue, minor cosmetics: actually i'm appending one or two spaces after the caption text for to have optically a bit more separation (spacing, padding) between (left:) caption text (full or truncated) and (right:) the tab right border resp. the close button,.if visible.
I'm wondering if there is some equivalent analoguos to OptSpaceBeforeText ("OptSpaceAfterText") one can use?
Title: Re: ATTabs little Q. caption innerspacing after text
Post by: Alextp on March 05, 2021, 07:59:10 pm
I dont remember. In such cases I search for OptSpace*** prop names and try to change em.
Title: Re: ATTabs little Q. caption innerspacing after text
Post by: d7_2_laz on March 05, 2021, 08:41:46 pm
Thre are a lot, i tried them and was wondering if i simply missed something special. - If you don't remember, don't care at all, it's too easy to bypass by appending space(s) to the text.
Title: Re: ATTabs little Q. caption innerspacing after text
Post by: Alextp on March 07, 2021, 10:31:46 am
It's easy to check:

- add tabs in form designer
- change props OptSpace* to 40 (big int)
Title: Re: ATTabs little Q. caption innerspacing after text
Post by: d7_2_laz on March 07, 2021, 01:26:17 pm
No sir, there are plenty of them (exactly 14 from OptSpace*) with plenty of functinality, but none does a generic padding after caption text, before either close button or right border appears.

Actually i use those (from code, not designer):
Code: Pascal  [Select][+][-]
  1. // OptSpaceSide,OptSpaceBetweenTabs,OptSpaceBetweenLines OptSpaceBetweenIconCaption
  2. // OptSpaceInitial OptSpaceBeforeText OptSpaceBeforeTextForMinWidth OptSpaceSeparator
  3. // OptSpacer OptSpacer2 OptSpaceXRight OptSpaceXInner OptSpaceXSize OptSpaceXIncrementRound
  4.  
  5.         OptSpaceSide:= 0;
  6.         OptSpaceBetweenTabs:= 1;
  7.         OptSpaceBeforeText := 6;
  8.         //OptSpaceAfterText := 6;   //  --- Such does not exist ---
  9.         OptSpaceBetweenIconCaption := 2;
  10.  
  11.         OptVarWidth := True;  // I want to have variable tab with

As told, not an issue or such (because one might imagine a variety of special cirumstances of course), but i simply did wonder.

Small cosmetics to assure a bit to not close the tab unintendedly when clicking onto a small tab when using variable tab width.
Title: Re: ATTabs little Q. caption innerspacing after text
Post by: Alextp on March 13, 2021, 11:32:03 pm
I just found this post again. Made the work! OptSpaceAfterText is added (tested when set it to 40, indent made big). Pls test.
Title: Re: ATTabs little Q. caption innerspacing after text
Post by: d7_2_laz on March 14, 2021, 11:10:01 am
Does work wonderful; thank you Alextp!
Benefit: make a tab more safe against unintended closure when using variable tab width and having a short caption.
Instead of many words see the pictures before vs. after (here: using OptSpaceAfterText:=22).
Title: Re: ATTabs little Q. caption innerspacing after text
Post by: Alextp on March 14, 2021, 11:30:09 am
Great. Note: I can miss forum posts so - duplicate them on ATFlatControls Github 'issues', pls.
TinyPortal © 2005-2018