Changeset 43054 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Aug 28, 2012 5:49:54 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserHandlerKeyboard.cpp
r42832 r43054 56 56 /* Key UP? */ 57 57 case Qt::Key_Up: 58 /* Key HOME? */ 59 case Qt::Key_Home: 58 60 { 59 61 /* Not during sliding: */ … … 77 79 if (iFocusPosition > 0) 78 80 { 79 items.move(iFocusPosition, iFocusPosition - 1); 81 if (pEvent->key() == Qt::Key_Up) 82 items.move(iFocusPosition, iFocusPosition - 1); 83 else if (pEvent->key() == Qt::Key_Home) 84 items.move(iFocusPosition, 0); 80 85 pParentItem->setItems(items, type); 81 86 model()->updateNavigation(); … … 96 101 int iPosition = model()->navigationList().indexOf(model()->focusItem()); 97 102 /* Determine 'previous' item: */ 98 UIGChooserItem *pPreviousItem = iPosition > 0 ? 99 model()->navigationList().at(iPosition - 1) : 0; 103 UIGChooserItem *pPreviousItem = 0; 104 if (iPosition > 0) 105 { 106 if (pEvent->key() == Qt::Key_Up) 107 pPreviousItem = model()->navigationList().at(iPosition - 1); 108 else if (pEvent->key() == Qt::Key_Home) 109 pPreviousItem = model()->navigationList().first(); 110 } 100 111 if (pPreviousItem) 101 112 { … … 133 144 int iPosition = model()->navigationList().indexOf(model()->focusItem()); 134 145 /* Determine 'previous' item: */ 135 UIGChooserItem *pPreviousItem = iPosition > 0 ? 136 model()->navigationList().at(iPosition - 1) : 0; 146 UIGChooserItem *pPreviousItem = 0; 147 if (iPosition > 0) 148 { 149 if (pEvent->key() == Qt::Key_Up) 150 pPreviousItem = model()->navigationList().at(iPosition - 1); 151 else if (pEvent->key() == Qt::Key_Home) 152 pPreviousItem = model()->navigationList().first(); 153 } 137 154 if (pPreviousItem) 138 155 { … … 155 172 /* Key DOWN? */ 156 173 case Qt::Key_Down: 174 /* Key END? */ 175 case Qt::Key_End: 157 176 { 158 177 /* Not during sliding: */ … … 176 195 if (iFocusPosition < items.size() - 1) 177 196 { 178 items.move(iFocusPosition, iFocusPosition + 1); 197 if (pEvent->key() == Qt::Key_Down) 198 items.move(iFocusPosition, iFocusPosition + 1); 199 else if (pEvent->key() == Qt::Key_End) 200 items.move(iFocusPosition, items.size() - 1); 179 201 pParentItem->setItems(items, type); 180 202 model()->updateNavigation(); … … 195 217 int iPosition = model()->navigationList().indexOf(model()->focusItem()); 196 218 /* Determine 'next' item: */ 197 UIGChooserItem *pNextItem = iPosition < model()->navigationList().size() - 1 ? 198 model()->navigationList().at(iPosition + 1) : 0; 219 UIGChooserItem *pNextItem = 0; 220 if (iPosition < model()->navigationList().size() - 1) 221 { 222 if (pEvent->key() == Qt::Key_Down) 223 pNextItem = model()->navigationList().at(iPosition + 1); 224 else if (pEvent->key() == Qt::Key_End) 225 pNextItem = model()->navigationList().last(); 226 } 199 227 if (pNextItem) 200 228 { … … 232 260 int iPosition = model()->navigationList().indexOf(model()->focusItem()); 233 261 /* Determine 'next' item: */ 234 UIGChooserItem *pNextItem = iPosition < model()->navigationList().size() - 1 ? 235 model()->navigationList().at(iPosition + 1) : 0; 262 UIGChooserItem *pNextItem = 0; 263 if (iPosition < model()->navigationList().size() - 1) 264 { 265 if (pEvent->key() == Qt::Key_Down) 266 pNextItem = model()->navigationList().at(iPosition + 1); 267 else if (pEvent->key() == Qt::Key_End) 268 pNextItem = model()->navigationList().last(); 269 } 236 270 if (pNextItem) 237 271 {
Note:
See TracChangeset
for help on using the changeset viewer.