mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-23 23:03:55 +02:00
Fix missing toolbars at startup on Linux
The problem was that on Linux (not Windows or Mac) menu events are generated when checking the menu items in the toolbar menu. Becuase of the recent changes I made and how the toolbars are being shown (toggled) when the toolbar menu is checked, they were simply being hidden. Actually, the were being shown and then hidden because of the toggle. So, with this change I made exposing toolbars a bit more deterministic. The menus still use a toggle, but the ToolManager now shows or hides the bars explicitly during setup, so the menu toggle issue is resolved.
This commit is contained in:
@@ -546,7 +546,7 @@ void ToolManager::Reset()
|
||||
floater->CentreOnParent( );
|
||||
floater->Move( floater->GetPosition() + wxSize( ndx * 10 - 200, ndx * 10 ));
|
||||
bar->SetDocked( NULL, false );
|
||||
bar->Expose( false );
|
||||
Expose( ndx, false );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -715,11 +715,11 @@ void ToolManager::ReadConfig()
|
||||
bar->SetPositioned();
|
||||
}
|
||||
|
||||
// Show or hide it
|
||||
bar->Expose( show[ ndx ] );
|
||||
|
||||
// Inform toolbar of change
|
||||
bar->SetDocked( NULL, false );
|
||||
|
||||
// Show or hide it
|
||||
Expose( ndx, show[ ndx ] );
|
||||
}
|
||||
|
||||
// Change back to the bar root
|
||||
@@ -746,16 +746,9 @@ void ToolManager::ReadConfig()
|
||||
|
||||
// Dock it
|
||||
d->Dock( t );
|
||||
|
||||
// Hide the bar
|
||||
if( !show[ t->GetId() ] )
|
||||
{
|
||||
d->ShowHide( t->GetId() );
|
||||
}
|
||||
else
|
||||
{
|
||||
t->Expose( show[ ndx ] );
|
||||
}
|
||||
|
||||
// Show or hide it
|
||||
Expose( t->GetId(), show[ t->GetId() ] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -767,15 +760,8 @@ void ToolManager::ReadConfig()
|
||||
// Dock it
|
||||
d->Dock( t );
|
||||
|
||||
// Hide the bar
|
||||
if( !show[ t->GetId() ] )
|
||||
{
|
||||
d->ShowHide( t->GetId() );
|
||||
}
|
||||
else
|
||||
{
|
||||
t->Expose( show[ ndx ] );
|
||||
}
|
||||
// Show or hide the bar
|
||||
Expose( t->GetId(), show[ t->GetId() ] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -915,24 +901,7 @@ bool ToolManager::IsVisible( int type )
|
||||
//
|
||||
void ToolManager::ShowHide( int type )
|
||||
{
|
||||
ToolBar *t = mBars[ type ];
|
||||
|
||||
// Handle docked and floaters differently
|
||||
if( t->IsDocked() )
|
||||
{
|
||||
t->GetDock()->ShowHide( type );
|
||||
}
|
||||
else
|
||||
{
|
||||
t->Expose( !t->IsVisible() );
|
||||
}
|
||||
}
|
||||
|
||||
void ToolManager::Hide( int type )
|
||||
{
|
||||
if( !IsVisible( type ) )
|
||||
return;
|
||||
ShowHide( type );
|
||||
Expose( type, !mBars[ type ]->IsVisible() );
|
||||
}
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user