VirtualBox

Ignore:
Timestamp:
Aug 11, 2017 12:38:02 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8900: Selector UI: Use classic (title-bar) beta label instead of rotated one because there is no place for the latter since Tools toolbar was implemented.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r68200 r68392  
    430430        src/widgets/UIApplianceExportEditorWidget.h \
    431431        src/widgets/UIApplianceImportEditorWidget.h \
    432         src/widgets/UIBar.h \
    433432        src/widgets/UIBootTable.h \
    434433        src/widgets/UIFilePathSelector.h \
     
    749748        src/widgets/UIApplianceExportEditorWidget.cpp \
    750749        src/widgets/UIApplianceImportEditorWidget.cpp \
    751         src/widgets/UIBar.cpp \
    752750        src/widgets/UIBootTable.cpp \
    753751        src/widgets/UIFilePathSelector.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIImageTools.cpp

    r63567 r68392  
    267267}
    268268
    269 QPixmap betaLabelSleeve(const QSize &ls /* = QSize(80, 16) */)
    270 {
    271     const QImage &i = betaLabelImage(ls);
    272     /* Create a secondary image which will contain the rotated banner. */
    273     int w = (int)sqrtf(powf(ls.width(), 2) / 2);
    274     QImage i1(w, w, QImage::Format_ARGB32);
    275     i1.fill(Qt::transparent);
    276     QPainter p1(&i1);
    277     p1.setRenderHints(QPainter::SmoothPixmapTransform);
    278     p1.rotate(45);
    279     p1.drawImage(0, -ls.height(), i);
    280     p1.end();
    281 
    282     return QPixmap::fromImage(i1);
    283 }
    284 
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIImageTools.h

    r62493 r68392  
    2929
    3030QPixmap betaLabel(const QSize &ls = QSize(80, 16));
    31 QPixmap betaLabelSleeve(const QSize &ls = QSize(80, 16));
    3231
    3332#endif /* !__UIImageTools_h__ */
  • trunk/src/VBox/Frontends/VirtualBox/src/precomp.h

    r67535 r68392  
    428428#include "UIApplianceExportEditorWidget.h"
    429429#include "UIApplianceImportEditorWidget.h"
    430 #include "UIBar.h"
    431430#include "UIBootTable.h"
    432431#ifdef RT_OS_DARWIN
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r68315 r68392  
    2323# include <QApplication>
    2424# include <QBitmap>
     25# include <QMenuBar>
    2526# include <QWidget>
    2627# ifdef VBOX_WS_MAC
     
    4950# endif /* VBOX_WITH_VIDEOHWACCEL */
    5051# ifdef VBOX_WS_MAC
    51 #  include "UIMenuBar.h"
    5252#  include "VBoxUtils-darwin.h"
    5353# endif /* VBOX_WS_MAC */
     
    10441044#ifdef VBOX_WS_MAC
    10451045        /* Create Mac OS X menu-bar: */
    1046         m_pMenuBar = new UIMenuBar;
     1046        m_pMenuBar = new QMenuBar;
    10471047        AssertPtrReturnVoid(m_pMenuBar);
    10481048        {
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r68373 r68392  
    3232# include "QISplitter.h"
    3333# include "UIActionPoolSelector.h"
    34 # include "UIBar.h"
    3534# include "UIDesktopServices.h"
    3635# include "UIExtraDataManager.h"
     
    6867#  include "UIDesktopWidgetWatchdog.h"
    6968# endif
     69# ifndef VBOX_WS_MAC
     70#  include "UIMenuBar.h"
     71# endif
    7072
    7173/* Other VBox stuff: */
     
    115117    , m_pSlidingWidget(0)
    116118    , m_pSplitter(0)
    117 #ifndef VBOX_WS_MAC
    118     , m_pBar(0)
    119 #endif
    120119    , m_pToolBar(0)
    121120    , m_pTabBarMachine(0)
     
    192191        /* Configure action: */
    193192        pShowToolBar->setCheckable(true);
    194 #ifdef VBOX_WS_MAC
    195193        pShowToolBar->setChecked(m_pToolBar->isVisible());
    196 #else /* VBOX_WS_MAC */
    197         pShowToolBar->setChecked(m_pBar->isVisible());
    198 #endif /* !VBOX_WS_MAC */
    199194
    200195        /* Add into action list: */
     
    235230    {
    236231        if (pResult->isChecked())
    237         {
    238 #ifdef VBOX_WS_MAC
    239232            m_pToolBar->show();
    240 #else /* VBOX_WS_MAC */
    241             m_pBar->show();
    242 #endif /* !VBOX_WS_MAC */
    243         }
    244233        else
    245         {
    246 #ifdef VBOX_WS_MAC
    247234            m_pToolBar->hide();
    248 #else /* VBOX_WS_MAC */
    249             m_pBar->hide();
    250 #endif /* !VBOX_WS_MAC */
    251         }
    252235    }
    253236    else if (pResult == pShowToolBarText)
     
    13451328    if (vboxGlobal().isBeta())
    13461329    {
    1347         QPixmap betaLabel = ::betaLabelSleeve(QSize(107, 16));
    1348         ::darwinLabelWindow(this, &betaLabel, false);
     1330        QPixmap betaLabel = ::betaLabel(QSize(100, 16));
     1331        ::darwinLabelWindow(this, &betaLabel, true);
    13491332    }
    13501333
     
    13731356void UISelectorWindow::prepareMenuBar()
    13741357{
     1358#ifndef VBOX_WS_MAC
     1359    /* Create menu-bar: */
     1360    setMenuBar(new UIMenuBar);
     1361#endif
     1362
    13751363    /* Create action-pool: */
    13761364    m_pActionPool = UIActionPool::create(UIActionPoolType_Selector);
     
    17931781    {
    17941782        /* Configure toolbar: */
    1795         m_pToolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
     1783        m_pToolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    17961784        m_pToolBar->setContextMenuPolicy(Qt::CustomContextMenu);
    17971785        m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
     
    18581846            /* Add into toolbar: */
    18591847            m_pToolBar->addWidget(m_pToolbarTools);
    1860         }
    1861 
    1862         /* Create/add horizontal spacer widget of fixed size for the beta label: */
    1863         QWidget *pSpace = new QWidget;
    1864         if (pSpace)
    1865         {
    1866             if (vboxGlobal().isBeta())
    1867                 pSpace->setFixedSize(60, 1);
    1868             else
    1869                 pSpace->setFixedSize(1, 1);
    1870             m_pToolBar->addWidget(pSpace);
    18711848        }
    18721849
     
    19001877
    19011878#ifdef VBOX_WS_MAC
    1902 
    19031879            /* Native toolbar on MAC: */
    19041880            addToolBar(m_pToolBar);
    1905 
    1906 #else /* !VBOX_WS_MAC */
    1907 
    1908             /* Create main bar: */
    1909             m_pBar = new UIMainBar;
    1910             AssertPtrReturnVoid(m_pBar);
    1911             if (m_pBar)
    1912             {
    1913                 /* Configure main bar: */
    1914                 m_pBar->setContentWidget(m_pToolBar);
    1915 
    1916                 /* Add into layout: */
    1917                 pLayout->addWidget(m_pBar);
    1918             }
    1919 
    1920 #endif /* !VBOX_WS_MAC */
     1881#else
     1882            /* Add into layout: */
     1883            pLayout->addWidget(m_pToolBar);
     1884#endif
    19211885
    19221886            /* Create sliding-widget: */
     
    21202084        if (!gEDataManager->selectorWindowToolBarVisible())
    21212085            QMetaObject::invokeMethod(m_pToolBar, "hide", Qt::QueuedConnection);
    2122 #else /* VBOX_WS_MAC */
    2123         m_pBar->setHidden(!gEDataManager->selectorWindowToolBarVisible());
    2124 #endif /* !VBOX_WS_MAC */
     2086#else
     2087        m_pToolBar->setHidden(!gEDataManager->selectorWindowToolBarVisible());
     2088#endif
    21252089        m_pToolBar->setToolButtonStyle(gEDataManager->selectorWindowToolBarTextVisible()
    21262090                                       ? Qt::ToolButtonTextUnderIcon : Qt::ToolButtonIconOnly);
     
    21602124    /* Save toolbar and statusbar visibility: */
    21612125    {
    2162 #ifdef VBOX_WS_MAC
    21632126        gEDataManager->setSelectorWindowToolBarVisible(!m_pToolBar->isHidden());
    2164 #else /* VBOX_WS_MAC */
    2165         gEDataManager->setSelectorWindowToolBarVisible(!m_pBar->isHidden());
    2166 #endif /* !VBOX_WS_MAC */
    21672127        gEDataManager->setSelectorWindowToolBarTextVisible(m_pToolBar->toolButtonStyle() == Qt::ToolButtonTextUnderIcon);
    21682128        gEDataManager->setSelectorWindowStatusBarVisible(!statusBar()->isHidden());
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h

    r68315 r68392  
    3636class UIActionPool;
    3737class UIGChooser;
    38 #ifndef VBOX_WS_MAC
    39 class UIMainBar;
    40 #endif
    4138class UISlidingWidget;
    4239class UITabBar;
     
    337334    QISplitter *m_pSplitter;
    338335
    339 #ifndef VBOX_WS_MAC
    340     /** Holds the main bar instance. */
    341     UIMainBar *m_pBar;
    342 #endif
    343336    /** Holds the main toolbar instance. */
    344337    UIToolBar *m_pToolBar;
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