Merge branch 'worktree-agent-a34c5b595a9afef6e'
This commit is contained in:
@@ -6,9 +6,10 @@ import 'settings_group.dart';
|
||||
/// The text sizes the setting offers (besides Default and the current one).
|
||||
const List<double> _fontSizes = [10, 11, 12, 13, 14, 15, 16, 18, 20, 24];
|
||||
|
||||
/// Appearance → Terminal's text size, scrollback and bell controls.
|
||||
/// Appearance → Terminal's text size, colours, scrollback and bell controls.
|
||||
List<Widget> settingsTerminalControls(TerminalLayout layout) => [
|
||||
SettingsGroupItem(child: _FontSize(layout: layout)),
|
||||
SettingsGroupItem(child: _Palette(layout: layout)),
|
||||
SettingsGroupItem(child: _Scrollback(layout: layout)),
|
||||
SwitchListTile(
|
||||
key: const ValueKey('settings-terminal-bell'),
|
||||
@@ -54,6 +55,29 @@ class _FontSize extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _Palette extends StatelessWidget {
|
||||
const _Palette({required this.layout});
|
||||
final TerminalLayout layout;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => DropdownMenu<TerminalPalette>(
|
||||
key: ValueKey('settings-terminal-palette-${layout.palette.name}'),
|
||||
expandedInsets: EdgeInsets.zero,
|
||||
label: const Text('Colours'),
|
||||
helperText:
|
||||
'The sixteen terminal colours, adjusted to the light or dark theme '
|
||||
'so text stays readable.',
|
||||
initialSelection: layout.palette,
|
||||
dropdownMenuEntries: [
|
||||
for (final palette in TerminalPalette.values)
|
||||
DropdownMenuEntry(value: palette, label: palette.label),
|
||||
],
|
||||
onSelected: (palette) {
|
||||
if (palette != null) layout.setPalette(palette);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
class _Scrollback extends StatelessWidget {
|
||||
const _Scrollback({required this.layout});
|
||||
final TerminalLayout layout;
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'settings_theme.dart';
|
||||
|
||||
/// Appearance → Terminal: whether the terminal docks at the bottom of the
|
||||
/// window or floats over it (Ctrl+` shows and hides it either way), the
|
||||
/// Option key, text size, scrollback length and visual bell.
|
||||
/// Option key, text size, colours, scrollback length and visual bell.
|
||||
class SettingsTerminalSection extends StatelessWidget {
|
||||
const SettingsTerminalSection({super.key, required this.layout});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user