added new call end/wait icons

This commit is contained in:
NicKoehler 2023-02-15 13:19:15 +01:00
parent c5d39b0c10
commit 9525960802
No known key found for this signature in database
GPG Key ID: BAE01394EB51AC58
7 changed files with 38 additions and 56 deletions

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="587.811 560.459 32 32" width="32pt" height="32pt"><g><path d=" M 587.811 560.459 L 619.811 560.459 L 619.811 592.459 L 587.811 592.459 L 587.811 560.459 Z " fill="none"/><path d=" M 601.469 580.246 L 597.61 584.104 C 597.212 584.503 596.564 584.503 596.166 584.104 L 596.166 584.104 C 595.767 583.706 595.767 583.058 596.166 582.66 L 600.024 578.801 L 600.024 578.801 L 602.578 576.248 L 602.578 576.248 L 602.578 576.248 L 606.428 572.397 C 606.827 571.998 607.474 571.998 607.873 572.397 L 607.873 572.397 C 608.272 572.796 608.272 573.443 607.873 573.842 L 604.022 577.692 L 606.321 579.991 C 606.791 580.461 607.56 580.467 608.038 580.005 Q 611.127 577.017 614.256 579.888 Q 614.286 579.914 614.345 579.971 C 614.685 580.311 614.872 580.771 614.872 581.247 C 614.876 581.728 614.685 582.183 614.344 582.524 L 612.978 583.89 C 611.935 584.933 610.522 585.52 609.05 585.52 C 607.577 585.52 606.156 584.933 605.117 583.894 C 605.117 583.894 605.117 583.894 605.117 583.894 L 601.469 580.246 Z M 600.546 574.215 L 600.279 573.949 C 599.809 573.479 599.803 572.71 600.265 572.232 Q 603.253 569.142 600.382 566.014 Q 600.356 565.983 600.299 565.925 C 599.958 565.585 599.499 565.398 599.023 565.398 C 598.542 565.394 598.087 565.585 597.746 565.926 L 596.38 567.292 C 595.337 568.335 594.75 569.747 594.75 571.22 C 594.75 572.693 595.337 574.114 596.376 575.153 C 596.376 575.153 596.376 575.153 596.376 575.153 L 597.992 576.769 C 598.316 577.093 598.843 577.093 599.167 576.769 L 600.546 575.391 C 600.87 575.066 600.87 574.54 600.546 574.215 L 600.546 574.215 Z " fill-rule="evenodd" fill="rgb(0,0,0)"/></g></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="587.811 592.459 32 32" width="32pt" height="32pt"><g><path d=" M 587.811 592.459 L 619.811 592.459 L 619.811 624.459 L 587.811 624.459 L 587.811 592.459 Z " fill="none"/><path d=" M 595.385 608.153 C 595.385 608.153 595.385 608.153 595.385 608.153 C 594.348 607.116 593.761 605.696 593.761 604.225 C 593.761 602.754 594.348 601.342 595.389 600.301 L 596.754 598.936 C 597.094 598.596 597.549 598.405 598.029 598.409 C 598.505 598.409 598.964 598.596 599.304 598.935 Q 599.36 598.994 599.387 599.024 Q 602.255 602.149 599.27 605.236 C 598.808 605.713 598.815 606.481 599.284 606.95 L 605.32 612.986 C 605.789 613.455 606.557 613.462 607.034 613 Q 610.12 610.015 613.246 612.883 Q 613.276 612.91 613.335 612.966 C 613.674 613.306 613.861 613.765 613.861 614.241 C 613.865 614.721 613.674 615.176 613.334 615.516 L 611.969 616.881 C 610.928 617.922 609.516 618.509 608.045 618.509 C 606.574 618.509 605.154 617.922 604.117 616.885 C 604.117 616.885 604.117 616.885 604.117 616.885 L 595.385 608.153 Z M 602.811 606.329 C 602.811 605.658 603.355 605.114 604.025 605.114 C 604.695 605.114 605.239 605.658 605.239 606.329 C 605.239 606.999 604.695 607.543 604.025 607.543 C 603.355 607.543 602.811 606.999 602.811 606.329 Z M 606.622 606.329 C 606.622 605.658 607.166 605.114 607.836 605.114 C 608.506 605.114 609.05 605.658 609.05 606.329 C 609.05 606.999 608.506 607.543 607.836 607.543 C 607.166 607.543 606.622 606.999 606.622 606.329 Z M 610.433 606.329 C 610.433 605.658 610.977 605.114 611.647 605.114 C 612.317 605.114 612.861 605.658 612.861 606.329 C 612.861 606.999 612.317 607.543 611.647 607.543 C 610.977 607.543 610.433 606.999 610.433 606.329 Z " fill-rule="evenodd" fill="rgb(0,0,0)"/></g></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -201,7 +201,7 @@ class _RemotePageState extends State<RemotePage>
Widget buildBody(BuildContext context) {
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: Theme.of(context).backgroundColor,
/// the Overlay key will be set with _blockableOverlayState in BlockableOverlay
/// see override build() in [BlockableOverlay]

View File

@ -137,7 +137,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
width: stateGlobal.windowBorderWidth.value),
),
child: Scaffold(
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: Theme.of(context).backgroundColor,
body: DesktopTab(
controller: tabController,
onWindowCloseButton: handleWindowCloseButton,

View File

@ -1401,7 +1401,6 @@ class PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
return MenuButton(
icon: widget.icon ?? Icon(Icons.adaptive.more),
iconSize: widget.iconSize ?? iconTheme.size ?? _kDefaultIconSize,
tooltip:
widget.tooltip ?? MaterialLocalizations.of(context).showMenuTooltip,
onPressed: widget.enabled ? showButtonMenu : null,

View File

@ -6,8 +6,7 @@ class MenuButton extends StatefulWidget {
final Color hoverColor;
final Color? splashColor;
final Widget icon;
final double iconSize;
final String tooltip;
final String? tooltip;
final EdgeInsetsGeometry padding;
final bool enableFeedback;
const MenuButton({
@ -16,9 +15,8 @@ class MenuButton extends StatefulWidget {
required this.color,
required this.hoverColor,
required this.icon,
required this.iconSize,
required this.tooltip,
this.splashColor,
this.tooltip = "",
this.padding = const EdgeInsets.all(5),
this.enableFeedback = true,
});

View File

@ -409,10 +409,9 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
Widget _buildMenubar(BuildContext context) {
final List<Widget> menubarItems = [];
final double iconSize = Theme.of(context).iconTheme.size ?? 30.0;
if (!isWebDesktop) {
menubarItems.add(_buildPinMenubar(context, iconSize));
menubarItems.add(_buildFullscreen(context, iconSize));
menubarItems.add(_buildPinMenubar(context));
menubarItems.add(_buildFullscreen(context));
if (widget.ffi.ffiModel.isPeerAndroid) {
menubarItems.add(IconButton(
tooltip: translate('Mobile Actions'),
@ -425,16 +424,16 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
));
}
}
menubarItems.add(_buildMonitor(context, iconSize));
menubarItems.add(_buildControl(context, iconSize));
menubarItems.add(_buildDisplay(context, iconSize));
menubarItems.add(_buildKeyboard(context, iconSize));
menubarItems.add(_buildMonitor(context));
menubarItems.add(_buildControl(context));
menubarItems.add(_buildDisplay(context));
menubarItems.add(_buildKeyboard(context));
if (!isWeb) {
menubarItems.add(_buildChat(context, iconSize));
menubarItems.add(_buildVoiceCall(context, iconSize));
menubarItems.add(_buildChat(context));
menubarItems.add(_buildVoiceCall(context));
}
menubarItems.add(_buildRecording(context, iconSize));
menubarItems.add(_buildClose(context, iconSize));
menubarItems.add(_buildRecording(context));
menubarItems.add(_buildClose(context));
return PopupMenuTheme(
data: const PopupMenuThemeData(
textStyle: TextStyle(color: _MenubarTheme.blueColor)),
@ -459,10 +458,9 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
);
}
Widget _buildPinMenubar(BuildContext context, double iconSize) {
Widget _buildPinMenubar(BuildContext context) {
return Obx(
() => MenuButton(
iconSize: iconSize,
tooltip: translate(pin ? 'Unpin menubar' : 'Pin menubar'),
onPressed: () {
widget.state.switchPin();
@ -477,9 +475,8 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
);
}
Widget _buildFullscreen(BuildContext context, double iconSize) {
Widget _buildFullscreen(BuildContext context) {
return MenuButton(
iconSize: iconSize,
tooltip: translate(isFullscreen ? 'Exit Fullscreen' : 'Fullscreen'),
onPressed: () {
_setFullscreen(!isFullscreen);
@ -493,10 +490,9 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
);
}
Widget _buildMonitor(BuildContext context, double iconSize) {
Widget _buildMonitor(BuildContext context) {
final pi = widget.ffi.ffiModel.pi;
return mod_menu.PopupMenuButton(
iconSize: iconSize,
tooltip: translate('Select Monitor'),
position: mod_menu.PopupMenuPosition.under,
icon: Stack(
@ -575,9 +571,8 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
);
}
Widget _buildControl(BuildContext context, double iconSize) {
Widget _buildControl(BuildContext context) {
return mod_menu.PopupMenuButton(
iconSize: iconSize,
padding: EdgeInsets.zero,
icon: SvgPicture.asset(
"assets/actions.svg",
@ -598,7 +593,7 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
);
}
Widget _buildDisplay(BuildContext context, double iconSize) {
Widget _buildDisplay(BuildContext context) {
return FutureBuilder(future: () async {
widget.state.viewStyle.value =
await bind.sessionGetViewStyle(id: widget.id) ?? '';
@ -610,7 +605,6 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
return Obx(() {
final remoteCount = RemoteCountState.find().value;
return mod_menu.PopupMenuButton(
iconSize: iconSize,
padding: EdgeInsets.zero,
icon: SvgPicture.asset(
"assets/display.svg",
@ -638,13 +632,12 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
});
}
Widget _buildKeyboard(BuildContext context, double iconSize) {
Widget _buildKeyboard(BuildContext context) {
FfiModel ffiModel = Provider.of<FfiModel>(context);
if (ffiModel.permissions['keyboard'] == false) {
return Offstage();
}
return mod_menu.PopupMenuButton(
iconSize: iconSize,
padding: EdgeInsets.zero,
icon: SvgPicture.asset(
"assets/keyboard.svg",
@ -665,12 +658,11 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
);
}
Widget _buildRecording(BuildContext context, double iconSize) {
Widget _buildRecording(BuildContext context) {
return Consumer<FfiModel>(builder: ((context, value, child) {
if (value.permissions['recording'] != false) {
return Consumer<RecordingModel>(
builder: (context, value, child) => MenuButton(
iconSize: iconSize,
tooltip: value.start
? translate('Stop session recording')
: translate('Start session recording'),
@ -692,9 +684,8 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
}));
}
Widget _buildClose(BuildContext context, double iconSize) {
Widget _buildClose(BuildContext context) {
return MenuButton(
iconSize: iconSize,
tooltip: translate('Close'),
onPressed: () {
clientClose(widget.id, widget.ffi.dialogManager);
@ -709,10 +700,9 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
}
final _chatButtonKey = GlobalKey();
Widget _buildChat(BuildContext context, double iconSize) {
Widget _buildChat(BuildContext context) {
FfiModel ffiModel = Provider.of<FfiModel>(context);
return mod_menu.PopupMenuButton(
iconSize: iconSize,
key: _chatButtonKey,
padding: EdgeInsets.zero,
icon: SvgPicture.asset(
@ -737,24 +727,15 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
Widget _getVoiceCallIcon() {
switch (widget.ffi.chatModel.voiceCallStatus.value) {
case VoiceCallStatus.waitingForResponse:
return IconButton(
onPressed: () {
widget.ffi.chatModel.closeVoiceCall(widget.id);
},
icon: SvgPicture.asset(
"assets/voice_call_waiting.svg",
color: Colors.red,
),
return SvgPicture.asset(
"assets/call_wait.svg",
color: Colors.white,
);
case VoiceCallStatus.connected:
return IconButton(
onPressed: () {
widget.ffi.chatModel.closeVoiceCall(widget.id);
},
icon: Icon(
Icons.phone_disabled_rounded,
color: Colors.red,
),
return SvgPicture.asset(
"assets/call_end.svg",
color: Colors.white,
);
default:
return const Offstage();
@ -772,18 +753,18 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
}
}
Widget _buildVoiceCall(BuildContext context, double iconSize) {
Widget _buildVoiceCall(BuildContext context) {
return Obx(
() {
final tooltipText = _getVoiceCallTooltip();
return tooltipText == null
? const Offstage()
: IconButton(
iconSize: iconSize,
padding: EdgeInsets.zero,
: MenuButton(
icon: _getVoiceCallIcon(),
tooltip: translate(tooltipText),
onPressed: () => bind.sessionRequestVoiceCall(id: widget.id),
color: _MenubarTheme.redColor,
hoverColor: _MenubarTheme.hoverRedColor,
);
},
);