Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-09-10 14:25:41 +08:00
parent 28d8ad1e61
commit 0c1899a0af

View File

@ -546,11 +546,9 @@ class _PinMenu extends StatelessWidget {
assetName: state.pin ? "assets/pinned.svg" : "assets/unpinned.svg", assetName: state.pin ? "assets/pinned.svg" : "assets/unpinned.svg",
tooltip: state.pin ? 'Unpin Toolbar' : 'Pin Toolbar', tooltip: state.pin ? 'Unpin Toolbar' : 'Pin Toolbar',
onPressed: state.switchPin, onPressed: state.switchPin,
color: color: state.pin ? _ToolbarTheme.blueColor : _ToolbarTheme.inactiveColor,
state.pin ? _ToolbarTheme.blueColor : _ToolbarTheme.inactiveColor, hoverColor:
hoverColor: state.pin state.pin ? _ToolbarTheme.hoverBlueColor : _ToolbarTheme.hoverInactiveColor,
? _ToolbarTheme.hoverBlueColor
: _ToolbarTheme.hoverInactiveColor,
), ),
); );
} }
@ -563,18 +561,15 @@ class _MobileActionMenu extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (!ffi.ffiModel.isPeerAndroid) return Offstage(); if (!ffi.ffiModel.isPeerAndroid) return Offstage();
return Obx(() => _IconMenuButton( return Obx(()=>_IconMenuButton(
assetName: 'assets/actions_mobile.svg', assetName: 'assets/actions_mobile.svg',
tooltip: 'Mobile Actions', tooltip: 'Mobile Actions',
onPressed: () => onPressed: () => ffi.dialogManager.toggleMobileActionsOverlay(ffi: ffi),
ffi.dialogManager.toggleMobileActionsOverlay(ffi: ffi), color: ffi.dialogManager.mobileActionsOverlayVisible.isTrue
color: ffi.dialogManager.mobileActionsOverlayVisible.isTrue ? _ToolbarTheme.blueColor : _ToolbarTheme.inactiveColor,
? _ToolbarTheme.blueColor hoverColor: ffi.dialogManager.mobileActionsOverlayVisible.isTrue
: _ToolbarTheme.inactiveColor, ? _ToolbarTheme.hoverBlueColor : _ToolbarTheme.hoverInactiveColor,
hoverColor: ffi.dialogManager.mobileActionsOverlayVisible.isTrue ));
? _ToolbarTheme.hoverBlueColor
: _ToolbarTheme.hoverInactiveColor,
));
} }
} }
@ -1633,26 +1628,26 @@ class _IconMenuButtonState extends State<_IconMenuButton> {
width: _ToolbarTheme.buttonSize, width: _ToolbarTheme.buttonSize,
height: _ToolbarTheme.buttonSize, height: _ToolbarTheme.buttonSize,
child: MenuItemButton( child: MenuItemButton(
style: ButtonStyle( style: ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.transparent), backgroundColor: MaterialStatePropertyAll(Colors.transparent),
padding: MaterialStatePropertyAll(EdgeInsets.zero), padding: MaterialStatePropertyAll(EdgeInsets.zero),
overlayColor: MaterialStatePropertyAll(Colors.transparent)), overlayColor: MaterialStatePropertyAll(Colors.transparent)),
onHover: (value) => setState(() { onHover: (value) => setState(() {
hover = value; hover = value;
}), }),
onPressed: widget.onPressed, onPressed: widget.onPressed,
child: Tooltip( child: Tooltip(
message: translate(widget.tooltip), message: translate(widget.tooltip),
child: Material( child: Material(
type: MaterialType.transparency, type: MaterialType.transparency,
child: Ink( child: Ink(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.circular(_ToolbarTheme.iconRadius),
BorderRadius.circular(_ToolbarTheme.iconRadius), color: hover ? widget.hoverColor : widget.color,
color: hover ? widget.hoverColor : widget.color, ),
), child: icon)),
child: icon)), )
)), ),
).marginSymmetric( ).marginSymmetric(
horizontal: widget.hMargin ?? _ToolbarTheme.buttonHMargin, horizontal: widget.hMargin ?? _ToolbarTheme.buttonHMargin,
vertical: widget.vMargin ?? _ToolbarTheme.buttonVMargin); vertical: widget.vMargin ?? _ToolbarTheme.buttonVMargin);