VirtualBox

Changeset 75915 in vbox


Ignore:
Timestamp:
Dec 3, 2018 3:48:32 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699. Somw more improvements on the file operations panel.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
Files:
2 edited

Legend:

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

    r75897 r75915  
    2727# include <QProgressBar>
    2828# include <QScrollArea>
     29# include <QScrollBar>
    2930# include <QStyle>
    3031
     
    208209    //m_pMainLayout->setSpacing(0);
    209210
     211    m_pProgressBar = new QProgressBar;
     212    if (m_pProgressBar)
     213    {
     214        m_pProgressBar->setMinimum(0);
     215        m_pProgressBar->setMaximum(100);
     216        /* Hide the QProgressBar's text since in MacOS it never shows: */
     217        m_pProgressBar->setTextVisible(false);
     218        m_pMainLayout->addWidget(m_pProgressBar, 0, 0, 1, 1);
     219    }
     220
    210221    m_pCancelButton = new QIToolButton;
    211222    if (m_pCancelButton)
     
    215226        if (!m_comProgress.isNull() && !m_comProgress.GetCancelable())
    216227            m_pCancelButton->setEnabled(false);
    217         m_pMainLayout->addWidget(m_pCancelButton, 0, 0, 1, 1);
    218     }
    219 
    220     m_pProgressBar = new QProgressBar;
    221     if (m_pProgressBar)
    222     {
    223         m_pProgressBar->setMinimum(0);
    224         m_pProgressBar->setMaximum(100);
    225         /* Hide the QProgressBar's text since in MacOS it never shows: */
    226         m_pProgressBar->setTextVisible(false);
    227         m_pMainLayout->addWidget(m_pProgressBar, 0, 1, 1, 2);
    228     }
     228        m_pMainLayout->addWidget(m_pCancelButton, 0, 1, 1, 1);
     229    }
     230
    229231    m_pStatusLabel = new QILabel;
    230232    if (m_pStatusLabel)
    231233    {
    232234        m_pStatusLabel->setContextMenuPolicy(Qt::NoContextMenu);
    233         m_pMainLayout->addWidget(m_pStatusLabel, 0, 3, 1, 1);
     235        m_pMainLayout->addWidget(m_pStatusLabel, 0, 2, 1, 1);
    234236    }
    235237
     
    238240    {
    239241        m_pPercentageLabel->setContextMenuPolicy(Qt::NoContextMenu);
    240         m_pMainLayout->addWidget(m_pPercentageLabel, 1, 1, 1, 4);
     242        m_pMainLayout->addWidget(m_pPercentageLabel, 1, 0, 1, 4);
    241243    }
    242244
     
    362364        return;
    363365
     366    QScrollBar *pVerticalScrollBar = m_pScrollArea->verticalScrollBar();
     367    if (pVerticalScrollBar)
     368        QObject::connect(pVerticalScrollBar, &QScrollBar::rangeChanged, this, &UIGuestControlFileManagerOperationsPanel::sltScrollToBottom);
     369
    364370    m_pScrollArea->setBackgroundRole(QPalette::Window);
    365371    m_pScrollArea->setWidgetResizable(true);
     
    455461}
    456462
     463void UIGuestControlFileManagerOperationsPanel::sltScrollToBottom(int iMin, int iMax)
     464{
     465    Q_UNUSED(iMin);
     466    if (m_pScrollArea)
     467    m_pScrollArea->verticalScrollBar()->setValue(iMax);
     468}
     469
    457470#include "UIGuestControlFileManagerOperationsPanel.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManagerOperationsPanel.h

    r75897 r75915  
    7474    void sltHandleWidgetFocusIn(QWidget *pWidget);
    7575    void sltHandleWidgetFocusOut(QWidget *pWidget);
     76    void sltScrollToBottom(int iMin, int iMax);
    7677
    7778private:
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