VirtualBox

Changeset 81125 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 7, 2019 10:21:24 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133754
Message:

FE/Qt: bugref:6143. Replacing some flags with an enum.

File:
1 edited

Legend:

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

    r81121 r81125  
    9696    KeyboardColorType_Pressed,
    9797    KeyboardColorType_Max
     98};
     99
     100enum KeyboardRegion
     101{
     102    KeyboardRegion_Main = 0,
     103    KeyboardRegion_NumPad,
     104    KeyboardRegion_Multimedia,
     105    KeyboardRegion_OSMenu,
     106    KeyboardRegion_Max
    98107};
    99108
     
    349358    KeyType type() const;
    350359
    351     void setIsNumPadKey(bool fIsNumPadKey);
    352     bool isNumPadKey() const;
    353 
    354     void setIsOSMenuKey(bool fIsOSMenuKey);
    355     bool isOSMenuKey() const;
     360    KeyboardRegion keyboardRegion() const;
     361    void setKeyboardRegion(KeyboardRegion enmRegion);
    356362
    357363    void setCutout(int iCorner, int iWidth, int iHeight);
     
    408414    LONG m_iUsageId;
    409415    LONG m_iUsagePage;
    410     bool m_fIsNumPadKey;
    411     bool m_fIsOSMenuKey;
     416    KeyboardRegion m_enmKeyboardRegion;
    412417};
    413418
     
    14331438    , m_iPosition(0)
    14341439    , m_pParentWidget(0)
    1435     , m_fIsNumPadKey(false)
    1436     , m_fIsOSMenuKey(false)
    1437 
     1440    , m_enmKeyboardRegion(KeyboardRegion_Main)
    14381441{
    14391442}
     
    15351538}
    15361539
    1537 void UISoftKeyboardKey::setIsNumPadKey(bool fIsNumPadKey)
    1538 {
    1539     m_fIsNumPadKey = fIsNumPadKey;
    1540 }
    1541 
    1542 bool UISoftKeyboardKey::isNumPadKey() const
    1543 {
    1544     return m_fIsNumPadKey;
    1545 }
    1546 
    1547 void UISoftKeyboardKey::setIsOSMenuKey(bool fIsOSMenuKey)
    1548 {
    1549     m_fIsOSMenuKey = fIsOSMenuKey;
    1550 }
    1551 
    1552 bool UISoftKeyboardKey::isOSMenuKey() const
    1553 {
    1554     return m_fIsOSMenuKey;
     1540KeyboardRegion UISoftKeyboardKey::keyboardRegion() const
     1541{
     1542    return m_enmKeyboardRegion;
     1543}
     1544
     1545void UISoftKeyboardKey::setKeyboardRegion(KeyboardRegion enmRegion)
     1546{
     1547    m_enmKeyboardRegion = enmRegion;
    15551548}
    15561549
     
    20962089        {
    20972090            UISoftKeyboardKey &key = keys[j];
    2098             if (m_fHideOSMenuKeys && key.isOSMenuKey())
     2091            if (m_fHideOSMenuKeys && key.keyboardRegion() == KeyboardRegion_OSMenu)
    20992092                continue;
    21002093
    2101             if (m_fHideNumPad &&key.isNumPadKey())
     2094            if (m_fHideNumPad && key.keyboardRegion() == KeyboardRegion_NumPad)
    21022095                continue;
    21032096
     
    26472640            for (int j = 0; j < row.keys().size(); ++j)
    26482641            {
    2649                 row.keys()[j].setIsNumPadKey(true);
     2642                row.keys()[j].setKeyboardRegion(KeyboardRegion_NumPad);
    26502643            }
    26512644        }
    26522645        return true;
    26532646    }
    2654 
     2647    /* Go thru all the keys row by row and construct their geometries: */
    26552648    int iY = m_iTopMargin;
    26562649    int iMaxWidth = 0;
     
    26942687                iX += (m_iXSpacing + key.spaceWidthAfter());
    26952688
    2696             if (!key.isNumPadKey())
     2689            if (key.keyboardRegion() != KeyboardRegion_NumPad)
    26972690            {
    26982691                iXNoNumPad += key.width();
     
    30623055        {
    30633056            if (m_xmlReader.readElementText() == "true")
    3064                 key.setIsOSMenuKey(true);
     3057                key.setKeyboardRegion(KeyboardRegion_OSMenu);
    30653058        }
    30663059        else
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