Lazarus

Using the Lazarus IDE => Editor => Topic started by: 440bx on May 15, 2025, 05:30:39 am

Title: Feature request/suggestion
Post by: 440bx on May 15, 2025, 05:30:39 am
Hello,

In the Source Editor Window Manager it is possible to alphabetically sort the list which, when dealing with a lot of windows, makes it much easier to locate a specific window.

Unfortunately, there doesn't seem to be a way to alphabetically sort the editor tabs/labels.  In the attachment, notice that the tabs are _not_ alphabetically sorted. 

That's the feature request/suggestion: provide a way to sort those tabs/labels to make it easier to locate the tab of a particular editing window.

Comments and questions welcome.
Title: Re: Feature request/suggestion
Post by: paweld on May 15, 2025, 06:19:44 am
Try the PackageTabs component - Lazarus menu:
Package > Install/Uninstall Packages ..., on the right side search for “packageTabs” and click Install selection and then Build IDE.
Title: Re: Feature request/suggestion
Post by: 440bx on May 15, 2025, 06:33:50 am
Try the PackageTabs component - Lazarus menu:
Package > Install/Uninstall Packages ..., on the right side search for “packageTabs” and click Install selection and then Build IDE.
Paweld, thank you for the suggestion.

I installed the package and after installing it, I got what shows in the attachment.

My question is: is there a way to have all the tabs in a single line instead of occupying most of the editor screen ?

Thank you for your help.
Title: Re: Feature request/suggestion
Post by: paweld on May 15, 2025, 07:07:29 am
Unfortunately, no. I use as a bar on the left side of the editor.
The component settings are available: Tools > Options > Editor > Pages and Windows
Title: Re: Feature request/suggestion
Post by: 440bx on May 15, 2025, 07:39:00 am
Either way, it takes too much space for my taste but, it was definitely worth a try. 

Thank you for the suggestion @paweld
Title: Re: Feature request/suggestion
Post by: n7800 on May 15, 2025, 07:35:32 pm
I installed the package and after installing it, I got what shows in the attachment.

My question is: is there a way to have all the tabs in a single line instead of occupying most of the editor screen ?

I took the liberty of opening a feature request (https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41643) on the bug tracker.

I listed some implementation options. Perhaps they will be considered.
Title: Re: Feature request/suggestion
Post by: 440bx on May 15, 2025, 07:58:33 pm
I took the liberty of opening a feature request (https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41643) on the bug tracker.

I listed some implementation options. Perhaps they will be considered.
Thank you for doing that @n7800.  I wasn't even sure how to describe the problem/enhancement.
Title: Re: Feature request/suggestion
Post by: wp on May 17, 2025, 11:04:21 am
Either way, it takes too much space for my taste [...]
Did you notice that there is a splitter at the side of the tab bar to adjust its width? For me personally the PackageTabs is one of most important additions to the Lazarus IDE that I always install. But it makes sense only at the left or right side of the editor - tree-like grouping by package is confusing in horizontal orientation of the tabs. Since monitors are rather wide nowadays there is more space at the side of the editor window than above/below it. Due to the vertical stacking a lot of tabs can be accomodated at the sides of the editor, and even a scrollbar becomes visibible if there are too many.
Title: Re: Feature request/suggestion
Post by: 440bx on May 17, 2025, 11:49:45 am
Did you notice that there is a splitter at the side of the tab bar to adjust its width? For me personally the PackageTabs is one of most important additions to the Lazarus IDE that I always install.
Hello wp,

What you've got looks very nice.  Because of that, I thought I'd give the tabs package another shot.

Please refer to the attachment for what follows. I haven't been able to get something that looks like your setup.  Specifically, in yours the label text seems to be left justified.  In mine it looks centered which is not really good.  How do you get yours to be left justified ? 

If possible, I'd like to have all your tab settings because I like the result you posted a picture of.

Thank you!.

ETA:

Added the forgotten attachment.

PS: need to scroll horizontally to see the right hand side window.


Title: Re: Feature request/suggestion
Post by: wp on May 17, 2025, 12:19:03 pm
I haven't been able to get something that looks like your setup.  Specifically, in yours the label text seems to be left justified.  In mine it looks centered which is not really good.  How do you get yours to be left justified ? 
There was a recent change in the PackageTabs to right-align the captions. If you don't use Laz/main make the following changes to file packagetabs_impl.pas in components/packagetabs of your Lazarus installation
Code: Pascal  [Select][+][-]
  1. constructor TPackageTabButton.Create(aOwner: TComponent);
  2. begin
  3.   inherited Create(aOwner);
  4.  
  5.   if IDEEditorOptions.TabPosition in [tpLeft, tpRight] then
  6.   begin
  7.     Alignment := taLeftJustify;
  8.     Margin := Scale96ToFont(4); // need for left text align
  9.     BorderSpacing.Left := Scale96ToFont(8);
  10.     BorderSpacing.Right := 1;
  11.   end;
  12.  
  13.   Transparent := True;
  14. [...]
Code: Pascal  [Select][+][-]
  1. [...]
  2.         if FPanel is TPackageTabScrollBox then
  3.         begin
  4.           xLbl.Alignment := taLeftJustify;
  5.           xLbl.BorderSpacing.Left := FPanel.Scale96ToFont(4);
  6.         end
  7.         else if FPanel is TPackageTabFlowPanel then  
  8. [...]
Title: Re: Feature request/suggestion
Post by: 440bx on May 17, 2025, 12:43:12 pm
That worked great !!

Thank you WP.
Title: Re: Feature request/suggestion
Post by: n7800 on May 18, 2025, 09:02:05 pm
I haven't been able to get something that looks like your setup.  Specifically, in yours the label text seems to be left justified.  In mine it looks centered which is not really good.  How do you get yours to be left justified ? 

I can't help but brag that this is my fix (https://gitlab.com/freepascal.org/lazarus/lazarus/-/merge_requests/441) ))

@wp, I just noticed that you added High-DPI support to it, thanks. Unfortunately, I only have one standard monitor, so I can't provide this support, since I won't be able to test it anyway.
Title: Re: Feature request/suggestion
Post by: 440bx on May 18, 2025, 10:15:56 pm
I can't help but brag that this is my fix (https://gitlab.com/freepascal.org/lazarus/lazarus/-/merge_requests/441) ))
Here is a heartfelt thank you and a well deserved compliment, well done!
TinyPortal © 2005-2018