Skip to content

Commit

Permalink
Driver gallery browsing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rider committed Jan 12, 2019
1 parent c538592 commit 65552b9
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -112,6 +112,7 @@ public void focusGained(FocusEvent e) {
}

private void createDriverGallery() {
int oldItemCount = gallery.getItemCount();
gallery.removeAll();

GalleryItem groupRecent = new GalleryItem(gallery, SWT.NONE);
Expand All @@ -132,8 +133,10 @@ private void createDriverGallery() {
}
fillDriverGroup(groupAll);

gallery.setFocus();
gallery.setSelection(new GalleryItem[] { gallery.getItem(0) } );
if (oldItemCount == 0) {
gallery.setFocus();
gallery.setSelection(new GalleryItem[]{gallery.getItem(0)});
}
}

private void fillDriverGroup(GalleryItem group) {
Expand Down

0 comments on commit 65552b9

Please sign in to comment.