diff --git a/preferences/Resources/PriorityHub.plist b/preferences/Resources/PriorityHub.plist index 4bc12bf..7ea7e6d 100644 --- a/preferences/Resources/PriorityHub.plist +++ b/preferences/Resources/PriorityHub.plist @@ -67,11 +67,15 @@ items = ( label = "Icon Location"; validValues = ( 0, - 1 + 1, + 2, + 3 ); validTitles = ( "Top", - "Bottom" + "Bottom", + "Left", + "Right" ); }, { diff --git a/source/PHContainerView.xm b/source/PHContainerView.xm index 030ab6a..5358a40 100644 --- a/source/PHContainerView.xm +++ b/source/PHContainerView.xm @@ -54,16 +54,29 @@ } //Layout all app views - CGFloat totalWidth = [[appViews allKeys] count] * [self appViewSize].width; - self.contentSize = CGSizeMake(totalWidth, [self appViewSize].height); - CGFloat startX = (CGRectGetWidth(self.frame) - totalWidth)/2; - if (startX < 0) - startX = 0; - - for (PHAppView *appView in [appViews allValues]) { - appView.frame = CGRectMake(startX, 0, [self appViewSize].width, [self appViewSize].height); - startX += [self appViewSize].width; - } + if ( [defaults integerForKey:@"iconLocation"] < 2) { + CGFloat totalWidth = [[appViews allKeys] count] * [self appViewSize].width; + self.contentSize = CGSizeMake(totalWidth, [self appViewSize].height); + CGFloat startX = (CGRectGetWidth(self.frame) - totalWidth)/2; + if (startX < 0) + startX = 0; + + for (PHAppView *appView in [appViews allValues]) { + appView.frame = CGRectMake(startX, 0, [self appViewSize].width, [self appViewSize].height); + startX += [self appViewSize].width; + } + } else { + CGFloat totalHeight = [[appViews allKeys] count] * [self appViewSize].height; + self.contentSize = CGSizeMake([self appViewSize].width, totalHeight); + CGFloat startY = (CGRectGetHeight(self.frame) - totalHeight)/2; + if (startY < 0) + startY = 0; + + for (PHAppView *appView in [appViews allValues]) { + appView.frame = CGRectMake(0, startY, [self appViewSize].width, [self appViewSize].height); + startY += [self appViewSize].height; + } + } //Update selected view location if (selectedView.alpha == 1 && selectedAppID && [appViews objectForKey:selectedAppID]) diff --git a/source/Tweak.xm b/source/Tweak.xm index d2b3ee5..1eba60c 100644 --- a/source/Tweak.xm +++ b/source/Tweak.xm @@ -191,10 +191,15 @@ void showTestNotification() { containerView.frame = CGRectMake(containerView.frame.origin.x, containerView.frame.origin.y + verticalAdjustmentTop, containerView.frame.size.width, containerView.frame.size.height - verticalAdjustmentTop + verticalAdjustmentBottom); //Layout PHContainerView and notifications table view - if ([defaults integerForKey:@"iconLocation"] == 0) //App icons at top + int iconLocation = [defaults integerForKey:@"iconLocation"]; + if (iconLocation == 0) //App icons at top CGRectDivide(containerView.bounds, &phContainerViewFrame, &tableViewFrame, [phContainerView appViewSize].height, CGRectMinYEdge); - else //App icons at bottom + else if (iconLocation == 1)//App icons at bottom CGRectDivide(containerView.bounds, &phContainerViewFrame, &tableViewFrame, [phContainerView appViewSize].height, CGRectMaxYEdge); + else if (iconLocation == 2)//App icons at left + CGRectDivide(containerView.bounds, &phContainerViewFrame, &tableViewFrame, [phContainerView appViewSize].width, CGRectMinXEdge); + else //App icons at right + CGRectDivide(containerView.bounds, &phContainerViewFrame, &tableViewFrame, [phContainerView appViewSize].width, CGRectMaxXEdge); phContainerView.frame = phContainerViewFrame; notificationsTableView.frame = tableViewFrame;