Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Classes/EPubSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ typedef enum {
@property (nonatomic, assign) EPubSettingsSyntheticSpread syntheticSpread;

+ (EPubSettings *)shared;
- (void) update;

@end
8 changes: 4 additions & 4 deletions Classes/EPubSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ - (CGFloat)columnGap {
}


- (void) update {
[self postNotification];
}

- (NSDictionary *)dictionary {
EPubSettingsScroll scroll = [Settings shared].scroll;
EPubSettingsSyntheticSpread syntheticSpread = [Settings shared].syntheticSpread;
Expand Down Expand Up @@ -91,31 +95,27 @@ - (EPubSettingsScroll)scroll {
- (void)setColumnGap:(CGFloat)columnGap {
if ([Settings shared].columnGap != columnGap) {
[Settings shared].columnGap = columnGap;
[self postNotification];
}
}


- (void)setFontScale:(CGFloat)fontScale {
if ([Settings shared].fontScale != fontScale) {
[Settings shared].fontScale = fontScale;
[self postNotification];
}
}


- (void)setScroll:(EPubSettingsScroll)scroll {
if ([Settings shared].scroll != scroll) {
[Settings shared].scroll = scroll;
[self postNotification];
}
}


- (void)setSyntheticSpread:(EPubSettingsSyntheticSpread)syntheticSpread {
if ([Settings shared].syntheticSpread != syntheticSpread) {
[Settings shared].syntheticSpread = syntheticSpread;
[self postNotification];
}
}

Expand Down
5 changes: 5 additions & 0 deletions Classes/EPubSettingsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,18 @@ - (void)loadView {

- (void)onColumnGapDidChange:(UIStepper *)stepper {
[EPubSettings shared].columnGap = stepper.value;
[self updateCells];
}


- (void)onFontScaleDidChange:(UIStepper *)stepper {
[EPubSettings shared].fontScale = stepper.value;
[self updateCells];
}


- (void)onTapDone {
[[EPubSettings shared] update];
[self dismissViewControllerAnimated:YES completion:nil];
}

Expand Down Expand Up @@ -241,6 +244,8 @@ - (void)onTapDone {
else if (cell == m_cellSyntheticSpreadSingle) {
[EPubSettings shared].syntheticSpread = EPubSettingsSyntheticSpreadSingle;
}

[self updateCells];
}


Expand Down