-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: band-aid fix to disallow linux video fullscreen
Ref #1022
- Loading branch information
1 parent
6d78c2b
commit 8157671
Showing
11 changed files
with
736 additions
and
676 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:path/path.dart' as p; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
import 'package:watch_it/watch_it.dart'; | ||
import 'package:yaru/yaru.dart'; | ||
|
||
import '../../app/app_model.dart'; | ||
import '../../app/connectivity_model.dart'; | ||
import '../../common/view/global_keys.dart'; | ||
import '../../common/view/progress.dart'; | ||
import '../../common/view/snackbars.dart'; | ||
import '../../common/view/tapable_text.dart'; | ||
import '../../common/view/theme.dart'; | ||
import '../../constants.dart'; | ||
import '../../extensions/build_context_x.dart'; | ||
import '../../extensions/theme_data_x.dart'; | ||
import '../../l10n/l10n.dart'; | ||
|
||
class AboutSection extends StatelessWidget with WatchItMixin { | ||
const AboutSection({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final text = '${context.l10n.about} $kAppTitle'; | ||
return YaruSection( | ||
headline: Text(text), | ||
margin: const EdgeInsets.all(kYaruPagePadding), | ||
child: const Column( | ||
children: [_AboutTile(), _LicenseTile()], | ||
), | ||
); | ||
} | ||
} | ||
|
||
class _AboutTile extends StatefulWidget with WatchItStatefulWidgetMixin { | ||
const _AboutTile(); | ||
|
||
@override | ||
State<_AboutTile> createState() => _AboutTileState(); | ||
} | ||
|
||
class _AboutTileState extends State<_AboutTile> { | ||
@override | ||
void initState() { | ||
super.initState(); | ||
di<AppModel>().checkForUpdate( | ||
isOnline: di<ConnectivityModel>().isOnline == true, | ||
onError: (e) { | ||
if (mounted) { | ||
showSnackBar(context: context, content: Text(e)); | ||
} | ||
}, | ||
); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = context.theme; | ||
final appModel = di<AppModel>(); | ||
final updateAvailable = | ||
watchPropertyValue((AppModel m) => m.updateAvailable); | ||
final onlineVersion = watchPropertyValue((AppModel m) => m.onlineVersion); | ||
final currentVersion = watchPropertyValue((AppModel m) => m.version); | ||
|
||
return YaruTile( | ||
title: !di<ConnectivityModel>().isOnline == true || | ||
!appModel.allowManualUpdate | ||
? Text(di<AppModel>().version ?? '') | ||
: updateAvailable == null | ||
? Center( | ||
child: SizedBox.square( | ||
dimension: yaruStyled ? kYaruTitleBarItemHeight : 40, | ||
child: const Progress( | ||
padding: EdgeInsets.all(10), | ||
), | ||
), | ||
) | ||
: TapAbleText( | ||
text: updateAvailable == true | ||
? '${context.l10n.updateAvailable}: $onlineVersion' | ||
: currentVersion ?? context.l10n.unknown, | ||
style: updateAvailable == true | ||
? TextStyle( | ||
color: context.theme.colorScheme.success | ||
.scale(lightness: theme.isLight ? 0 : 0.3), | ||
) | ||
: null, | ||
onTap: () => launchUrl( | ||
Uri.parse( | ||
p.join( | ||
kRepoUrl, | ||
'releases', | ||
'tag', | ||
onlineVersion, | ||
), | ||
), | ||
), | ||
), | ||
trailing: OutlinedButton( | ||
onPressed: () => settingsNavigatorKey.currentState?.pushNamed('/about'), | ||
child: Text(context.l10n.contributors), | ||
), | ||
); | ||
} | ||
} | ||
|
||
class _LicenseTile extends StatelessWidget { | ||
const _LicenseTile(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return YaruTile( | ||
title: TapAbleText( | ||
text: '${context.l10n.license}: GPL3', | ||
), | ||
trailing: OutlinedButton( | ||
onPressed: () => | ||
settingsNavigatorKey.currentState?.pushNamed('/licenses'), | ||
child: Text(context.l10n.dependencies), | ||
), | ||
enabled: true, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import '../../common/data/close_btn_action.dart'; | ||
import '../../common/view/drop_down_arrow.dart'; | ||
import '../../l10n/l10n.dart'; | ||
import '../settings_model.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:watch_it/watch_it.dart'; | ||
import 'package:yaru/yaru.dart'; | ||
|
||
// TODO(#793): figure out how to show the window from clicking the dock icon in macos, windows and linux | ||
// Also figure out how to show the window again, when the gtk window is triggered from the outside (open with) | ||
// if we can not figure this out, we can not land this feature. | ||
// ignore: unused_element | ||
class CloseActionSection extends StatelessWidget with WatchItMixin { | ||
const CloseActionSection({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final model = di<SettingsModel>(); | ||
|
||
final closeBtnAction = | ||
watchPropertyValue((SettingsModel m) => m.closeBtnActionIndex); | ||
return YaruSection( | ||
margin: const EdgeInsets.only( | ||
left: kYaruPagePadding, | ||
top: kYaruPagePadding, | ||
right: kYaruPagePadding, | ||
), | ||
headline: Text(context.l10n.closeBtnAction), | ||
child: Column( | ||
children: [ | ||
YaruTile( | ||
title: Text(context.l10n.whenCloseBtnClicked), | ||
trailing: YaruPopupMenuButton<CloseBtnAction>( | ||
icon: const DropDownArrow(), | ||
initialValue: closeBtnAction, | ||
child: Text(closeBtnAction.localize(context.l10n)), | ||
onSelected: (value) { | ||
model.setCloseBtnActionIndex(value); | ||
}, | ||
itemBuilder: (context) { | ||
return [ | ||
for (var i = 0; i < CloseBtnAction.values.length; ++i) | ||
PopupMenuItem( | ||
value: CloseBtnAction.values[i], | ||
child: | ||
Text(CloseBtnAction.values[i].localize(context.l10n)), | ||
), | ||
]; | ||
}, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.