mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-04 03:46:19 +02:00
Compare commits
2 Commits
copilot/bu
...
lowpowermo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f9180e045 | ||
|
|
e8b5aa5c2f |
8
locales/index.d.ts
vendored
8
locales/index.d.ts
vendored
@@ -5493,6 +5493,10 @@ export interface Locale extends ILocale {
|
||||
* 低くすると画質を保てますが、ファイルサイズは増加します。<br>高くするとファイルサイズを減らせますが、画質は低下します。
|
||||
*/
|
||||
"defaultImageCompressionLevel_description": string;
|
||||
/**
|
||||
* 低電力モード
|
||||
*/
|
||||
"lowPowerMode": string;
|
||||
/**
|
||||
* 分
|
||||
*/
|
||||
@@ -5807,6 +5811,10 @@ export interface Locale extends ILocale {
|
||||
* UIのアニメーション
|
||||
*/
|
||||
"uiAnimations": string;
|
||||
/**
|
||||
* アニメーション画像を再生
|
||||
*/
|
||||
"playAnimatedImages": string;
|
||||
/**
|
||||
* ナビゲーションバーに副ボタンを表示
|
||||
*/
|
||||
|
||||
@@ -1368,6 +1368,7 @@ redisplayAllTips: "全ての「ヒントとコツ」を再表示"
|
||||
hideAllTips: "全ての「ヒントとコツ」を非表示"
|
||||
defaultImageCompressionLevel: "デフォルトの画像圧縮度"
|
||||
defaultImageCompressionLevel_description: "低くすると画質を保てますが、ファイルサイズは増加します。<br>高くするとファイルサイズを減らせますが、画質は低下します。"
|
||||
lowPowerMode: "低電力モード"
|
||||
inMinutes: "分"
|
||||
inDays: "日"
|
||||
|
||||
@@ -1453,6 +1454,7 @@ _settings:
|
||||
useStickyIcons: "アイコンをスクロールに追従させる"
|
||||
enableHighQualityImagePlaceholders: "高品質な画像のプレースホルダを表示"
|
||||
uiAnimations: "UIのアニメーション"
|
||||
playAnimatedImages: "アニメーション画像を再生"
|
||||
showNavbarSubButtons: "ナビゲーションバーに副ボタンを表示"
|
||||
ifOn: "オンのとき"
|
||||
ifOff: "オフのとき"
|
||||
|
||||
@@ -567,6 +567,27 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template #icon><SearchIcon><i class="ti ti-battery-vertical-eco"></i></SearchIcon></template>
|
||||
|
||||
<div class="_gaps_s">
|
||||
<SearchMarker :keywords="['lowpowermode', 'battery', 'eco', 'save']">
|
||||
<MkPreferenceContainer k="lowPowerMode">
|
||||
<MkSwitch v-model="lowPowerMode">
|
||||
<template #label><SearchLabel>{{ i18n.ts.lowPowerMode }}</SearchLabel></template>
|
||||
</MkSwitch>
|
||||
</MkPreferenceContainer>
|
||||
</SearchMarker>
|
||||
|
||||
<hr>
|
||||
|
||||
<MkDisableSection :disabled="lowPowerMode">
|
||||
<div class="_gaps_s">
|
||||
<SearchMarker :keywords="['animation', 'image', 'gif']">
|
||||
<MkPreferenceContainer k="disableShowingAnimatedImages">
|
||||
<MkSwitch :modelValue="!disableShowingAnimatedImages" @update:modelValue="v => disableShowingAnimatedImages = !v">
|
||||
<template #label><SearchLabel>{{ i18n.ts._settings.playAnimatedImages }}</SearchLabel></template>
|
||||
<template #caption><SearchKeyword>{{ i18n.ts.turnOffToImprovePerformance }}</SearchKeyword></template>
|
||||
</MkSwitch>
|
||||
</MkPreferenceContainer>
|
||||
</SearchMarker>
|
||||
|
||||
<SearchMarker :keywords="['animation', 'motion', 'reduce']">
|
||||
<MkPreferenceContainer k="animation">
|
||||
<MkSwitch :modelValue="!reduceAnimation" @update:modelValue="v => reduceAnimation = !v">
|
||||
@@ -611,6 +632,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</MkSwitch>
|
||||
</MkPreferenceContainer>
|
||||
</SearchMarker>
|
||||
</div>
|
||||
</MkDisableSection>
|
||||
|
||||
<MkInfo>
|
||||
<div class="_gaps_s">
|
||||
@@ -871,6 +894,7 @@ const useNativeUiForVideoAudioPlayer = prefer.model('useNativeUiForVideoAudioPla
|
||||
const contextMenu = prefer.model('contextMenu');
|
||||
const menuStyle = prefer.model('menuStyle');
|
||||
const makeEveryTextElementsSelectable = prefer.model('makeEveryTextElementsSelectable');
|
||||
const lowPowerMode = prefer.model('lowPowerMode');
|
||||
|
||||
const fontSize = ref(miLocalStorage.getItem('fontSize'));
|
||||
const useSystemFont = ref(miLocalStorage.getItem('useSystemFont') != null);
|
||||
@@ -928,6 +952,7 @@ watch([
|
||||
enablePullToRefresh,
|
||||
reduceAnimation,
|
||||
showAvailableReactionsFirstInNote,
|
||||
lowPowerMode,
|
||||
], async () => {
|
||||
await reloadAsk({ reason: i18n.ts.reloadToApplySetting, unison: true });
|
||||
});
|
||||
|
||||
@@ -35,6 +35,7 @@ export type SoundStore = {
|
||||
// NOTE: デフォルト値は他の設定の状態に依存してはならない(依存していた場合、ユーザーがその設定項目単体で「初期値にリセット」した場合不具合の原因になる)
|
||||
|
||||
export const PREF_DEF = definePreferences({
|
||||
states: {
|
||||
accounts: {
|
||||
default: [] as [host: string, user: {
|
||||
id: string;
|
||||
@@ -424,6 +425,9 @@ export const PREF_DEF = definePreferences({
|
||||
defaultImageCompressionLevel: {
|
||||
default: 2 as 0 | 1 | 2 | 3,
|
||||
},
|
||||
lowPowerMode: {
|
||||
default: false,
|
||||
},
|
||||
|
||||
'sound.masterVolume': {
|
||||
default: 0.5,
|
||||
@@ -495,4 +499,8 @@ export const PREF_DEF = definePreferences({
|
||||
'experimental.enableFolderPageView': {
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
disableShowingAnimatedImages: (s) => s.disableShowingAnimatedImages || s.lowPowerMode,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -101,9 +101,19 @@ type PreferencesDefinitionRecord<Default, T = Default extends (...args: any) =>
|
||||
export type PreferencesDefinition = Record<string, PreferencesDefinitionRecord<any>>;
|
||||
|
||||
export function definePreferences<T extends Record<string, unknown>>(x: {
|
||||
[K in keyof T]: PreferencesDefinitionRecord<T[K]>
|
||||
states: {
|
||||
[K in keyof T]: PreferencesDefinitionRecord<T[K]>;
|
||||
};
|
||||
computed: {
|
||||
[K in keyof T]: PreferencesDefinitionRecord<T[K]>;
|
||||
};
|
||||
}): {
|
||||
[K in keyof T]: PreferencesDefinitionRecord<T[K]>
|
||||
states: {
|
||||
[K in keyof T]: PreferencesDefinitionRecord<T[K]>;
|
||||
};
|
||||
computed: {
|
||||
[K in keyof T]: PreferencesDefinitionRecord<T[K]>;
|
||||
};
|
||||
} {
|
||||
return x;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user