MCPcopy
hub / github.com/ihmily/StreamCap / create_setting_group

Method create_setting_group

app/ui/views/settings_view.py:1158–1186  ·  view source on GitHub ↗

Helper method to group settings under a title.

(title, description, settings, is_mobile=False)

Source from the content-addressed store, hash-verified

1156
1157 @staticmethod
1158 def create_setting_group(title, description, settings, is_mobile=False):
1159 """Helper method to group settings under a title."""
1160 padding = 5 if is_mobile else 10
1161 margin = 5 if is_mobile else 10
1162
1163 card = ft.Card(
1164 content=ft.Container(
1165 content=ft.Column(
1166 [
1167 ft.Text(title, size=16, weight=ft.FontWeight.BOLD),
1168 ft.Text(description, theme_style=ft.TextThemeStyle.BODY_MEDIUM, opacity=0.7),
1169 *settings,
1170 ],
1171 spacing=5,
1172 ),
1173 padding=padding,
1174 ),
1175 elevation=5,
1176 margin=margin,
1177 )
1178
1179 if is_mobile:
1180 return ft.Container(
1181 content=card,
1182 width=float("inf"),
1183 expand=True,
1184 )
1185 else:
1186 return card
1187
1188 def set_focused_control(self, control):
1189 """Store the currently focused control."""

Calls

no outgoing calls

Tested by

no test coverage detected