View Issue Details

IDProjectCategoryView StatusLast Update
0037214LazarusIDEpublic2021-03-18 14:21
ReporterSven Barth Assigned ToBalázs Székely  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformX86_64OSWindows NT 
Product Version2.1 (SVN) 
Summary0037214: IDE does not remember width of CoolBar
DescriptionIn my IDE with AnchorDocking enabled (and HighDPI) the width of the CoolBar is not remembered, instead its roughly twice the size when I restart the IDE. See attached screenshots (one is before restarting the IDE with my desired width, the other is directly after a restart)
Additional InformationI've tested with a completely new configuration. The only change I did was to enable the CoolBar.
TagsNo tags attached.
Fixed in Revisionr.64835
LazTarget-
WidgetsetWin32/Win64
Attached Files

Relationships

related to 0037887 closedJuha Manninen HighDPI: Icon of component select button not sized correctly 

Activities

Sven Barth

2020-06-14 11:26

manager  

lazarus-coolbar-after-restart.png (123,533 bytes)   
lazarus-coolbar-after-restart.png (123,533 bytes)   

Juha Manninen

2020-06-14 11:31

developer   ~0123432

Strange. I cannot reproduce. I just tested with Lazarus IDE built with QT5 bindings.

Sven Barth

2020-10-02 23:16

manager   ~0126045

Sorry for the late response.

I've played around with it a bit: it happens if I play with the splitter of the coolbar and it might also be DPI dependent (200% for me). E.g.:

- start Lazarus
- size the coolbar
- restart Lazarus
(the environmentoptions.xml will contain a width around twice the expected size)
- splitter for coolbar will be at wrong position

Some times it works correctly however when I resize the coolbar, close Lazarus (not restart!) and start it again, but not always.

If I manually adjust the width inside the environmentoptions.xml then it's loaded correctly and closing/restarting retains the value, but as soon as I touch the splitter the wrong value will be stored.

wp

2021-03-11 19:33

developer   ~0129574

Does this happen with Anchordocking only, or also with the normal undocked IDE?

Martok

2021-03-14 20:02

reporter   ~0129664

Oh, so that's why the component palette keeps moving over!
I can reproduce this exactly like Sven described (on Win32, DPI scaling 125%), both with and without Anchordocking.

Balázs Székely

2021-03-15 14:56

developer   ~0129688

Please test with the attached patch.
coolbar.patch (806 bytes)   
Index: ide/mainbar.pas
===================================================================
--- ide/mainbar.pas	(revision 64820)
+++ ide/mainbar.pas	(working copy)
@@ -673,7 +673,7 @@
   if EnvironmentOptions.Desktop.ComponentPaletteOptions.Visible then
   begin
     CoolBar.Align := alLeft;
-    CoolBar.Width := EnvironmentOptions.Desktop.IDECoolBarOptions.Width;
+    CoolBar.Width := MainIDEBar.Scale96ToForm(EnvironmentOptions.Desktop.IDECoolBarOptions.Width);
   end
   else
     CoolBar.Align := alClient;
@@ -803,7 +803,7 @@
 
 procedure TMainIDEBar.MainSplitterMoved(Sender: TObject);
 begin
-  EnvironmentOptions.Desktop.IDECoolBarOptions.Width := CoolBar.Width;
+  EnvironmentOptions.Desktop.IDECoolBarOptions.Width := MainIDEBar.ScaleFormTo96(CoolBar.Width);
   SetMainIDEHeight;
 end;
 
coolbar.patch (806 bytes)   

Sven Barth

2021-03-16 20:28

manager   ~0129720

Works correct with that patch though I dropped the MainIDEBar from the call to ScaleFormTo96 as using the global variable is unnecessary.

Balázs Székely

2021-03-16 22:13

developer   ~0129723

@Sven
"I dropped the MainIDEBar from the call to ScaleFormTo96 as using the global variable is unnecessary. "
You're right, MainIDEBar it's looking silly here. I copy-pasted the code from another unit where it was necessary, forgot to remove it.
Thanks for the correction.

Issue History

Date Modified Username Field Change
2020-06-14 11:26 Sven Barth New Issue
2020-06-14 11:26 Sven Barth File Added: lazarus-coolbar-after-restart.png
2020-06-14 11:26 Sven Barth File Added: lazarus-coolbar-before-restart.png
2020-06-14 11:31 Juha Manninen Note Added: 0123432
2020-10-02 23:16 Sven Barth Note Added: 0126045
2021-02-28 22:10 Juha Manninen Relationship added related to 0037887
2021-03-11 19:33 wp Note Added: 0129574
2021-03-14 20:02 Martok Note Added: 0129664
2021-03-15 14:56 Balázs Székely Note Added: 0129688
2021-03-15 14:56 Balázs Székely File Added: coolbar.patch
2021-03-16 20:28 Sven Barth Note Added: 0129720
2021-03-16 22:13 Balázs Székely Note Added: 0129723
2021-03-18 14:10 Balázs Székely Assigned To => Balázs Székely
2021-03-18 14:10 Balázs Székely Status new => assigned
2021-03-18 14:10 Balázs Székely LazTarget => -
2021-03-18 14:20 Balázs Székely Status assigned => resolved
2021-03-18 14:20 Balázs Székely Resolution open => fixed
2021-03-18 14:20 Balázs Székely Fixed in Revision => r.64835
2021-03-18 14:20 Balázs Székely Widgetset Win32/Win64 => Win32/Win64
2021-03-18 14:21 Balázs Székely Status resolved => closed