| 1932 | } |
| 1933 | |
| 1934 | private func optionToggleRow( |
| 1935 | title: String, |
| 1936 | description: String, |
| 1937 | isOn: Binding<Bool>, |
| 1938 | allowsDescriptionWrapping: Bool = false |
| 1939 | ) -> some View { |
| 1940 | HStack(alignment: .center) { |
| 1941 | VStack(alignment: .leading, spacing: 2) { |
| 1942 | Text(title) |
| 1943 | .font(self.theme.typography.bodyStrong) |
| 1944 | .foregroundStyle(self.settingsTitleText) |
| 1945 | Text(description) |
| 1946 | .font(self.theme.typography.bodySmall) |
| 1947 | .foregroundStyle(self.settingsSecondaryText) |
| 1948 | .fixedSize(horizontal: false, vertical: allowsDescriptionWrapping) |
| 1949 | } |
| 1950 | .frame(maxWidth: allowsDescriptionWrapping ? .infinity : nil, alignment: .leading) |
| 1951 | |
| 1952 | if !allowsDescriptionWrapping { |
| 1953 | Spacer() |
| 1954 | } |
| 1955 | |
| 1956 | Toggle("", isOn: isOn) |
| 1957 | .toggleStyle(.switch) |
| 1958 | .tint(self.theme.palette.accent) |
| 1959 | .labelsHidden() |
| 1960 | } |
| 1961 | } |
| 1962 | |
| 1963 | private func instructionsBox( |
| 1964 | title: String, |