mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
refactor: rename isShowTopbar to showTopBar && rename autoHideTopbar to autoHideTopBar
This commit is contained in:
@@ -46,7 +46,7 @@ function changeThemeColor(color: string) {
|
||||
</SettingsItem>
|
||||
|
||||
<SettingsItem :title="$t('settings.topbar_visibility')" :desc="$t('settings.topbar_visibility_desc')">
|
||||
<Radio v-model="settings.isShowTopbar" :label="settings.isShowTopbar ? $t('settings.chk_box.show') : $t('settings.chk_box.hidden')" />
|
||||
<Radio v-model="settings.showTopBar" :label="settings.showTopBar ? $t('settings.chk_box.show') : $t('settings.chk_box.hidden')" />
|
||||
</SettingsItem>
|
||||
</SettingsItemGroup>
|
||||
</div>
|
||||
|
||||
@@ -94,10 +94,10 @@ function resetDockContent() {
|
||||
|
||||
<SettingsItemGroup :title="$t('settings.group_topbar')">
|
||||
<!-- <SettingsItem :title="$t('settings.topbar_visibility')" :desc="$t('settings.topbar_visibility_desc')">
|
||||
<Radio v-model="settings.isShowTopbar" :label="settings.isShowTopbar ? $t('settings.chk_box.show') : $t('settings.chk_box.hidden')" />
|
||||
<Radio v-model="settings.showTopBar" :label="settings.showTopBar ? $t('settings.chk_box.show') : $t('settings.chk_box.hidden')" />
|
||||
</SettingsItem> -->
|
||||
<SettingsItem :title="$t('settings.auto_hide_topbar')">
|
||||
<Radio v-model="settings.autoHideTopbar" />
|
||||
<Radio v-model="settings.autoHideTopBar" />
|
||||
</SettingsItem>
|
||||
</SettingsItemGroup>
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ const favoritesPopRef = ref<any>()
|
||||
const scrollTop = ref<number>(0)
|
||||
const oldScrollTop = ref<number>(0)
|
||||
|
||||
watch(() => settings.value.autoHideTopbar, (newVal) => {
|
||||
watch(() => settings.value.autoHideTopBar, (newVal) => {
|
||||
if (!newVal)
|
||||
toggleTopBarVisible(true)
|
||||
})
|
||||
@@ -129,7 +129,7 @@ function handleScroll() {
|
||||
scrollTop.value = document.documentElement.scrollTop
|
||||
}
|
||||
|
||||
if (settings.value.autoHideTopbar && !hoveringTopBar.value && scrollTop.value !== 0) {
|
||||
if (settings.value.autoHideTopBar && !hoveringTopBar.value && scrollTop.value !== 0) {
|
||||
if (scrollTop.value > oldScrollTop.value)
|
||||
toggleTopBarVisible(false)
|
||||
|
||||
|
||||
@@ -270,14 +270,14 @@ provide('scrollbarRef', scrollbarRef)
|
||||
<div m-auto max-w="$bew-page-max-width">
|
||||
<Transition name="top-bar">
|
||||
<TopBar
|
||||
v-if="settings.isShowTopbar && !isHomePage()"
|
||||
v-if="settings.showTopBar && !isHomePage()"
|
||||
pos="top-0 left-0" z="99 hover:1001" w-full
|
||||
:style="{ position: isTopBarFixed ? 'fixed' : 'absolute' }"
|
||||
:show-search-bar="!isSearchPage"
|
||||
:mask="showTopBarMask"
|
||||
/>
|
||||
<TopBar
|
||||
v-else-if="settings.isShowTopbar && isHomePage()"
|
||||
v-else-if="settings.showTopBar && isHomePage()"
|
||||
ref="topBarRef"
|
||||
:show-search-bar="showTopBarMask && settings.useSearchPageModeOnHomePage || (!settings.useSearchPageModeOnHomePage && activatedPage !== AppPage.Search || activatedPage !== AppPage.Home && activatedPage !== AppPage.Search)"
|
||||
:show-logo="showTopBarMask && settings.useSearchPageModeOnHomePage || (!settings.useSearchPageModeOnHomePage || activatedPage !== AppPage.Home)"
|
||||
|
||||
@@ -49,7 +49,7 @@ onMounted(async () => {
|
||||
// Allow moving tabs up only when the top bar is not hidden & is set to auto-hide
|
||||
// This feature is primarily designed to compatible with the Bilibili Evolved's top bar
|
||||
// Even when the BewlyBewly top bar is hidden, the Bilibili Evolved top bar still exists, so not moving up
|
||||
if (settings.value.autoHideTopbar && settings.value.isShowTopbar) {
|
||||
if (settings.value.autoHideTopBar && settings.value.showTopBar) {
|
||||
if (val)
|
||||
shouldMoveCtrlBarUp.value = false
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ onMounted(() => {
|
||||
// Allow moving tabs up only when the top bar is not hidden & is set to auto-hide
|
||||
// This feature is primarily designed to compatible with the Bilibili Evolved's top bar
|
||||
// Even when the BewlyBewly top bar is hidden, the Bilibili Evolved top bar still exists, so not moving up
|
||||
if (settings.value.autoHideTopbar && settings.value.isShowTopbar) {
|
||||
if (settings.value.autoHideTopBar && settings.value.showTopBar) {
|
||||
if (val)
|
||||
shouldMoveTabsUp.value = false
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ onMounted(() => {
|
||||
// Allow moving tabs up only when the top bar is not hidden & is set to auto-hide
|
||||
// This feature is primarily designed to compatible with the Bilibili Evolved's top bar
|
||||
// Even when the BewlyBewly top bar is hidden, the Bilibili Evolved top bar still exists, so not moving up
|
||||
if (settings.value.autoHideTopbar && settings.value.isShowTopbar) {
|
||||
if (settings.value.autoHideTopBar && settings.value.showTopBar) {
|
||||
if (val)
|
||||
shouldMoveAsideUp.value = false
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface Settings {
|
||||
enableHorizontalScrolling: boolean
|
||||
openLinkInCurrentTab: boolean
|
||||
enableVideoCtrlBarOnVideoCard: boolean
|
||||
autoHideTopbar: boolean
|
||||
autoHideTopBar: boolean
|
||||
dockPosition: 'left' | 'right' | 'bottom'
|
||||
autoHideDock: boolean
|
||||
dockItemVisibilityList: { page: AppPage; visible: boolean }[]
|
||||
@@ -42,7 +42,7 @@ export interface Settings {
|
||||
searchPageModeWallpaperFixed: boolean
|
||||
|
||||
adaptToOtherPageStyles: boolean
|
||||
isShowTopbar: boolean
|
||||
showTopBar: boolean
|
||||
useOriginalBilibiliHomepage: boolean
|
||||
}
|
||||
export const settings = useStorageLocal('settings', ref<Settings>({
|
||||
@@ -50,7 +50,7 @@ export const settings = useStorageLocal('settings', ref<Settings>({
|
||||
enableHorizontalScrolling: false,
|
||||
openLinkInCurrentTab: false,
|
||||
enableVideoCtrlBarOnVideoCard: false,
|
||||
autoHideTopbar: false,
|
||||
autoHideTopBar: false,
|
||||
dockPosition: 'right',
|
||||
autoHideDock: false,
|
||||
dockItemVisibilityList: [],
|
||||
@@ -81,6 +81,6 @@ export const settings = useStorageLocal('settings', ref<Settings>({
|
||||
searchPageModeWallpaperFixed: false,
|
||||
|
||||
adaptToOtherPageStyles: true,
|
||||
isShowTopbar: true,
|
||||
showTopBar: true,
|
||||
useOriginalBilibiliHomepage: false,
|
||||
}), { mergeDefaults: true })
|
||||
|
||||
@@ -7,8 +7,8 @@ interface Settings {
|
||||
enableHorizontalScrolling: boolean
|
||||
openLinkInCurrentTab: boolean
|
||||
enableVideoCtrlBarOnVideoCard: boolean
|
||||
isShowTopbar: boolean
|
||||
autoHideTopbar: boolean
|
||||
showTopBar: boolean
|
||||
autoHideTopBar: boolean
|
||||
dockPosition: 'left' | 'right' | 'bottom'
|
||||
autoHideDock: boolean
|
||||
dockItemVisibilityList: { page: AppPage; visible: boolean }[]
|
||||
@@ -47,8 +47,8 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
enableHorizontalScrolling: false,
|
||||
openLinkInCurrentTab: false,
|
||||
enableVideoCtrlBarOnVideoCard: false,
|
||||
isShowTopbar: true,
|
||||
autoHideTopbar: false,
|
||||
showTopBar: true,
|
||||
autoHideTopBar: false,
|
||||
dockPosition: 'right',
|
||||
autoHideDock: false,
|
||||
dockItemVisibilityList: [],
|
||||
|
||||
Reference in New Issue
Block a user