1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-02 05:05:54 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
syuilo
7f9180e045 Merge branch 'develop' into lowpowermode 2025-08-01 15:20:01 +09:00
syuilo
e8b5aa5c2f wip 2025-07-30 13:52:52 +09:00
5 changed files with 539 additions and 486 deletions

8
locales/index.d.ts vendored
View File

@@ -5493,6 +5493,10 @@ export interface Locale extends ILocale {
* 低くすると画質を保てますが、ファイルサイズは増加します。<br>高くするとファイルサイズを減らせますが、画質は低下します。 * 低くすると画質を保てますが、ファイルサイズは増加します。<br>高くするとファイルサイズを減らせますが、画質は低下します。
*/ */
"defaultImageCompressionLevel_description": string; "defaultImageCompressionLevel_description": string;
/**
* 低電力モード
*/
"lowPowerMode": string;
/** /**
* 分 * 分
*/ */
@@ -5807,6 +5811,10 @@ export interface Locale extends ILocale {
* UIのアニメーション * UIのアニメーション
*/ */
"uiAnimations": string; "uiAnimations": string;
/**
* アニメーション画像を再生
*/
"playAnimatedImages": string;
/** /**
* ナビゲーションバーに副ボタンを表示 * ナビゲーションバーに副ボタンを表示
*/ */

View File

@@ -1368,6 +1368,7 @@ redisplayAllTips: "全ての「ヒントとコツ」を再表示"
hideAllTips: "全ての「ヒントとコツ」を非表示" hideAllTips: "全ての「ヒントとコツ」を非表示"
defaultImageCompressionLevel: "デフォルトの画像圧縮度" defaultImageCompressionLevel: "デフォルトの画像圧縮度"
defaultImageCompressionLevel_description: "低くすると画質を保てますが、ファイルサイズは増加します。<br>高くするとファイルサイズを減らせますが、画質は低下します。" defaultImageCompressionLevel_description: "低くすると画質を保てますが、ファイルサイズは増加します。<br>高くするとファイルサイズを減らせますが、画質は低下します。"
lowPowerMode: "低電力モード"
inMinutes: "分" inMinutes: "分"
inDays: "日" inDays: "日"
@@ -1453,6 +1454,7 @@ _settings:
useStickyIcons: "アイコンをスクロールに追従させる" useStickyIcons: "アイコンをスクロールに追従させる"
enableHighQualityImagePlaceholders: "高品質な画像のプレースホルダを表示" enableHighQualityImagePlaceholders: "高品質な画像のプレースホルダを表示"
uiAnimations: "UIのアニメーション" uiAnimations: "UIのアニメーション"
playAnimatedImages: "アニメーション画像を再生"
showNavbarSubButtons: "ナビゲーションバーに副ボタンを表示" showNavbarSubButtons: "ナビゲーションバーに副ボタンを表示"
ifOn: "オンのとき" ifOn: "オンのとき"
ifOff: "オフのとき" ifOff: "オフのとき"

View File

@@ -567,6 +567,27 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #icon><SearchIcon><i class="ti ti-battery-vertical-eco"></i></SearchIcon></template> <template #icon><SearchIcon><i class="ti ti-battery-vertical-eco"></i></SearchIcon></template>
<div class="_gaps_s"> <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']"> <SearchMarker :keywords="['animation', 'motion', 'reduce']">
<MkPreferenceContainer k="animation"> <MkPreferenceContainer k="animation">
<MkSwitch :modelValue="!reduceAnimation" @update:modelValue="v => reduceAnimation = !v"> <MkSwitch :modelValue="!reduceAnimation" @update:modelValue="v => reduceAnimation = !v">
@@ -611,6 +632,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkSwitch> </MkSwitch>
</MkPreferenceContainer> </MkPreferenceContainer>
</SearchMarker> </SearchMarker>
</div>
</MkDisableSection>
<MkInfo> <MkInfo>
<div class="_gaps_s"> <div class="_gaps_s">
@@ -871,6 +894,7 @@ const useNativeUiForVideoAudioPlayer = prefer.model('useNativeUiForVideoAudioPla
const contextMenu = prefer.model('contextMenu'); const contextMenu = prefer.model('contextMenu');
const menuStyle = prefer.model('menuStyle'); const menuStyle = prefer.model('menuStyle');
const makeEveryTextElementsSelectable = prefer.model('makeEveryTextElementsSelectable'); const makeEveryTextElementsSelectable = prefer.model('makeEveryTextElementsSelectable');
const lowPowerMode = prefer.model('lowPowerMode');
const fontSize = ref(miLocalStorage.getItem('fontSize')); const fontSize = ref(miLocalStorage.getItem('fontSize'));
const useSystemFont = ref(miLocalStorage.getItem('useSystemFont') != null); const useSystemFont = ref(miLocalStorage.getItem('useSystemFont') != null);
@@ -928,6 +952,7 @@ watch([
enablePullToRefresh, enablePullToRefresh,
reduceAnimation, reduceAnimation,
showAvailableReactionsFirstInNote, showAvailableReactionsFirstInNote,
lowPowerMode,
], async () => { ], async () => {
await reloadAsk({ reason: i18n.ts.reloadToApplySetting, unison: true }); await reloadAsk({ reason: i18n.ts.reloadToApplySetting, unison: true });
}); });

View File

@@ -35,6 +35,7 @@ export type SoundStore = {
// NOTE: デフォルト値は他の設定の状態に依存してはならない(依存していた場合、ユーザーがその設定項目単体で「初期値にリセット」した場合不具合の原因になる) // NOTE: デフォルト値は他の設定の状態に依存してはならない(依存していた場合、ユーザーがその設定項目単体で「初期値にリセット」した場合不具合の原因になる)
export const PREF_DEF = definePreferences({ export const PREF_DEF = definePreferences({
states: {
accounts: { accounts: {
default: [] as [host: string, user: { default: [] as [host: string, user: {
id: string; id: string;
@@ -424,6 +425,9 @@ export const PREF_DEF = definePreferences({
defaultImageCompressionLevel: { defaultImageCompressionLevel: {
default: 2 as 0 | 1 | 2 | 3, default: 2 as 0 | 1 | 2 | 3,
}, },
lowPowerMode: {
default: false,
},
'sound.masterVolume': { 'sound.masterVolume': {
default: 0.5, default: 0.5,
@@ -495,4 +499,8 @@ export const PREF_DEF = definePreferences({
'experimental.enableFolderPageView': { 'experimental.enableFolderPageView': {
default: false, default: false,
}, },
},
computed: {
disableShowingAnimatedImages: (s) => s.disableShowingAnimatedImages || s.lowPowerMode,
},
}); });

View File

@@ -101,9 +101,19 @@ type PreferencesDefinitionRecord<Default, T = Default extends (...args: any) =>
export type PreferencesDefinition = Record<string, PreferencesDefinitionRecord<any>>; export type PreferencesDefinition = Record<string, PreferencesDefinitionRecord<any>>;
export function definePreferences<T extends Record<string, unknown>>(x: { 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; return x;
} }