Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 867a2b0

Browse files
committed
compact layout: disable if not modern layout and add description
1 parent da74d0b commit 867a2b0

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/components/views/settings/LayoutSwitcher.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import React, { JSX, useEffect, useState } from "react";
18-
import { InlineField, ToggleControl, Label, Root, RadioControl } from "@vector-im/compound-web";
18+
import { HelpMessage, InlineField, Label, RadioControl, Root, ToggleControl } from "@vector-im/compound-web";
1919

2020
import SettingsSubsection from "./shared/SettingsSubsection";
2121
import { _t } from "../../../languageHandler";
@@ -144,6 +144,7 @@ function useEventTileInfo(): EventTileInfo {
144144
*/
145145
function ToggleCompactLayout(): JSX.Element {
146146
const compactLayoutEnabled = useSettingValue<boolean>("useCompactLayout");
147+
const layout = useSettingValue<Layout>("layout");
147148

148149
return (
149150
<Root
@@ -154,9 +155,16 @@ function ToggleCompactLayout(): JSX.Element {
154155
>
155156
<InlineField
156157
name="compactLayout"
157-
control={<ToggleControl name="compactLayout" defaultChecked={compactLayoutEnabled} />}
158+
control={
159+
<ToggleControl
160+
disabled={layout !== Layout.Group}
161+
name="compactLayout"
162+
defaultChecked={compactLayoutEnabled}
163+
/>
164+
}
158165
>
159166
<Label>{_t("settings|appearance|compact_layout")}</Label>
167+
<HelpMessage>{_t("settings|appearance|compact_layout_description")}</HelpMessage>
160168
</InlineField>
161169
</Root>
162170
);

src/i18n/strings/en_EN.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2421,7 +2421,8 @@
24212421
"always_show_message_timestamps": "Always show message timestamps",
24222422
"appearance": {
24232423
"bundled_emoji_font": "Use bundled emoji font",
2424-
"compact_layout": "Show compact layout",
2424+
"compact_layout": "Show compact text and messages",
2425+
"compact_layout_description": "Modern layout must be selected to use this feature.",
24252426
"custom_font": "Use a system font",
24262427
"custom_font_description": "Set the name of a font installed on your system & %(brand)s will attempt to use it.",
24272428
"custom_font_name": "System font name",

0 commit comments

Comments
 (0)