VirtualBox

Changeset 13631 in vbox


Ignore:
Timestamp:
Oct 28, 2008 4:02:24 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
38557
Message:

FE/Qt4: 2669: "Create VM context menu in the Selector window": Main window layout re-arragned so what the tool-bar become common for both the panels - VM List & VM Details. Tool-bar appended with missed actions. Details view vertical scroll-bar is now correctly positioned.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h

    r12829 r13631  
    2727#include <QMouseEvent>
    2828#include <QWidget>
    29 #include <QTextEdit>
     29#include <QTextBrowser>
    3030
    3131/**
     
    108108};
    109109
     110/**
     111 *  QTextBrowser reimplementation to feat some extended requirements.
     112 */
     113class QRichTextBrowser : public QTextBrowser
     114{
     115    Q_OBJECT;
     116
     117public:
     118
     119    QRichTextBrowser (QWidget *aParent) : QTextBrowser (aParent) {}
     120
     121    void setViewportMargins (int aLeft, int aTop, int aRight, int aBottom)
     122    {
     123        QTextBrowser::setViewportMargins (aLeft, aTop, aRight, aBottom);
     124    }
     125};
     126
    110127#ifdef Q_WS_MAC
    111128# undef PAGE_SIZE
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp

    r13580 r13631  
    3333#include "VBoxVMLogViewer.h"
    3434#include "VBoxGlobal.h"
     35#include "VBoxUtils.h"
    3536
    3637#ifdef Q_WS_X11
     
    101102    void createErrPage();
    102103
    103     QTextBrowser *mDetailsText;
     104    QRichTextBrowser *mDetailsText;
    104105
    105106    QWidget *mErrBox;
     
    121122    /* create normal details page */
    122123
    123     mDetailsText = new QTextBrowser (mErrBox);
     124    mDetailsText = new QRichTextBrowser (mErrBox);
     125    mDetailsText->setViewportMargins (10, 10, 10, 10);
    124126    mDetailsText->setFocusPolicy (Qt::StrongFocus);
    125127    mDetailsText->document()->setDefaultStyleSheet ("a { text-decoration: none; }");
     
    454456    mHelpActions.setup (this);
    455457
    456     /* subwidgets */
    457 
    458     /* central widget & horizontal layout */
     458    /* Subwidgets */
     459
     460    /* Central widget @ vertical layout */
    459461    setCentralWidget (new QWidget (this));
    460     QHBoxLayout *centralLayout =
    461         new QHBoxLayout (centralWidget());
    462 
    463     /* left vertical box */
    464     QVBoxLayout *leftVLayout = new QVBoxLayout ();
    465     /* right vertical box */
    466     QVBoxLayout *rightVLayout = new QVBoxLayout ();
    467     centralLayout->addLayout (leftVLayout, 1);
    468     centralLayout->addLayout (rightVLayout, 2);
     462    QVBoxLayout *centralLayout = new QVBoxLayout (centralWidget());
     463
     464    /* Pane horizontal layout */
     465    QHBoxLayout *paneLayout = new QHBoxLayout();
    469466
    470467    /* VM list toolbar */
    471468    VBoxToolBar *vmTools = new VBoxToolBar (this);
     469
     470    /* Left vertical box */
     471    QVBoxLayout *leftVLayout = new QVBoxLayout();
     472    paneLayout->addLayout (leftVLayout, 1);
     473
     474    /* Right vertical box */
     475    QVBoxLayout *rightVLayout = new QVBoxLayout();
     476    paneLayout->addLayout (rightVLayout, 2);
     477
    472478#if MAC_LEOPARD_STYLE
    473479    /* Enable unified toolbars on Mac OS X. Available on Qt >= 4.3 */
     
    476482    /* No spacing/margin on the mac */
    477483    VBoxGlobal::setLayoutMargin (centralLayout, 0);
     484    VBoxGlobal::setLayoutMargin (paneLayout, 0); /* Dsen to NaN: Is it necessary? */
    478485    leftVLayout->setSpacing (0);
    479486    rightVLayout->setSpacing (0);
    480     rightVLayout->insertSpacing (0, 10);
     487    // rightVLayout->insertSpacing (0, 10); /* Dsen to NaN: Is it necessary anymore? */
    481488#else /* MAC_LEOPARD_STYLE */
    482     leftVLayout->addWidget(vmTools);
    483     centralLayout->setSpacing (9);
     489    centralLayout->addWidget (vmTools);
     490    centralLayout->setSpacing (5);
     491    paneLayout->setSpacing (9);
    484492    VBoxGlobal::setLayoutMargin (centralLayout, 5);
    485493    leftVLayout->setSpacing (5);
     
    487495#endif /* MAC_LEOPARD_STYLE */
    488496
     497    /* Inserting pane layout */
     498    centralLayout->addLayout (paneLayout);
     499
    489500    /* VM list view */
    490501    mVMListView = new VBoxVMListView();
    491     mVMModel = new VBoxVMModel(mVMListView);
     502    mVMModel = new VBoxVMModel (mVMListView);
    492503    mVMListView->setModel (mVMModel);
    493504
     
    495506
    496507    /* VM tab widget containing details and snapshots tabs */
    497     vmTabWidget = new QTabWidget ();
     508    vmTabWidget = new QTabWidget();
    498509    rightVLayout->addWidget (vmTabWidget);
    499510
    500511    /* VM details view */
    501     vmDetailsView = new VBoxVMDetailsView (NULL,
    502                                            vmRefreshAction);
     512    vmDetailsView = new VBoxVMDetailsView (NULL, vmRefreshAction);
    503513    vmTabWidget->addTab (vmDetailsView,
    504514                         VBoxGlobal::iconSet (":/settings_16px.png"),
    505515                         QString::null);
    506     vmDetailsView->setContentsMargins (10, 10, 10, 10);
    507516
    508517    /* VM snapshots list */
     
    535544    vmTools->addAction (vmStartAction);
    536545    vmTools->addAction (vmDiscardAction);
     546    vmTools->addSeparator();
     547    vmTools->addAction (vmPauseAction);
     548    vmTools->addSeparator();
     549    vmTools->addAction (vmRefreshAction);
     550    vmTools->addSeparator();
     551    vmTools->addAction (vmShowLogsAction);
    537552
    538553    /* add actions to menubar */
Note: See TracChangeset for help on using the changeset viewer.

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