タイトルバー非表示オプション

This commit is contained in:
syuilo 2020-12-29 11:47:36 +09:00
parent 22049b10ff
commit 6b6483c9fc
5 changed files with 15 additions and 5 deletions

View File

@ -670,6 +670,7 @@ center: "中央"
wide: "広い"
narrow: "狭い"
reloadToApplySetting: "設定はページリロード後に反映されます。今すぐリロードしますか?"
showTitlebar: "タイトルバーを表示する"
_aboutMisskey:
about: "Misskeyはsyuiloによって2014年から開発されている、オープンソースのソフトウェアです。"

View File

@ -36,7 +36,7 @@
<span class="localOnly" v-if="note.localOnly"><Fa :icon="faBiohazard"/></span>
</div>
</div>
<article class="article" @contextmenu="onContextmenu">
<article class="article" @contextmenu.prevent.stop="onContextmenu">
<MkAvatar class="avatar" :user="appearNote.user"/>
<div class="main">
<XNoteHeader class="header" :note="appearNote" :mini="true"/>

View File

@ -1,5 +1,6 @@
<template>
<FormBase>
<FormSwitch v-model:value="titlebar">{{ $ts.showTitlebar }}</FormSwitch>
<FormSwitch v-model:value="showFixedPostForm">{{ $ts.showFixedPostForm }}</FormSwitch>
<FormSelect v-model:value="lang">
@ -133,6 +134,7 @@ export default defineComponent({
useOsNativeEmojis: defaultStore.makeGetterSetter('useOsNativeEmojis'),
disableShowingAnimatedImages: defaultStore.makeGetterSetter('disableShowingAnimatedImages'),
loadRawImages: defaultStore.makeGetterSetter('loadRawImages'),
titlebar: defaultStore.makeGetterSetter('titlebar'),
imageNewTab: defaultStore.makeGetterSetter('imageNewTab'),
nsfw: defaultStore.makeGetterSetter('nsfw'),
disablePagesScript: defaultStore.makeGetterSetter('disablePagesScript'),

View File

@ -180,6 +180,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device',
default: 'full' as 'full' | 'icon'
},
titlebar: {
where: 'device',
default: true
},
}));
// TODO: 他のタブと永続化されたstateを同期

View File

@ -2,8 +2,8 @@
<div class="mk-app" :class="{ wallpaper }">
<XSidebar ref="nav" class="sidebar"/>
<div class="contents" ref="contents">
<header class="header" ref="header" @contextmenu.prevent.stop="onContextmenu" @click="onHeaderClick">
<div class="contents" ref="contents" :class="{ withHeader: $store.state.titlebar }" @contextmenu.prevent.stop="onContextmenu">
<header v-if="$store.state.titlebar" class="header" ref="header" @click="onHeaderClick">
<XHeader :info="pageInfo"/>
</header>
<main ref="main">
@ -162,7 +162,7 @@ export default defineComponent({
this.navHidden = navWidth === 0;
if (this.$refs.contents == null) return;
const width = this.$refs.contents.offsetWidth;
this.$refs.header.style.width = `${width}px`;
if (this.$refs.header) this.$refs.header.style.width = `${width}px`;
},
showNav() {
@ -256,7 +256,10 @@ export default defineComponent({
> .contents {
width: 100%;
min-width: 0;
&.withHeader {
padding-top: $header-height;
}
> .header {
position: fixed;