Добавлена возможность автосокрытия панели при прокрутке
This commit is contained in:
@@ -141,6 +141,7 @@
|
|||||||
@load-file="loadFile"
|
@load-file="loadFile"
|
||||||
@book-pos-changed="bookPosChanged"
|
@book-pos-changed="bookPosChanged"
|
||||||
@do-action="doAction"
|
@do-action="doAction"
|
||||||
|
@hide-tool-bar="hideToolBar"
|
||||||
></component>
|
></component>
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
|
|
||||||
@@ -348,6 +349,13 @@ class Reader {
|
|||||||
this.debouncedSetRecentBook(newValue);
|
this.debouncedSetRecentBook(newValue);
|
||||||
}, 15000, {maxWait: 20000});
|
}, 15000, {maxWait: 20000});
|
||||||
|
|
||||||
|
this.debouncedHideToolBar = _.debounce((event) => {
|
||||||
|
if (this.toolBarHideOnScroll && this.toolBarActive !== !!event.show) {
|
||||||
|
this.commit('reader/setToolBarActive', !!event.show);
|
||||||
|
this.$root.eventHook('resize');
|
||||||
|
}
|
||||||
|
}, 200);
|
||||||
|
|
||||||
document.addEventListener('fullscreenchange', () => {
|
document.addEventListener('fullscreenchange', () => {
|
||||||
this.fullScreenActive = (document.fullscreenElement !== null);
|
this.fullScreenActive = (document.fullscreenElement !== null);
|
||||||
});
|
});
|
||||||
@@ -405,6 +413,7 @@ class Reader {
|
|||||||
this.clickControlActive = this.clickControl;
|
this.clickControlActive = this.clickControl;
|
||||||
this.blinkCachedLoad = settings.blinkCachedLoad;
|
this.blinkCachedLoad = settings.blinkCachedLoad;
|
||||||
this.showToolButton = settings.showToolButton;
|
this.showToolButton = settings.showToolButton;
|
||||||
|
this.toolBarHideOnScroll = settings.toolBarHideOnScroll;
|
||||||
this.enableSitesFilter = settings.enableSitesFilter;
|
this.enableSitesFilter = settings.enableSitesFilter;
|
||||||
this.showNeedUpdateNotify = settings.showNeedUpdateNotify;
|
this.showNeedUpdateNotify = settings.showNeedUpdateNotify;
|
||||||
this.splitToPara = settings.splitToPara;
|
this.splitToPara = settings.splitToPara;
|
||||||
@@ -665,6 +674,10 @@ class Reader {
|
|||||||
this.$root.eventHook('resize');
|
this.$root.eventHook('resize');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hideToolBar(event) {
|
||||||
|
this.debouncedHideToolBar(event);
|
||||||
|
}
|
||||||
|
|
||||||
fullScreenToggle() {
|
fullScreenToggle() {
|
||||||
this.fullScreenActive = !this.fullScreenActive;
|
this.fullScreenActive = !this.fullScreenActive;
|
||||||
if (this.fullScreenActive) {
|
if (this.fullScreenActive) {
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
<div class="part-header">Показывать кнопки панели</div>
|
|
||||||
|
|
||||||
<div class="item row" v-for="item in toolButtons" :key="item.name" v-show="item.name != 'libs' || mode == 'liberama.top'">
|
|
||||||
<div class="label-3"></div>
|
|
||||||
<div class="col row">
|
|
||||||
<q-checkbox size="xs" v-model="showToolButton[item.name]" :label="rstore.readerActions[item.name]"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<div v-show="tabsScrollable" class="q-pt-lg" />
|
<div v-show="tabsScrollable" class="q-pt-lg" />
|
||||||
<q-tab class="tab" name="profiles" icon="la la-users" label="Профили" />
|
<q-tab class="tab" name="profiles" icon="la la-users" label="Профили" />
|
||||||
<q-tab class="tab" name="view" icon="la la-eye" label="Вид" />
|
<q-tab class="tab" name="view" icon="la la-eye" label="Вид" />
|
||||||
<q-tab class="tab" name="buttons" icon="la la-grip-horizontal" label="Кнопки" />
|
<q-tab class="tab" name="toolbar" icon="la la-grip-horizontal" label="Панель" />
|
||||||
<q-tab class="tab" name="keys" icon="la la-gamepad" label="Управление" />
|
<q-tab class="tab" name="keys" icon="la la-gamepad" label="Управление" />
|
||||||
<q-tab class="tab" name="pagemove" icon="la la-school" label="Листание" />
|
<q-tab class="tab" name="pagemove" icon="la la-school" label="Листание" />
|
||||||
<q-tab class="tab" name="convert" icon="la la-magic" label="Конвертир." />
|
<q-tab class="tab" name="convert" icon="la la-magic" label="Конвертир." />
|
||||||
@@ -82,8 +82,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Кнопки ---------------------------------------------------------------------->
|
<!-- Кнопки ---------------------------------------------------------------------->
|
||||||
<div v-if="selectedTab == 'buttons'" class="fit tab-panel">
|
<div v-if="selectedTab == 'toolbar'" class="fit tab-panel">
|
||||||
@@include('./ButtonsTab.inc');
|
@@include('./ToolBarTab.inc');
|
||||||
</div>
|
</div>
|
||||||
<!-- Управление ------------------------------------------------------------------>
|
<!-- Управление ------------------------------------------------------------------>
|
||||||
<div v-if="selectedTab == 'keys'" class="fit column">
|
<div v-if="selectedTab == 'keys'" class="fit column">
|
||||||
@@ -702,11 +702,11 @@ export default vueComponent(SettingsPage);
|
|||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.label-1, .label-7 {
|
.label-1, .label-3, .label-7 {
|
||||||
width: 75px;
|
width: 75px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.label-2, .label-3, .label-4, .label-5 {
|
.label-2, .label-4, .label-5 {
|
||||||
width: 110px;
|
width: 110px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
18
client/components/Reader/SettingsPage/ToolBarTab.inc
Normal file
18
client/components/Reader/SettingsPage/ToolBarTab.inc
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<div class="part-header">Отображение</div>
|
||||||
|
|
||||||
|
<div class="item row no-wrap">
|
||||||
|
<div class="label-3"></div>
|
||||||
|
<q-checkbox size="xs" v-model="toolBarHideOnScroll" label="Скрывать/показывать панель при прокрутке" >
|
||||||
|
<q-tooltip :delay="1000" anchor="top middle" self="bottom middle" content-style="font-size: 80%">
|
||||||
|
Скрывать/показывть панель при прокрутке текста вперед/назад
|
||||||
|
</q-tooltip>
|
||||||
|
</q-checkbox>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="part-header">Показывать кнопки</div>
|
||||||
|
|
||||||
|
<div class="item row no-wrap" v-for="item in toolButtons" :key="item.name" v-show="item.name != 'libs' || mode == 'liberama.top'">
|
||||||
|
<div class="label-3"></div>
|
||||||
|
<q-checkbox size="xs" v-model="showToolButton[item.name]" :label="rstore.readerActions[item.name]"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
@@ -66,7 +66,14 @@ const componentOptions = {
|
|||||||
watch: {
|
watch: {
|
||||||
bookPos: function() {
|
bookPos: function() {
|
||||||
this.$emit('book-pos-changed', {bookPos: this.bookPos, bookPosSeen: this.bookPosSeen});
|
this.$emit('book-pos-changed', {bookPos: this.bookPos, bookPosSeen: this.bookPosSeen});
|
||||||
|
|
||||||
this.draw();
|
this.draw();
|
||||||
|
|
||||||
|
if (this.userBookPosChange) {
|
||||||
|
this.$emit('hide-tool-bar', {show: (this.bookPos == 0 || this.bookPos < this.prevBookPos)});
|
||||||
|
this.prevBookPos = this.bookPos;
|
||||||
|
this.userBookPosChange = false;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
bookPosSeen: function() {
|
bookPosSeen: function() {
|
||||||
this.$emit('book-pos-changed', {bookPos: this.bookPos, bookPosSeen: this.bookPosSeen});
|
this.$emit('book-pos-changed', {bookPos: this.bookPos, bookPosSeen: this.bookPosSeen});
|
||||||
@@ -99,6 +106,8 @@ class TextPage {
|
|||||||
lastBook = null;
|
lastBook = null;
|
||||||
bookPos = 0;
|
bookPos = 0;
|
||||||
bookPosSeen = null;
|
bookPosSeen = null;
|
||||||
|
prevBookPos = 0;
|
||||||
|
userBookPosChange = false;
|
||||||
|
|
||||||
fontStyle = null;
|
fontStyle = null;
|
||||||
fontSize = null;
|
fontSize = null;
|
||||||
@@ -652,7 +661,7 @@ class TextPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.book && this.bookPos > 0 && this.bookPos >= this.parsed.textLength) {
|
if (this.book && this.bookPos > 0 && this.bookPos >= this.parsed.textLength) {
|
||||||
this.doEnd(true);
|
this.doEnd(true, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -675,7 +684,7 @@ class TextPage {
|
|||||||
this.debouncedDrawPageDividerAndOrnament();
|
this.debouncedDrawPageDividerAndOrnament();
|
||||||
|
|
||||||
if (this.book && this.linesDown && this.linesDown.length < this.pageLineCount) {
|
if (this.book && this.linesDown && this.linesDown.length < this.pageLineCount) {
|
||||||
this.doEnd(true);
|
this.doEnd(true, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -911,12 +920,14 @@ class TextPage {
|
|||||||
|
|
||||||
doDown() {
|
doDown() {
|
||||||
if (this.linesDown && this.linesDown.length > this.pageLineCount && this.pageLineCount > 0) {
|
if (this.linesDown && this.linesDown.length > this.pageLineCount && this.pageLineCount > 0) {
|
||||||
|
this.userBookPosChange = true;
|
||||||
this.bookPos = this.linesDown[1].begin;
|
this.bookPos = this.linesDown[1].begin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
doUp() {
|
doUp() {
|
||||||
if (this.linesUp && this.linesUp.length > 1 && this.pageLineCount > 0) {
|
if (this.linesUp && this.linesUp.length > 1 && this.pageLineCount > 0) {
|
||||||
|
this.userBookPosChange = true;
|
||||||
this.bookPos = this.linesUp[1].begin;
|
this.bookPos = this.linesUp[1].begin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -929,6 +940,7 @@ class TextPage {
|
|||||||
if (i >= 0 && this.linesDown.length >= 2*i + (this.keepLastToFirst ? 1 : 0)) {
|
if (i >= 0 && this.linesDown.length >= 2*i + (this.keepLastToFirst ? 1 : 0)) {
|
||||||
this.currentAnimation = this.pageChangeAnimation;
|
this.currentAnimation = this.pageChangeAnimation;
|
||||||
this.pageChangeDirectionDown = true;
|
this.pageChangeDirectionDown = true;
|
||||||
|
this.userBookPosChange = true;
|
||||||
this.bookPos = this.linesDown[i].begin;
|
this.bookPos = this.linesDown[i].begin;
|
||||||
} else
|
} else
|
||||||
this.doEnd();
|
this.doEnd();
|
||||||
@@ -944,6 +956,7 @@ class TextPage {
|
|||||||
if (i >= 0 && this.linesUp.length > i) {
|
if (i >= 0 && this.linesUp.length > i) {
|
||||||
this.currentAnimation = this.pageChangeAnimation;
|
this.currentAnimation = this.pageChangeAnimation;
|
||||||
this.pageChangeDirectionDown = false;
|
this.pageChangeDirectionDown = false;
|
||||||
|
this.userBookPosChange = true;
|
||||||
this.bookPos = this.linesUp[i].begin;
|
this.bookPos = this.linesUp[i].begin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -952,10 +965,11 @@ class TextPage {
|
|||||||
doHome() {
|
doHome() {
|
||||||
this.currentAnimation = this.pageChangeAnimation;
|
this.currentAnimation = this.pageChangeAnimation;
|
||||||
this.pageChangeDirectionDown = false;
|
this.pageChangeDirectionDown = false;
|
||||||
|
this.userBookPosChange = true;
|
||||||
this.bookPos = 0;
|
this.bookPos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
doEnd(noAni) {
|
doEnd(noAni, isUser = true) {
|
||||||
if (this.parsed.para.length && this.pageLineCount > 0) {
|
if (this.parsed.para.length && this.pageLineCount > 0) {
|
||||||
let i = this.parsed.para.length - 1;
|
let i = this.parsed.para.length - 1;
|
||||||
let lastPos = this.parsed.para[i].offset + this.parsed.para[i].length - 1;
|
let lastPos = this.parsed.para[i].offset + this.parsed.para[i].length - 1;
|
||||||
@@ -966,6 +980,7 @@ class TextPage {
|
|||||||
if (!noAni)
|
if (!noAni)
|
||||||
this.currentAnimation = this.pageChangeAnimation;
|
this.currentAnimation = this.pageChangeAnimation;
|
||||||
this.pageChangeDirectionDown = true;
|
this.pageChangeDirectionDown = true;
|
||||||
|
this.userBookPosChange = isUser;
|
||||||
this.bookPos = lines[i].begin;
|
this.bookPos = lines[i].begin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ const settingDefaults = {
|
|||||||
|
|
||||||
fontShifts: {},
|
fontShifts: {},
|
||||||
showToolButton: {},
|
showToolButton: {},
|
||||||
|
toolBarHideOnScroll: true,
|
||||||
userHotKeys: {},
|
userHotKeys: {},
|
||||||
userWallpapers: [],
|
userWallpapers: [],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user