xLightsSequencer / xLights

xLights is a sequencer for Lights. xLights has usb and E1.31 drivers. You can create sequences in this object oriented program. You can create playlists, schedule them, test your hardware, convert between different sequencers.
GNU General Public License v3.0
540 stars 200 forks source link

Status bar text at the bottom of xLights is not scaling properly when Windows / Display / Scale feature is used. #4669

Closed JohnCreed closed 3 weeks ago

JohnCreed commented 1 month ago

Describe the bug When increasing the Display Scale setting in Windows from 100% to a higher value like 200% the text in the bottom status bar in xLights starts to vertically disappear. Its almost like the box the text is in isn't scaling the same as the text itself, see Screenshot & Video below.

To Reproduce Video = https://youtu.be/-mk39B4oH2A or 1.) Navigate to WIndows / Display / Scale and turn the scaling to 200% 2.) Open xLights 3.) Note the text at the bottom is cut in half vertically 4.) If you put Windows scaling back to 100% then you can read the status text at the bottom of xLights (with a magnifying glass)

Expected behavior I would expect that bottom status/text bar of xLights to scale properly when using the Windows / Display / Scale setting.

Screenshots image

Versions (please complete the following information):

derwin12 commented 3 weeks ago

Duplicate of #4215

derwin12 commented 3 weeks ago

Devs - any hints on how to increase the size of the status bar by a couple of pixels? I cant seem to find the magic sauce in code::blocks to make that happen.

computergeek1507 commented 3 weeks ago

It maybe a WX issue I would look to see if there repo has anything about it

dkulp commented 3 weeks ago

The issue is that the status bar is handled by the AUI manager and its size/position is thus saved as part of the perspective. We could pull it out of the AUIManager (patch:
patch.txt ) but this has a side effect that going back to an older version of lights would result in toolbars and everything being reset to default locations. Thoughts on that?

dkulp commented 3 weeks ago

Also has a side effect of not being able to do anything with it in code blocks anymore. :(

dkulp commented 3 weeks ago

Actually, another thought: after calling LoadPerspective, maybe re-call the various fit calls.

    StatusBarSizer->Fit(AUIStatusBar);
    StatusBarSizer->SetSizeHints(AUIStatusBar);

not sure if that works or not.

derwin12 commented 3 weeks ago

That last one .. does seem to do it. I had to minimize and maximize xlights after I switched to 150% screen res.

dkulp commented 3 weeks ago

Might be better to do:

diff --git a/xLights/xLightsMain.cpp b/xLights/xLightsMain.cpp
index 5b10ebf64..efb7b421a 100644
--- a/xLights/xLightsMain.cpp
+++ b/xLights/xLightsMain.cpp
@@ -1660,7 +1660,10 @@ xLightsFrame::xLightsFrame(wxWindow* parent, int ab, wxWindowID id, bool renderO
     SetFixFileDirectories(mediaDirectories);
     wxString tbData = config->Read("ToolbarLocations");
     if (tbData.StartsWith(TOOLBAR_SAVE_VERSION)) {
+        int size = AUIStatusBar->GetSize().GetHeight();
         MainAuiManager->LoadPerspective(tbData.Right(tbData.size() - 5));
+        MainAuiManager->GetPane("Status Bar").MinSize(wxSize(-1, size));
+        MainAuiManager->Update();
     }
     logger_base.debug("Perspectives loaded.");
derwin12 commented 3 weeks ago

That last one Dan works perfectly .. did require an xlights restart but I think that is expected when you change Scaling. Windows even warns you that an app restart is required. I will leave it to you to commit the code. Thanks!!

patdelaney commented 3 weeks ago

I'm guessing that we should validate the fix on Mac and Linux as well. @dkulp do we know the size of the install base for xLights on Linux? Is there anyway to track it outside of uploaded crashreports ?

derwin12 commented 3 weeks ago

Once the commit happens .. mac users running the testflight (ie Alex) will get the test version.

dkulp commented 3 weeks ago

Well, the fix was developed on a Mac so I know it's OK there. Besides, the Mac uses logical pixels and the height is always 20 no matter the scaling for the monitor.