VirtualBox

Changeset 83699 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 15, 2020 1:26:00 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137205
Message:

FE/Qt: bugref:6143. Correcting numpad margins

File:
1 edited

Legend:

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

    r83697 r83699  
    751751    int   m_iRightMargin;
    752752    int   m_iBottomMargin;
     753    int   m_iBeforeNumPadWidth;
    753754    Mode  m_enmMode;
    754755    bool  m_fHideOSMenuKeys;
     
    22222223    , m_iXSpacing(5)
    22232224    , m_iYSpacing(5)
    2224     , m_iLeftMargin(0)
     2225    , m_iLeftMargin(10)
    22252226    , m_iTopMargin(10)
    2226     , m_iRightMargin(0)
     2227    , m_iRightMargin(10)
    22272228    , m_iBottomMargin(10)
     2229    , m_iBeforeNumPadWidth(30)
    22282230    , m_enmMode(Mode_Keyboard)
    22292231    , m_fHideOSMenuKeys(false)
     
    22382240QSize UISoftKeyboardWidget::minimumSizeHint() const
    22392241{
     2242    float fScale = 1;//0.5f;
     2243    return QSize(fScale * m_minimumSize.width(), fScale * m_minimumSize.height());
     2244}
     2245
     2246QSize UISoftKeyboardWidget::sizeHint() const
     2247{
    22402248    float fScale = 0.5f;
    22412249    return QSize(fScale * m_minimumSize.width(), fScale * m_minimumSize.height());
    22422250}
    22432251
    2244 QSize UISoftKeyboardWidget::sizeHint() const
    2245 {
    2246     float fScale = 0.5f;
    2247     return QSize(fScale * m_minimumSize.width(), fScale * m_minimumSize.height());
    2248 }
    2249 
    22502252void UISoftKeyboardWidget::paintEvent(QPaintEvent *pEvent) /* override */
    22512253{
     
    22602262
    22612263    if (!m_fHideNumPad)
    2262         m_fScaleFactorX = width() / (float) m_iInitialWidth;
     2264        m_fScaleFactorX = width() / (float) (m_iInitialWidth + m_iBeforeNumPadWidth);
    22632265    else
    22642266        m_fScaleFactorX = width() / (float) m_iInitialWidthNoNumPad;
     
    23052307            else
    23062308                painter.translate(key.keyGeometry().x(), key.keyGeometry().y());
    2307 
    2308             int m_iBeforeNumPadWidth = 0;
    23092309
    23102310            if (key.keyboardRegion() == KeyboardRegion_NumPad)
     
    23502350                painter.translate(-key.keyGeometry().x(), -key.keyGeometry().y());
    23512351            if (key.keyboardRegion() == KeyboardRegion_NumPad)
    2352                 painter.translate(- m_iBeforeNumPadWidth, 0);
     2352                painter.translate(-m_iBeforeNumPadWidth, 0);
    23532353        }
    23542354    }
     
    30193019                if (j < row.keys().size() - 1)
    30203020                    iXNoNumPad += m_iXSpacing;
    3021                 if (key.spaceWidthAfter() != 0)
    3022                     iXNoNumPad += key.spaceWidthAfter();
     3021                if (key.spaceWidthAfter() != 0 && j != row.keys().size() - 1)
     3022                    iXNoNumPad += (m_iXSpacing + key.spaceWidthAfter());
    30233023            }
    30243024        }
     
    30273027        iMaxWidth = qMax(iMaxWidth, iX);
    30283028        iMaxWidthNoNumPad = qMax(iMaxWidthNoNumPad, iXNoNumPad);
     3029
    30293030        iY += iRowHeight;
    30303031        if (i < rows.size() - 1)
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