@@ -377,27 +377,48 @@ CDockAreaTabBar* CDockAreaTitleBar::tabBar() const
377
377
return d->TabBar ;
378
378
}
379
379
380
+
381
+ // ============================================================================
382
+ void CDockAreaTitleBar::resizeEvent (QResizeEvent *event)
383
+ {
384
+ Super::resizeEvent (event);
385
+ if (CDockManager::testConfigFlag (CDockManager::DockAreaDynamicTabsMenuButtonVisibility)
386
+ && CDockManager::testConfigFlag (CDockManager::DisableTabTextEliding))
387
+ {
388
+ markTabsMenuOutdated ();
389
+ }
390
+ }
391
+
392
+
380
393
// ============================================================================
381
394
void CDockAreaTitleBar::markTabsMenuOutdated ()
382
395
{
383
- if ( DockAreaTitleBarPrivate ::testConfigFlag (CDockManager::DockAreaDynamicTabsMenuButtonVisibility))
396
+ if ( CDockManager ::testConfigFlag (CDockManager::DockAreaDynamicTabsMenuButtonVisibility))
384
397
{
385
- bool hasElidedTabTitle = false ;
386
- for ( int i = 0 ; i < d-> TabBar -> count (); ++i )
398
+ bool TabsMenuButtonVisible = false ;
399
+ if ( CDockManager::testConfigFlag (CDockManager::DisableTabTextEliding) )
387
400
{
388
- if (! d->TabBar ->isTabOpen (i))
389
- {
390
- continue ;
391
- }
392
- CDockWidgetTab* Tab = d-> TabBar -> tab (i) ;
393
- if (Tab-> isTitleElided () )
401
+ TabsMenuButtonVisible = d->TabBar ->areTabsOverflowing ();
402
+ }
403
+ else
404
+ {
405
+ bool hasElidedTabTitle = false ;
406
+ for ( int i = 0 ; i < d-> TabBar -> count (); ++i )
394
407
{
395
- hasElidedTabTitle = true ;
396
- break ;
408
+ if (!d->TabBar ->isTabOpen (i))
409
+ {
410
+ continue ;
411
+ }
412
+ CDockWidgetTab* Tab = d->TabBar ->tab (i);
413
+ if (Tab->isTitleElided ())
414
+ {
415
+ hasElidedTabTitle = true ;
416
+ break ;
417
+ }
397
418
}
419
+ TabsMenuButtonVisible = (hasElidedTabTitle && (d->TabBar ->count () > 1 ));
398
420
}
399
- bool visible = (hasElidedTabTitle && (d->TabBar ->count () > 1 ));
400
- QMetaObject::invokeMethod (d->TabsMenuButton , " setVisible" , Qt::QueuedConnection, Q_ARG (bool , visible));
421
+ QMetaObject::invokeMethod (d->TabsMenuButton , " setVisible" , Qt::QueuedConnection, Q_ARG (bool , TabsMenuButtonVisible));
401
422
}
402
423
d->MenuOutdated = true ;
403
424
}
0 commit comments