mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-17 16:50:26 +02:00
Bug 2182 - Updating Audacity can cause messed up toolbar layout
This commit is contained in:
parent
7149d8fcf9
commit
9e69be9f6f
@ -890,51 +890,10 @@ void ToolManager::ReadConfig()
|
|||||||
d->LoadConfig();
|
d->LoadConfig();
|
||||||
|
|
||||||
// Add all unordered toolbars
|
// Add all unordered toolbars
|
||||||
bool deviceWasPositioned = false;
|
|
||||||
for( int ord = 0; ord < (int) unordered[ dock ].size(); ord++ )
|
for( int ord = 0; ord < (int) unordered[ dock ].size(); ord++ )
|
||||||
{
|
{
|
||||||
ToolBar *t = mBars[ unordered[ dock ][ ord ] ].get();
|
ToolBar *t = mBars[ unordered[ dock ][ ord ] ].get();
|
||||||
|
|
||||||
if (deviceWasPositioned &&
|
|
||||||
t->GetType() == DeviceBarID)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (someFound &&
|
|
||||||
t->GetType() == ScrubbingBarID) {
|
|
||||||
// Special case code to put the NEW scrubbing toolbar where we
|
|
||||||
// want it, when audacity.cfg is present from an older version
|
|
||||||
ToolBar *lastRoot {};
|
|
||||||
|
|
||||||
// Change from the ideal configuration to the constrained one,
|
|
||||||
// just as when dragging and dropping
|
|
||||||
ToolBarConfiguration dummy;
|
|
||||||
mTopDock->WrapConfiguration(dummy);
|
|
||||||
|
|
||||||
// Start a NEW row with just the scrubbing toolbar
|
|
||||||
auto &configuration = mTopDock->GetConfiguration();
|
|
||||||
for (const auto place : configuration)
|
|
||||||
if (place.position.rightOf == nullptr)
|
|
||||||
lastRoot = place.pTree->pBar;
|
|
||||||
ToolBarConfiguration::Position position {
|
|
||||||
nullptr, lastRoot, false
|
|
||||||
};
|
|
||||||
mTopDock->Dock(t, false, position);
|
|
||||||
|
|
||||||
// Reposition the device toolbar, if it was docked above,
|
|
||||||
// right of scrubbing
|
|
||||||
const auto deviceToolBar = mBars[ DeviceBarID ].get();
|
|
||||||
if (deviceToolBar->GetDock() == mTopDock) {
|
|
||||||
deviceToolBar->GetDock()->Undock(deviceToolBar);
|
|
||||||
position = ToolBarConfiguration::Position{ t, nullptr };
|
|
||||||
mTopDock->Dock(deviceToolBar, false, position);
|
|
||||||
|
|
||||||
// Remember not to place the device toolbar again
|
|
||||||
deviceWasPositioned = true;
|
|
||||||
}
|
|
||||||
Expose( t->GetId(), show[ t->GetId() ] );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dock it
|
// Dock it
|
||||||
d->Dock( t, false );
|
d->Dock( t, false );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user