VirtualBox

Changeset 42583 in vbox


Ignore:
Timestamp:
Aug 3, 2012 2:39:35 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: 6234: Support for VM groups: Using space key to expand/collapse chosen group.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserHandlerKeyboard.cpp

    r42543 r42583  
    2424#include "UIGChooserHandlerKeyboard.h"
    2525#include "UIGChooserModel.h"
     26#include "UIGChooserItemGroup.h"
    2627
    2728UIGChooserHandlerKeyboard::UIGChooserHandlerKeyboard(UIGChooserModel *pParent)
     
    233234            return true;
    234235        }
     236        case Qt::Key_Space:
     237        {
     238            /* If there is a focus item: */
     239            if (UIGChooserItem *pFocusItem = model()->focusItem())
     240            {
     241                /* Of the group type: */
     242                if (pFocusItem->type() == UIGChooserItemType_Group)
     243                {
     244                    /* Toggle that group: */
     245                    UIGChooserItemGroup *pGroupItem = pFocusItem->toGroupItem();
     246                    if (pGroupItem->closed())
     247                        pGroupItem->open();
     248                    else
     249                        pGroupItem->close();
     250                    /* Filter that event out: */
     251                    return true;
     252                }
     253            }
     254            /* Pass event to other items: */
     255            return false;
     256        }
    235257        default:
    236258            break;
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