1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 16:48:44 +02:00

DeviceToolbar.cpp: better fit for resize and fix overspilling of channels combo when toolbar is very small.

This commit is contained in:
mchinen 2011-02-05 13:37:31 +00:00
parent 500b3a32df
commit 9e5cb8f6af

View File

@ -41,6 +41,7 @@
#include "../Prefs.h"
#include "../Project.h"
#include "../Theme.h"
#include "../widgets/Grabber.h"
IMPLEMENT_CLASS(DeviceToolBar, ToolBar);
@ -539,7 +540,8 @@ void DeviceToolBar::RepositionCombos()
if (dockw < w)
w = dockw;
}
w -= GetResizeGrabberWidth();
// subtract the main grabber on the left and the resizer as well
w -= grabberWidth + GetResizeGrabberWidth();
if (w <= 0)
return;
@ -563,7 +565,7 @@ void DeviceToolBar::RepositionCombos()
desiredChannels.SetHeight(desiredHost.GetHeight());
#endif
ratioUnused = 0.98f - (kHostWidthRatio + kInputWidthRatio + kOutputWidthRatio + kChannelsWidthRatio);
ratioUnused = 0.995f - (kHostWidthRatio + kInputWidthRatio + kOutputWidthRatio + kChannelsWidthRatio);
int i = 0;
// limit the amount of times we solve contraints to 5
while (constrained && ratioUnused > 0.01f && i < 5) {