From e8d1817566cbcde9a57eb99d413ba96dd427088f Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 13 Oct 2022 20:29:19 +0700 Subject: [PATCH] =?UTF-8?q?=D0=93=D0=BB=D0=BE=D0=B1=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9=20=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3=20SettingsPage=20(=D0=B2=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=86=D0=B5=D1=81=D1=81=D0=B5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reader/SettingsPage/SettingsPage.vue | 88 ++------- .../Reader/SettingsPage/ViewTab/Color.inc | 121 ------------ .../SettingsPage/ViewTab/Color/Color.vue | 7 +- .../Reader/SettingsPage/ViewTab/Font.inc | 56 ------ .../Reader/SettingsPage/ViewTab/Font/Font.vue | 176 ++++++++++++++++++ .../Reader/SettingsPage/ViewTab/Mode/Mode.vue | 7 +- .../Reader/SettingsPage/ViewTab/ViewTab.vue | 11 +- 7 files changed, 209 insertions(+), 257 deletions(-) delete mode 100644 client/components/Reader/SettingsPage/ViewTab/Color.inc delete mode 100644 client/components/Reader/SettingsPage/ViewTab/Font.inc create mode 100644 client/components/Reader/SettingsPage/ViewTab/Font/Font.vue diff --git a/client/components/Reader/SettingsPage/SettingsPage.vue b/client/components/Reader/SettingsPage/SettingsPage.vue index e4bbaee6..f2e1ccec 100644 --- a/client/components/Reader/SettingsPage/SettingsPage.vue +++ b/client/components/Reader/SettingsPage/SettingsPage.vue @@ -9,7 +9,8 @@ - - - - - - - - - + + +
+ {{ item.label }} +
+
@@ -108,30 +106,6 @@ const componentOptions = { }, deep: true, }, - fontBold: function(newValue) { - this.fontWeight = (newValue ? 'bold' : ''); - }, - fontItalic: function(newValue) { - this.fontStyle = (newValue ? 'italic' : ''); - }, - vertShift: function(newValue) { - const font = (this.webFontName ? this.webFontName : this.fontName); - if (this.fontShifts[font] != newValue || this.fontVertShift != newValue) { - this.fontShifts = Object.assign({}, this.fontShifts, {[font]: newValue}); - this.fontVertShift = newValue; - } - }, - fontName: function(newValue) { - const font = (this.webFontName ? this.webFontName : newValue); - this.vertShift = this.fontShifts[font] || 0; - }, - webFontName: function(newValue) { - const font = (newValue ? newValue : this.fontName); - this.vertShift = this.fontShifts[font] || 0; - }, - textColor: function(newValue) { - this.textColorFiltered = newValue; - }, statusBarColor(newValue) { this.statusBarColorFiltered = newValue; }, @@ -146,21 +120,27 @@ class SettingsPage { form = {}; + tabs = [ + { name: 'profiles', icon: 'la la-users', label: 'Профили' }, + { name: 'view', icon: 'la la-eye', label: 'Вид'}, + { name: 'toolbar', icon: 'la la-grip-horizontal', label: 'Панель'}, + { name: 'keys', icon: 'la la-gamepad', label: 'Управление'}, + { name: 'pagemove', icon: 'la la-school', label: 'Листание'}, + { name: 'convert', icon: 'la la-magic', label: 'Конвертир.'}, + { name: 'update', icon: 'la la-retweet', label: 'Обновление'}, + { name: 'others', icon: 'la la-list-ul', label: 'Прочее'}, + { name: 'reset', icon: 'la la-broom', label: 'Сброс'}, + ]; selectedTab = 'profiles'; isSetsChanged = false; - fontBold = false; - fontItalic = false; - vertShift = 0; statusBarColorFiltered = ''; - webFonts = []; - fonts = []; created() { this.commit = this.$store.commit; - this.debouncedCommitSettings = _.debounce(() => { + this.debouncedCommitSettings = _.debounce(() => { this.commit('reader/setSettings', _.cloneDeep(this.form)); }, 50); @@ -181,14 +161,6 @@ class SettingsPage { this.form = reactive(_.cloneDeep(this.settings)); const form = this.form; - this.fontBold = (form.fontWeight == 'bold'); - this.fontItalic = (form.fontStyle == 'italic'); - - this.fonts = rstore.fonts; - this.webFonts = rstore.webFonts; - const font = (form.webFontName ? form.webFontName : form.fontName); - this.vertShift = form.fontShifts[font] || 0; - this.dualDivColorFiltered = form.dualDivColor; this.statusBarColorFiltered = form.statusBarColor; } finally { await this.$nextTick(); @@ -200,30 +172,10 @@ class SettingsPage { return this.$store.state.reader.settings; } - get fontsOptions() { - let result = []; - this.fonts.forEach(font => { - result.push({label: (font.label ? font.label : font.name), value: font.name}); - }); - return result; - } - - get webFontsOptions() { - let result = [{label: 'Нет', value: ''}]; - this.webFonts.forEach(font => { - result.push({label: font.name, value: font.name}); - }); - return result; - } - needReload() { this.$root.notify.warning('Необходимо обновить страницу (F5), чтобы изменения возымели эффект'); } - needTextReload() { - this.$root.notify.warning('Необходимо обновить книгу в обход кэша, чтобы изменения возымели эффект'); - } - close() { this.$emit('do-action', {action: 'settings'}); } diff --git a/client/components/Reader/SettingsPage/ViewTab/Color.inc b/client/components/Reader/SettingsPage/ViewTab/Color.inc deleted file mode 100644 index c438cc73..00000000 --- a/client/components/Reader/SettingsPage/ViewTab/Color.inc +++ /dev/null @@ -1,121 +0,0 @@ - - - -
-
- Текст -
-
- - - -
-
- -
-
-
- Фон -
-
- - - -
-
- -
-
-
- Обои -
-
- - - - - - -
- - - Добавить файл обоев - - - - - Удалить выбранные обои - - - - - Скачать выбранные обои - - -
-
- -
-
-
-
- -
-
- - diff --git a/client/components/Reader/SettingsPage/ViewTab/Color/Color.vue b/client/components/Reader/SettingsPage/ViewTab/Color/Color.vue index 7113addd..568a794b 100644 --- a/client/components/Reader/SettingsPage/ViewTab/Color/Color.vue +++ b/client/components/Reader/SettingsPage/ViewTab/Color/Color.vue @@ -145,8 +145,11 @@ const componentOptions = { components: { }, watch: { - form() { - this.formChanged();//no await + form: { + handler() { + this.formChanged();//no await + }, + deep: true, }, textColorFiltered(newValue) { if (!this.isFormChanged && this.helper.isHexColor(newValue)) diff --git a/client/components/Reader/SettingsPage/ViewTab/Font.inc b/client/components/Reader/SettingsPage/ViewTab/Font.inc deleted file mode 100644 index 1059a830..00000000 --- a/client/components/Reader/SettingsPage/ViewTab/Font.inc +++ /dev/null @@ -1,56 +0,0 @@ - - - -
-
Локальный/веб
-
- - -
- - - Веб шрифты дают большое разнообразие,
- однако есть шанс, что шрифт будет загружаться
- очень медленно или вовсе не загрузится -
-
-
-
- -
-
Размер
-
- - - -
-
- -
-
Сдвиг
-
- - - Сдвиг шрифта по вертикали в процентах от размера.
- Отрицательное значение сдвигает вверх, положительное -
- вниз. Значение зависит от метрики шрифта. -
-
-
-
- -
-
Стиль
-
- - -
-
diff --git a/client/components/Reader/SettingsPage/ViewTab/Font/Font.vue b/client/components/Reader/SettingsPage/ViewTab/Font/Font.vue new file mode 100644 index 00000000..76f1dadc --- /dev/null +++ b/client/components/Reader/SettingsPage/ViewTab/Font/Font.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/client/components/Reader/SettingsPage/ViewTab/Mode/Mode.vue b/client/components/Reader/SettingsPage/ViewTab/Mode/Mode.vue index e2515390..7c61469c 100644 --- a/client/components/Reader/SettingsPage/ViewTab/Mode/Mode.vue +++ b/client/components/Reader/SettingsPage/ViewTab/Mode/Mode.vue @@ -162,8 +162,11 @@ const componentOptions = { NumInput }, watch: { - form() { - this.formChanged();//no await + form: { + handler() { + this.formChanged();//no await + }, + deep: true, }, dualDivColorFiltered(newValue) { if (!this.isFormChanged && this.helper.isHexColor(newValue)) diff --git a/client/components/Reader/SettingsPage/ViewTab/ViewTab.vue b/client/components/Reader/SettingsPage/ViewTab/ViewTab.vue index c817da9f..80ddffb2 100644 --- a/client/components/Reader/SettingsPage/ViewTab/ViewTab.vue +++ b/client/components/Reader/SettingsPage/ViewTab/ViewTab.vue @@ -21,14 +21,7 @@
- - - - +