Move custom fonts management to Reader tab (#2161)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
@@ -1,24 +1,4 @@
|
|||||||
<div class="main-container enclosing-container">
|
<div>
|
||||||
<div class="settings-header">
|
|
||||||
<div class="header-content">
|
|
||||||
<div class="header-text">
|
|
||||||
<h2 class="settings-title">
|
|
||||||
<i class="pi pi-palette"></i>
|
|
||||||
Custom Fonts
|
|
||||||
</h2>
|
|
||||||
<p class="settings-description">
|
|
||||||
Upload and manage your own fonts for a personalized reading experience in the EPUB reader.
|
|
||||||
You have {{ customFonts.length }} of {{ maxFonts }} custom fonts.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<p-button
|
|
||||||
label="Add New Font"
|
|
||||||
icon="pi pi-plus"
|
|
||||||
(click)="openUploadDialog()"
|
|
||||||
[disabled]="customFonts.length >= maxFonts"
|
|
||||||
></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="settings-content">
|
<div class="settings-content">
|
||||||
|
|
||||||
@@ -42,14 +22,18 @@
|
|||||||
} @else {
|
} @else {
|
||||||
<div class="preferences-section">
|
<div class="preferences-section">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
|
<div>
|
||||||
<h3 class="section-title">
|
<h3 class="section-title">
|
||||||
<i class="pi pi-book"></i>
|
|
||||||
Your Font Library
|
Your Font Library
|
||||||
<span class="font-count">({{ customFonts.length }})</span>
|
<span class="font-count">({{ customFonts.length }})</span>
|
||||||
</h3>
|
</h3>
|
||||||
<p class="section-description">
|
</div>
|
||||||
Manage your uploaded custom fonts. Each font can be selected in the EPUB reader settings.
|
<p-button
|
||||||
</p>
|
label="Add New Font"
|
||||||
|
icon="pi pi-plus"
|
||||||
|
(click)="openUploadDialog()"
|
||||||
|
[disabled]="customFonts.length >= maxFonts"
|
||||||
|
></p-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fonts-grid">
|
<div class="fonts-grid">
|
||||||
|
|||||||
@@ -65,13 +65,10 @@
|
|||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.preferences-section {
|
|
||||||
@media (min-width: 768px) {
|
|
||||||
padding: 0 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-header {
|
.section-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: space-between;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -33,11 +33,11 @@ export class EpubReaderPreferencesComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
fonts = [
|
fonts = [
|
||||||
{name: 'Book Default', displayName: 'Default', key: null},
|
{name: 'Book Default', displayName: 'Default', key: null},
|
||||||
{name: 'Serif', displayName: 'Aa', key: 'serif'},
|
{name: 'Serif', displayName: 'Serif', key: 'serif'},
|
||||||
{name: 'Sans Serif', displayName: 'Aa', key: 'sans-serif'},
|
{name: 'Sans Serif', displayName: 'Sans Serif', key: 'sans-serif'},
|
||||||
{name: 'Roboto', displayName: 'Aa', key: 'roboto'},
|
{name: 'Roboto', displayName: 'Roboto', key: 'roboto'},
|
||||||
{name: 'Cursive', displayName: 'Aa', key: 'cursive'},
|
{name: 'Cursive', displayName: 'Cursive', key: 'cursive'},
|
||||||
{name: 'Monospace', displayName: 'Aa', key: 'monospace'}
|
{name: 'Monospace', displayName: 'Monospace', key: 'monospace'}
|
||||||
];
|
];
|
||||||
|
|
||||||
readonly flowOptions = [
|
readonly flowOptions = [
|
||||||
|
|||||||
+15
@@ -152,5 +152,20 @@
|
|||||||
</app-cbx-reader-preferences-component>
|
</app-cbx-reader-preferences-component>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="preferences-section">
|
||||||
|
<div class="section-header">
|
||||||
|
<h3 class="section-title">
|
||||||
|
<i class="pi pi-palette"></i>
|
||||||
|
Custom Fonts Management
|
||||||
|
</h3>
|
||||||
|
<p class="section-description">
|
||||||
|
Upload and manage up to 10 custom fonts for a personalized reading experience in the EPUB reader. Each font can then be selected in the EPUB reader settings.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="settings-card">
|
||||||
|
<app-custom-fonts></app-custom-fonts>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
-1
@@ -9,13 +9,14 @@ import {ReaderPreferencesService} from './reader-preferences-service';
|
|||||||
import {EpubReaderPreferencesComponent} from './epub-reader-preferences/epub-reader-preferences-component';
|
import {EpubReaderPreferencesComponent} from './epub-reader-preferences/epub-reader-preferences-component';
|
||||||
import {PdfReaderPreferencesComponent} from './pdf-reader-preferences/pdf-reader-preferences-component';
|
import {PdfReaderPreferencesComponent} from './pdf-reader-preferences/pdf-reader-preferences-component';
|
||||||
import {CbxReaderPreferencesComponent} from './cbx-reader-preferences/cbx-reader-preferences-component';
|
import {CbxReaderPreferencesComponent} from './cbx-reader-preferences/cbx-reader-preferences-component';
|
||||||
|
import {CustomFontsComponent} from '../custom-fonts/custom-fonts.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-reader-preferences',
|
selector: 'app-reader-preferences',
|
||||||
templateUrl: './reader-preferences.component.html',
|
templateUrl: './reader-preferences.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
styleUrls: ['./reader-preferences.component.scss'],
|
styleUrls: ['./reader-preferences.component.scss'],
|
||||||
imports: [FormsModule, TooltipModule, EpubReaderPreferencesComponent, PdfReaderPreferencesComponent, CbxReaderPreferencesComponent]
|
imports: [FormsModule, TooltipModule, EpubReaderPreferencesComponent, PdfReaderPreferencesComponent, CbxReaderPreferencesComponent, CustomFontsComponent]
|
||||||
})
|
})
|
||||||
export class ReaderPreferences implements OnInit, OnDestroy {
|
export class ReaderPreferences implements OnInit, OnDestroy {
|
||||||
readonly scopeOptions = [
|
readonly scopeOptions = [
|
||||||
|
|||||||
@@ -6,9 +6,6 @@
|
|||||||
<p-tab [value]="SettingsTab.ReaderSettings">
|
<p-tab [value]="SettingsTab.ReaderSettings">
|
||||||
<i class="pi pi-book"></i> Reader
|
<i class="pi pi-book"></i> Reader
|
||||||
</p-tab>
|
</p-tab>
|
||||||
<p-tab [value]="SettingsTab.CustomFonts">
|
|
||||||
<i class="pi pi-palette"></i> Custom Fonts
|
|
||||||
</p-tab>
|
|
||||||
<p-tab [value]="SettingsTab.ViewPreferences">
|
<p-tab [value]="SettingsTab.ViewPreferences">
|
||||||
<i class="pi pi-desktop"></i> View
|
<i class="pi pi-desktop"></i> View
|
||||||
</p-tab>
|
</p-tab>
|
||||||
@@ -59,9 +56,6 @@
|
|||||||
<p-tabpanel [value]="SettingsTab.ReaderSettings">
|
<p-tabpanel [value]="SettingsTab.ReaderSettings">
|
||||||
<app-reader-preferences></app-reader-preferences>
|
<app-reader-preferences></app-reader-preferences>
|
||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
<p-tabpanel [value]="SettingsTab.CustomFonts">
|
|
||||||
<app-custom-fonts></app-custom-fonts>
|
|
||||||
</p-tabpanel>
|
|
||||||
<p-tabpanel [value]="SettingsTab.ViewPreferences">
|
<p-tabpanel [value]="SettingsTab.ViewPreferences">
|
||||||
<app-view-preferences-parent></app-view-preferences-parent>
|
<app-view-preferences-parent></app-view-preferences-parent>
|
||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
|
|||||||
@@ -17,11 +17,9 @@ import {DeviceSettingsComponent} from './device-settings/device-settings-compone
|
|||||||
import {LibraryMetadataSettingsComponent} from './library-metadata-settings/library-metadata-settings.component';
|
import {LibraryMetadataSettingsComponent} from './library-metadata-settings/library-metadata-settings.component';
|
||||||
import {PageTitleService} from "../../shared/service/page-title.service";
|
import {PageTitleService} from "../../shared/service/page-title.service";
|
||||||
import {EmailV2Component} from './email-v2/email-v2.component';
|
import {EmailV2Component} from './email-v2/email-v2.component';
|
||||||
import {CustomFontsComponent} from './custom-fonts/custom-fonts.component';
|
|
||||||
|
|
||||||
export enum SettingsTab {
|
export enum SettingsTab {
|
||||||
ReaderSettings = 'reader',
|
ReaderSettings = 'reader',
|
||||||
CustomFonts = 'custom-fonts',
|
|
||||||
ViewPreferences = 'view',
|
ViewPreferences = 'view',
|
||||||
DeviceSettings = 'device',
|
DeviceSettings = 'device',
|
||||||
UserManagement = 'user',
|
UserManagement = 'user',
|
||||||
@@ -49,7 +47,6 @@ export enum SettingsTab {
|
|||||||
AuthenticationSettingsComponent,
|
AuthenticationSettingsComponent,
|
||||||
ViewPreferencesParentComponent,
|
ViewPreferencesParentComponent,
|
||||||
ReaderPreferences,
|
ReaderPreferences,
|
||||||
CustomFontsComponent,
|
|
||||||
MetadataSettingsComponent,
|
MetadataSettingsComponent,
|
||||||
DeviceSettingsComponent,
|
DeviceSettingsComponent,
|
||||||
FileNamingPatternComponent,
|
FileNamingPatternComponent,
|
||||||
|
|||||||
@@ -39,12 +39,6 @@ export function addCustomFontsToDropdown<T extends FontDropdownItem | FontPrefer
|
|||||||
targetArray.splice(separatorIndex, 1);
|
targetArray.splice(separatorIndex, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
(targetArray as FontDropdownItem[]).push({
|
|
||||||
label: '--- Custom Fonts ---',
|
|
||||||
value: 'separator',
|
|
||||||
disabled: true
|
|
||||||
});
|
|
||||||
|
|
||||||
fonts.forEach(font => {
|
fonts.forEach(font => {
|
||||||
(targetArray as FontDropdownItem[]).push({
|
(targetArray as FontDropdownItem[]).push({
|
||||||
label: font.fontName,
|
label: font.fontName,
|
||||||
@@ -57,12 +51,6 @@ export function addCustomFontsToDropdown<T extends FontDropdownItem | FontPrefer
|
|||||||
targetArray.splice(separatorIndex, 1);
|
targetArray.splice(separatorIndex, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
(targetArray as FontPreferenceItem[]).push({
|
|
||||||
name: '--- Custom Fonts ---',
|
|
||||||
displayName: '---',
|
|
||||||
key: 'separator'
|
|
||||||
});
|
|
||||||
|
|
||||||
fonts.forEach(font => {
|
fonts.forEach(font => {
|
||||||
(targetArray as FontPreferenceItem[]).push({
|
(targetArray as FontPreferenceItem[]).push({
|
||||||
name: font.fontName,
|
name: font.fontName,
|
||||||
|
|||||||
Reference in New Issue
Block a user