fix: apply disabled styling to UI buttons (#30322)

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2026-07-30 14:53:08 +05:30 committed by GitHub
parent 9d03a92b10
commit 7e70f90c15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 42 deletions

View file

@ -43,21 +43,10 @@ class _ImmichColumnButtonState extends State<ImmichColumnButton> {
}
}
Future<void>? _onPressed() {
if (_isDisabled) {
return null;
}
VoidCallback? get _onPressed => _isDisabled ? null : () => _runAction(widget.onPressed);
return _runAction(widget.onPressed);
}
Future<void>? _onLongPress() {
if (_isDisabled || widget.onLongPress == null) {
return null;
}
return _runAction(widget.onLongPress!);
}
VoidCallback? get _onLongPress =>
_isDisabled || widget.onLongPress == null ? null : () => _runAction(widget.onLongPress!);
@override
Widget build(BuildContext context) {

View file

@ -44,21 +44,10 @@ class _ImmichIconButtonState extends State<ImmichIconButton> {
}
}
Future<void>? _onPressed() {
if (_isDisabled) {
return null;
}
VoidCallback? get _onPressed => _isDisabled ? null : () => _runAction(widget.onPressed);
return _runAction(widget.onPressed);
}
Future<void>? _onLongPress() {
if (_isDisabled || widget.onLongPress == null) {
return null;
}
return _runAction(widget.onLongPress!);
}
VoidCallback? get _onLongPress =>
_isDisabled || widget.onLongPress == null ? null : () => _runAction(widget.onLongPress!);
@override
Widget build(BuildContext context) {

View file

@ -46,21 +46,10 @@ class _ImmichTextButtonState extends State<ImmichTextButton> {
}
}
Future<void>? _onPressed() {
if (_isDisabled) {
return null;
}
VoidCallback? get _onPressed => _isDisabled ? null : () => _runAction(widget.onPressed);
return _runAction(widget.onPressed);
}
Future<void>? _onLongPress() {
if (_isDisabled || widget.onLongPress == null) {
return null;
}
return _runAction(widget.onLongPress!);
}
VoidCallback? get _onLongPress =>
_isDisabled || widget.onLongPress == null ? null : () => _runAction(widget.onLongPress!);
@override
Widget build(BuildContext context) {