Skip to content

Commit

Permalink
macosx: Fix configuration of placeholder image view constraints in gr…
Browse files Browse the repository at this point in the history
…oups view controller

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra authored and fkuehne committed Oct 8, 2024
1 parent d5c1e55 commit 6288393
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@

#import "main/VLCMain.h"

@interface VLCLibraryGroupsViewController ()
{
NSArray<NSLayoutConstraint *> *_internalPlaceholderImageViewSizeConstraints;
}
@end

@implementation VLCLibraryGroupsViewController

- (instancetype)initWithLibraryWindow:(VLCLibraryWindow *)libraryWindow
Expand All @@ -51,6 +57,7 @@ - (instancetype)initWithLibraryWindow:(VLCLibraryWindow *)libraryWindow
[self setupDataSource];
[self setupGridViewModeViews];
[self setupListViewModeViews];
[self setupPlaceholderView];
}
return self;
}
Expand Down Expand Up @@ -191,11 +198,36 @@ - (void)setupListViewModeViews
self.selectedGroupTableView.dataSource = self.dataSource;
}

- (void)setupPlaceholderView
{
_internalPlaceholderImageViewSizeConstraints = @[
[NSLayoutConstraint constraintWithItem:self.placeholderImageView
attribute:NSLayoutAttributeWidth
relatedBy:NSLayoutRelationEqual
toItem:nil
attribute:NSLayoutAttributeNotAnAttribute
multiplier:0.f
constant:182.f],
[NSLayoutConstraint constraintWithItem:self.placeholderImageView
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:nil
attribute:NSLayoutAttributeNotAnAttribute
multiplier:0.f
constant:114.f],
];
}

- (id<VLCLibraryDataSource>)currentDataSource
{
return self.dataSource;
}

- (NSArray<NSLayoutConstraint *> *)placeholderImageViewSizeConstraints
{
return _internalPlaceholderImageViewSizeConstraints;
}

- (void)presentPlaceholderGroupsView
{
NSArray<NSLayoutConstraint *> * const oldViewPlaceholderConstraints =
Expand Down

0 comments on commit 6288393

Please sign in to comment.