VirtualBox

Changeset 29975 in vbox for trunk/src


Ignore:
Timestamp:
Jun 2, 2010 11:17:10 AM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4-OSX: fix layout update problem of the toolbar on language changes (again)

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp

    r29526 r29975  
    613613#endif
    614614#ifdef QT_MAC_USE_COCOA
    615     /* There is a bug in Qt Cocoa which result in showing a "more
    616      * arrow" when the necessary size of the toolbar is increased. So
    617      * manually adjust the size after changing the text. */
    618     mToolBar->adjustSize();
     615    /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     616       the necessary size of the toolbar is increased. Also for some languages
     617       the with doesn't match if the text increase. So manually adjust the size
     618       after changing the text. */
     619    mToolBar->updateLayout();
    619620#endif /* QT_MAC_USE_COCOA */
    620621
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp

    r29972 r29975  
    14141414
    14151415#ifdef QT_MAC_USE_COCOA
    1416     /* There is a bug in Qt Cocoa which result in showing a "more
    1417      * arrow" when the necessary size of the toolbar is increased. So
    1418      * manually adjust the size after changing the text. */
    1419     mVMToolBar->adjustSize();
     1416    /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     1417       the necessary size of the toolbar is increased. Also for some languages
     1418       the with doesn't match if the text increase. So manually adjust the size
     1419       after changing the text. */
     1420    mVMToolBar->updateLayout();
    14201421#endif /* QT_MAC_USE_COCOA */
    14211422}
     
    14931494            mVmStartAction->setText (tr ("S&tart"));
    14941495#ifdef QT_MAC_USE_COCOA
    1495             /* There is a bug in Qt Cocoa which result in showing a "more
    1496              * arrow" when the necessary size of the toolbar is increased. So
    1497              * manually adjust the size after changing the text. */
    1498             mVMToolBar->adjustSize();
     1496            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     1497               the necessary size of the toolbar is increased. Also for some languages
     1498               the with doesn't match if the text increase. So manually adjust the size
     1499               after changing the text. */
     1500            mVMToolBar->updateLayout();
    14991501#endif /* QT_MAC_USE_COCOA */
    15001502            mVmStartAction->setStatusTip (
    1501                 tr ("Start the selected virtual machine"));
     1503                                          tr ("Start the selected virtual machine"));
    15021504
    15031505            mVmStartAction->setEnabled (!running);
     
    15071509            mVmStartAction->setText (tr ("S&how"));
    15081510#ifdef QT_MAC_USE_COCOA
    1509             /* There is a bug in Qt Cocoa which result in showing a "more
    1510              * arrow" when the necessary size of the toolbar is increased. So
    1511              * manually adjust the size after changing the text. */
    1512             mVMToolBar->adjustSize();
     1511            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     1512               the necessary size of the toolbar is increased. Also for some languages
     1513               the with doesn't match if the text increase. So manually adjust the size
     1514               after changing the text. */
     1515            mVMToolBar->updateLayout();
    15131516#endif /* QT_MAC_USE_COCOA */
    15141517            mVmStartAction->setStatusTip (
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxToolBar.h

    r29921 r29975  
    7373        ::darwinSetShowsToolbarButton (this, aShow);
    7474    }
     75
     76    void updateLayout()
     77    {
     78        /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     79           the necessary size of the toolbar is increased. Also for some languages
     80           the with doesn't match if the text increase. So manually adjust the size
     81           after changing the text. */
     82        QSizePolicy sp = sizePolicy();
     83        setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
     84        adjustSize();
     85        setSizePolicy(sp);
     86        layout()->invalidate();
     87        layout()->activate();
     88    }
    7589#endif /* Q_WS_MAC */
    7690
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette