Improve EPUB Reader: UI Enhancements (Line Height, Letter Spacing, Flow, Fonts)
This commit is contained in:
committed by
Aditya Chandel
parent
fc328a7711
commit
df5ebbe7c4
@@ -93,7 +93,9 @@ public class BookLoreUser {
|
||||
public static class EpubReaderSetting {
|
||||
private String theme;
|
||||
private String font;
|
||||
private int fontSize;
|
||||
private Integer fontSize;
|
||||
private Float letterSpacing;
|
||||
private Float lineHeight;
|
||||
private String flow;
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -11,4 +11,6 @@ public class EpubViewerPreferences {
|
||||
private String font;
|
||||
private String flow;
|
||||
private Integer fontSize;
|
||||
private Float letterSpacing;
|
||||
private Float lineHeight;
|
||||
}
|
||||
+6
@@ -33,6 +33,12 @@ public class EpubViewerPreferencesEntity {
|
||||
@Column(name = "font_size")
|
||||
private Integer fontSize;
|
||||
|
||||
@Column(name = "letter_spacing")
|
||||
private Float letterSpacing;
|
||||
|
||||
@Column(name = "line_height")
|
||||
private Float lineHeight;
|
||||
|
||||
@Column(name = "flow")
|
||||
private String flow;
|
||||
}
|
||||
@@ -138,6 +138,8 @@ public class BookService {
|
||||
.fontSize(epubPref.getFontSize())
|
||||
.theme(epubPref.getTheme())
|
||||
.flow(epubPref.getFlow())
|
||||
.letterSpacing(epubPref.getLetterSpacing())
|
||||
.lineHeight(epubPref.getLineHeight())
|
||||
.build()));
|
||||
} else if (bookEntity.getBookType() == BookFileType.PDF) {
|
||||
pdfViewerPreferencesRepository.findByBookIdAndUserId(bookId, user.getId())
|
||||
@@ -215,6 +217,8 @@ public class BookService {
|
||||
epubPrefs.setFontSize(epubSettings.getFontSize());
|
||||
epubPrefs.setTheme(epubSettings.getTheme());
|
||||
epubPrefs.setFlow(epubSettings.getFlow());
|
||||
epubPrefs.setLetterSpacing(epubSettings.getLetterSpacing());
|
||||
epubPrefs.setLineHeight(epubSettings.getLineHeight());
|
||||
epubViewerPreferencesRepository.save(epubPrefs);
|
||||
|
||||
} else if (bookEntity.getBookType() == BookFileType.CBX) {
|
||||
|
||||
+4
-2
@@ -62,8 +62,10 @@ public class DefaultUserSettingsProvider {
|
||||
private BookLoreUser.UserSettings.EpubReaderSetting buildDefaultEpubReaderSetting() {
|
||||
return BookLoreUser.UserSettings.EpubReaderSetting.builder()
|
||||
.theme("white")
|
||||
.font("serif")
|
||||
.fontSize(150)
|
||||
.font(null)
|
||||
.fontSize(100)
|
||||
.letterSpacing(null)
|
||||
.lineHeight(null)
|
||||
.flow("paginated")
|
||||
.build();
|
||||
}
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE epub_viewer_preference
|
||||
ADD COLUMN letter_spacing FLOAT NULL,
|
||||
ADD COLUMN line_height FLOAT NULL;
|
||||
Reference in New Issue
Block a user