feat: adjustable subtitle position

close #426
This commit is contained in:
edde746
2026-02-09 21:22:19 +01:00
parent 4d50c778ad
commit 2de92e660d
25 changed files with 129 additions and 23 deletions
+11
View File
@@ -46,6 +46,7 @@ class SettingsService extends BaseSharedPreferencesService {
static const String _keySubtitleBorderColor = 'subtitle_border_color';
static const String _keySubtitleBackgroundColor = 'subtitle_background_color';
static const String _keySubtitleBackgroundOpacity = 'subtitle_background_opacity';
static const String _keySubtitlePosition = 'subtitle_position';
static const String _keyAppLocale = 'app_locale';
static const String _keyRememberTrackSelections = 'remember_track_selections';
static const String _keyClickVideoTogglesPlayback = 'click_video_toggles_playback';
@@ -345,6 +346,15 @@ class SettingsService extends BaseSharedPreferencesService {
return prefs.getInt(_keySubtitleBackgroundOpacity) ?? 0;
}
// Subtitle Position (0 = top, 100 = bottom, default 100)
Future<void> setSubtitlePosition(int position) async {
await prefs.setInt(_keySubtitlePosition, position.clamp(0, 100));
}
int getSubtitlePosition() {
return prefs.getInt(_keySubtitlePosition) ?? 100; // Default: bottom
}
// Keyboard Shortcuts (Legacy String-based)
Map<String, String> getDefaultKeyboardShortcuts() {
return {
@@ -1068,6 +1078,7 @@ class SettingsService extends BaseSharedPreferencesService {
prefs.remove(_keySubtitleBorderColor),
prefs.remove(_keySubtitleBackgroundColor),
prefs.remove(_keySubtitleBackgroundOpacity),
prefs.remove(_keySubtitlePosition),
prefs.remove(_keyAppLocale),
prefs.remove(_keyRememberTrackSelections),
prefs.remove(_keyCustomDownloadPath),