Browse Source

macosx: Update visibility of buttons depending on current button in carousel views

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
pull/162/head
Claudio Cambra 2 years ago
committed by Felix Paul Kühne
parent
commit
e057cefeb3
  1. 11
      modules/gui/macosx/library/home-library/VLCLibraryHomeViewBaseCarouselContainerView.m

11
modules/gui/macosx/library/home-library/VLCLibraryHomeViewBaseCarouselContainerView.m

@ -143,6 +143,7 @@
[self updateCarouselViewHeight];
[self updateCarouselOffset];
[self updateCarouselButtonVisibility];
}
- (void)connect
@ -178,6 +179,14 @@
self.carouselView.contentOffset = NSMakeSize(horizontalOffset, 0);
}
- (void)updateCarouselButtonVisibility
{
const NSInteger currentItemIndex = self.carouselView.currentItemIndex;
const NSInteger numberOfItems = self.carouselView.numberOfItems;
self.leftButton.hidden = currentItemIndex == 0;
self.rightButton.hidden = currentItemIndex == numberOfItems - 1;
}
- (void)resizeWithOldSuperviewSize:(NSSize)oldSize
{
[super resizeWithOldSuperviewSize:oldSize];
@ -263,6 +272,8 @@
self.selectedItemView.selected = NO;
carouselItemView.selected = YES;
self.selectedItemView = carouselItemView;
[self updateCarouselButtonVisibility];
}
- (void)carousel:(iCarousel *)carousel didSelectItemAtIndex:(NSInteger)index

Loading…
Cancel
Save