feat(pdf-reader): PDF reader for vertical/infinite scroll layouts and improved responsiveness (#841)
This commit is contained in:
+25
@@ -49,5 +49,30 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<span class="setting-label">{{ t('scrollLayout') }}</span>
|
||||
<div class="button-group">
|
||||
@for (layout of scrollLayouts; track layout) {
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="selectedScrollLayout === layout.key"
|
||||
(click)="selectedScrollLayout = layout.key"
|
||||
[pTooltip]="t(layout.translationKey)"
|
||||
tooltipPosition="bottom">
|
||||
<i [class]="layout.icon"></i>
|
||||
<span class="option-text">{{ t(layout.translationKey) }}</span>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
{{ t('scrollLayoutDesc') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
+14
@@ -33,6 +33,11 @@ export class PdfReaderPreferencesComponent {
|
||||
{name: 'Actual Size', key: 'page-actual', icon: 'pi pi-expand', translationKey: 'actualSize'}
|
||||
];
|
||||
|
||||
readonly scrollLayouts: {name: string; key: 'vertical' | 'horizontal'; icon: string; translationKey: string}[] = [
|
||||
{name: 'Vertical', key: 'vertical', icon: 'pi pi-arrows-v', translationKey: 'vertical'},
|
||||
{name: 'Horizontal', key: 'horizontal', icon: 'pi pi-arrows-h', translationKey: 'horizontal'}
|
||||
];
|
||||
|
||||
get selectedSpread(): 'even' | 'odd' | 'off' {
|
||||
return this.userSettings.pdfReaderSetting.pageSpread;
|
||||
}
|
||||
@@ -50,4 +55,13 @@ export class PdfReaderPreferencesComponent {
|
||||
this.userSettings.pdfReaderSetting.pageZoom = value;
|
||||
this.readerPreferencesService.updatePreference(['pdfReaderSetting', 'pageZoom'], value);
|
||||
}
|
||||
|
||||
get selectedScrollLayout(): 'vertical' | 'horizontal' {
|
||||
return this.userSettings.pdfReaderSetting.scrollLayout ?? 'vertical';
|
||||
}
|
||||
|
||||
set selectedScrollLayout(value: 'vertical' | 'horizontal') {
|
||||
this.userSettings.pdfReaderSetting.scrollLayout = value;
|
||||
this.readerPreferencesService.updatePreference(['pdfReaderSetting', 'scrollLayout'], value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +131,7 @@ export interface PdfReaderSetting {
|
||||
pageSpread: PageSpread;
|
||||
pageZoom: string;
|
||||
showSidebar: boolean;
|
||||
scrollLayout?: 'vertical' | 'horizontal';
|
||||
}
|
||||
|
||||
export enum PdfPageViewMode {
|
||||
|
||||
Reference in New Issue
Block a user