Created
January 19, 2019 05:54
-
-
Save SunXiaoShan/2a17a9593c7ee672d05dd839fd4df7df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool moveHighlight(DirectionType direction) { | |
bool moved = false; | |
Widget *currentHighlightedWidget = getHighlightedWidget(); | |
// 若目前沒有 highlight,嘗試尋找一個可以被 highlight 的物件 | |
if (NULL == currentHighlightedWidget) { | |
setupHighlighted(); | |
moved = hasHighlightedWidget(); | |
return moved; | |
} | |
// 尋找若以該 Parent Widget 作為 panel,上面是否含有可以被 highlight 的 Widget | |
Widget* parentWidget = currentHighlightedWidget->parentWidget; | |
if (!moved) { | |
moved = parentWidget->moveHighlight( direction ); | |
} | |
// 若在沒有,則尋找若以該 Widget 作為 panel,上面是否含有可以被 highlight 的 Widget | |
if (!moved) { | |
moved = widget->moveHighlight( aDirection ); | |
} | |
return moved; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment