Skip to content

Commit 5a1ff88

Browse files
committed
Add option to remove title bar in Linux and Windows
1 parent d89f0d9 commit 5a1ff88

File tree

4 files changed

+242
-136
lines changed

4 files changed

+242
-136
lines changed

lib/l10n/app_en.arb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@
185185
"@disableFilters": {},
186186
"disabled": "Off",
187187
"@disabled": {},
188+
"disableTitleBarTitle": "Disable the title bar",
189+
"disableTitleBarDesc": "Disable the title bar on Linux and Windows",
188190
"discovered": "Discovered",
189191
"@discovered": {},
190192
"displayLanguage": "Display language",

lib/models/settings/client_settings_model.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ abstract class ClientSettingsModel with _$ClientSettingsModel {
8282
@Default(BackgroundType.blurred) BackgroundType backgroundImage,
8383
@Default(true) bool checkForUpdates,
8484
@Default(false) bool usePosterForLibrary,
85+
@Default(false) bool disableTitleBar,
8586
@Default(false) bool useSystemIME,
8687
String? lastViewedUpdate,
8788
int? libraryPageSize,

lib/screens/settings/client_sections/client_settings_visual.dart

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ List<Widget> buildClientSettingsVisual(
2222
TextEditingController libraryPageSizeController,
2323
) {
2424
final clientSettings = ref.watch(clientSettingsProvider);
25+
26+
final platform = AdaptiveLayout.of(context).platform;
27+
final supportsWindowControls =
28+
platform == TargetPlatform.windows ||
29+
platform == TargetPlatform.linux;
30+
2531
Locale currentLocale = WidgetsBinding.instance.platformDispatcher.locale;
2632
return settingsListGroup(
2733
context,
@@ -116,6 +122,19 @@ List<Widget> buildClientSettingsVisual(
116122
ref.read(clientSettingsProvider.notifier).update((cb) => cb.copyWith(usePosterForLibrary: value)),
117123
),
118124
),
125+
if (supportsWindowControls)
126+
SettingsListTile(
127+
label: Text(context.localized.disableTitleBarTitle),
128+
subLabel: Text(context.localized.disableTitleBarDesc),
129+
onTap: () => ref
130+
.read(clientSettingsProvider.notifier)
131+
.update((cb) => cb.copyWith(disableTitleBar: !clientSettings.disableTitleBar)),
132+
trailing: Switch(
133+
value: clientSettings.disableTitleBar,
134+
onChanged: (value) =>
135+
ref.read(clientSettingsProvider.notifier).update((cb) => cb.copyWith(disableTitleBar: value)),
136+
),
137+
),
119138
SettingsListTile(
120139
label: Text(context.localized.settingsNextUpCutoffDays),
121140
trailing: IntInputField(

0 commit comments

Comments
 (0)