VirtualBox

Changeset 79398 in vbox


Ignore:
Timestamp:
Jun 27, 2019 3:53:30 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131637
Message:

FE/Qt: bugref:6143. Fixing a key editor bug

File:
1 edited

Legend:

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

    r79387 r79398  
    3434#include <QStyle>
    3535#include <QStackedWidget>
     36#include <QTableWidget>
    3637#include <QToolButton>
    3738#include <QXmlStreamReader>
     
    491492    /** Is called when the captions in UISoftKeyboardKey is changed and forward this changes to
    492493      * corresponding UISoftKeyboardLayout */
    493     void updateKeyCaptionsInLayout(UISoftKeyboardKey *pKey);
     494    //void updateKeyCaptionsInLayout(UISoftKeyboardKey *pKey);
    494495    void saveCurentLayoutToFile();
    495496    void copyCurentLayout();
     
    688689    void prepareObjects();
    689690
    690     QCheckBox  *m_pShowNumPadCheckBox;
    691     QCheckBox  *m_pShowOsMenuButtonsCheckBox;
    692 
     691    QCheckBox   *m_pShowNumPadCheckBox;
     692    QCheckBox   *m_pShowOsMenuButtonsCheckBox;
     693    QTableWidget *m_pColorSelectionTable;
    693694};
    694695
     
    20592060}
    20602061
    2061 void UISoftKeyboardWidget::updateKeyCaptionsInLayout(UISoftKeyboardKey *pKey)
    2062 {
    2063     if (!m_pCurrentKeyboardLayout || !pKey)
    2064         return;
    2065 
    2066     /* Assuming the key captions are changed for the current layout: */
    2067     KeyCaptions newCaptions;
    2068     // newCaptions.m_strBase = pKey->baseCaption();
    2069     // newCaptions.m_strShift = pKey->shiftCaption();
    2070     // newCaptions.m_strAltGr = pKey->altGrCaption();
    2071     // newCaptions.m_strShiftAltGr = pKey->shiftAltGrCaption();
    2072     m_pCurrentKeyboardLayout->updateKeyCaptions(pKey->position(), newCaptions);
    2073 }
     2062// void UISoftKeyboardWidget::updateKeyCaptionsInLayout(UISoftKeyboardKey *pKey)
     2063// {
     2064//     if (!m_pCurrentKeyboardLayout || !pKey)
     2065//         return;
     2066
     2067//     /* Assuming the key captions are changed for the current layout: */
     2068//     KeyCaptions newCaptions;
     2069//     // newCaptions.m_strBase = pKey->baseCaption();
     2070//     // newCaptions.m_strShift = pKey->shiftCaption();
     2071//     // newCaptions.m_strAltGr = pKey->altGrCaption();
     2072//     // newCaptions.m_strShiftAltGr = pKey->shiftAltGrCaption();
     2073//     m_pCurrentKeyboardLayout->updateKeyCaptions(pKey->position(), newCaptions);
     2074// }
    20742075
    20752076void UISoftKeyboardWidget::addLayout(const UISoftKeyboardLayout &newLayout)
     
    23272328    m_iInitialWidthNoNumPad = qMax(m_iInitialWidthNoNumPad, iInitialWidthNoNumPad);
    23282329    m_iInitialHeight = qMax(m_iInitialHeight, iInitialHeight);
    2329     //printf("%s total key count: %d\n", qPrintable(strLayoutFileName), iKeyCount - 3 /* substract OS an menu keys */);
     2330
    23302331    return true;
    23312332}
     
    28872888    , m_pShowNumPadCheckBox(0)
    28882889    , m_pShowOsMenuButtonsCheckBox(0)
     2890    , m_pColorSelectionTable(0)
    28892891{
    28902892    prepareObjects();
     
    29202922    m_pShowOsMenuButtonsCheckBox = new QCheckBox;
    29212923
    2922     pSettingsLayout->addWidget(m_pShowNumPadCheckBox, 0, 0);
    2923     pSettingsLayout->addWidget(m_pShowOsMenuButtonsCheckBox, 1, 0);
     2924    pSettingsLayout->addWidget(m_pShowNumPadCheckBox, 0, 0, 1, 1);
     2925    pSettingsLayout->addWidget(m_pShowOsMenuButtonsCheckBox, 1, 0, 1, 1);
    29242926
    29252927    connect(m_pShowNumPadCheckBox, &QCheckBox::toggled, this, &UISoftKeyboardSettingsWidget::sigShowNumPad);
    29262928    connect(m_pShowOsMenuButtonsCheckBox, &QCheckBox::toggled, this, &UISoftKeyboardSettingsWidget::sigShowOSMenuKeys);
    29272929
     2930    m_pColorSelectionTable = new QTableWidget;
     2931    pSettingsLayout->addWidget(m_pShowOsMenuButtonsCheckBox, 2, 0, 2, 1);
     2932    m_pColorSelectionTable->setRowCount(3);
     2933    m_pColorSelectionTable->setColumnCount(2);
     2934
     2935
    29282936    QSpacerItem *pSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding);
    29292937    if (pSpacer)
    2930         pSettingsLayout->addItem(pSpacer, 2, 0);
     2938        pSettingsLayout->addItem(pSpacer, 4, 0);
    29312939
    29322940    setLayout(pSettingsLayout);
     
    30603068void UISoftKeyboard::sltKeyCaptionsEdited(UISoftKeyboardKey* pKey)
    30613069{
     3070    Q_UNUSED(pKey);
    30623071    if (m_pKeyboardWidget)
    3063     {
    3064         m_pKeyboardWidget->updateKeyCaptionsInLayout(pKey);
    30653072        m_pKeyboardWidget->update();
    3066     }
    30673073}
    30683074
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