Skip to content

Commit

Permalink
feat: minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa committed Nov 12, 2023
1 parent 13ce3d9 commit daa0007
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 23 deletions.
6 changes: 5 additions & 1 deletion lib/widgets/device_grid/desktop/desktop_device_grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,11 @@ class _DesktopTileViewportState extends State<DesktopTileViewport> {
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
icon: Icon(moreIconData),
icon: Icon(
moreIconData,
shadows: outlinedText(),
color: Colors.white,
),
tooltip: loc.more,
onPressed: () async {
final device = await showStreamDataDialog(
Expand Down
25 changes: 12 additions & 13 deletions lib/widgets/device_grid/desktop/external_stream.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import 'package:bluecherry_client/providers/desktop_view_provider.dart';
import 'package:bluecherry_client/providers/settings_provider.dart';
import 'package:bluecherry_client/utils/config.dart';
import 'package:bluecherry_client/utils/extensions.dart';
import 'package:bluecherry_client/widgets/misc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:provider/provider.dart';
Expand Down Expand Up @@ -332,18 +331,18 @@ class VideoOverlaysEditor extends StatelessWidget {
const SizedBox(height: 2.0),
TextFormField(
initialValue: overlay.text,
style: theme.textTheme.bodyLarge!
.copyWith(
shadows: outlinedText(
strokeColor: (overlay.textStyle?.color ?? Colors.black)
.computeLuminance() >
0.5
? Colors.black
: Colors.white,
strokeWidth: 0.5,
),
)
.merge(overlay.textStyle),
style: theme.textTheme.bodyLarge!,
// .copyWith(
// shadows: outlinedText(
// strokeColor: (overlay.textStyle?.color ?? Colors.black)
// .computeLuminance() >
// 0.5
// ? Colors.black
// : Colors.white,
// strokeWidth: 0.5,
// ),
// )
// .merge(overlay.textStyle),
onChanged: (text) {
onChanged(
overlays.indexOf(overlay).clamp(0, overlays.length),
Expand Down
18 changes: 11 additions & 7 deletions lib/widgets/device_grid/desktop/stream_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,15 @@ class _StreamDataState extends State<StreamData> {
padding: EdgeInsetsDirectional.symmetric(horizontal: 8.0),
child: VerticalDivider(),
),
SizedBox(
width: 280.0,
child: VideoOverlaysEditor(
overlays: overlays,
onChanged: (index, overlay) {
setState(() => overlays[index] = overlay);
},
ConstrainedBox(
constraints: const BoxConstraints(minWidth: 280.0),
child: IntrinsicWidth(
child: VideoOverlaysEditor(
overlays: overlays,
onChanged: (index, overlay) {
setState(() => overlays[index] = overlay);
},
),
),
),
]
Expand All @@ -223,6 +225,8 @@ class _StreamDataState extends State<StreamData> {
Row(children: [
if (widget.device.hasPTZ)
PTZToggleButton(
enabledColor: theme.colorScheme.inversePrimary,
disabledColor: theme.colorScheme.inversePrimary.withOpacity(0.5),
ptzEnabled: ptzEnabled,
onChanged: (v) {
setState(() => ptzEnabled = v);
Expand Down
10 changes: 8 additions & 2 deletions lib/widgets/ptz.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,15 @@ class PTZToggleButton extends StatelessWidget {
final bool ptzEnabled;
final ValueChanged<bool> onChanged;

final Color? enabledColor;
final Color? disabledColor;

const PTZToggleButton({
super.key,
required this.ptzEnabled,
required this.onChanged,
this.enabledColor,
this.disabledColor,
});

@override
Expand All @@ -229,8 +234,9 @@ class PTZToggleButton extends StatelessWidget {
icon: Icon(
Icons.videogame_asset,
color: ptzEnabled
? Colors.white
: theme.colorScheme.onInverseSurface.withOpacity(0.86),
? enabledColor ?? Colors.white
: disabledColor ??
theme.colorScheme.onInverseSurface.withOpacity(0.86),
),
tooltip: ptzEnabled ? loc.enabledPTZ : loc.disabledPTZ,
onPressed: () => onChanged(!ptzEnabled),
Expand Down

0 comments on commit daa0007

Please sign in to comment.