1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-26 10:50:29 +02:00

fix(mobile): immich app bar tap radius (#4816)

* mobile: tool-tip for server url in app bar dialog

* fix: Add Inkwell around the entire profile image

* mobile: open documentation and github in browser

---------

Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2023-11-03 14:04:06 +00:00 committed by GitHub
parent 5f43971ccf
commit 81792a5342
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 42 deletions

View File

@ -194,6 +194,7 @@ class ImmichAppBarDialog extends HookConsumerWidget {
Navigator.of(context).pop(); Navigator.of(context).pop();
launchUrl( launchUrl(
Uri.parse('https://immich.app'), Uri.parse('https://immich.app'),
mode: LaunchMode.externalApplication,
); );
}, },
child: Text( child: Text(
@ -213,6 +214,7 @@ class ImmichAppBarDialog extends HookConsumerWidget {
Navigator.of(context).pop(); Navigator.of(context).pop();
launchUrl( launchUrl(
Uri.parse('https://github.com/immich-app/immich'), Uri.parse('https://github.com/immich-app/immich'),
mode: LaunchMode.externalApplication,
); );
}, },
child: Text( child: Text(

View File

@ -182,19 +182,36 @@ class AppBarServerInfo extends HookConsumerWidget {
child: Container( child: Container(
width: 200, width: 200,
padding: const EdgeInsets.only(right: 10.0), padding: const EdgeInsets.only(right: 10.0),
child: Text( child: Tooltip(
getServerUrl() ?? '--', verticalOffset: 0,
style: TextStyle( decoration: BoxDecoration(
fontSize: 11, color:
color: Theme.of(context) Theme.of(context).primaryColor.withOpacity(0.9),
.textTheme borderRadius: BorderRadius.circular(10),
.labelSmall ),
?.color textStyle: TextStyle(
?.withOpacity(0.5), color: Theme.of(context).brightness == Brightness.dark
fontWeight: FontWeight.bold, ? Colors.black
overflow: TextOverflow.ellipsis, : Colors.white,
fontWeight: FontWeight.bold,
),
message: getServerUrl() ?? '--',
preferBelow: false,
triggerMode: TooltipTriggerMode.tap,
child: Text(
getServerUrl() ?? '--',
style: TextStyle(
fontSize: 11,
color: Theme.of(context)
.textTheme
.labelSmall
?.color
?.withOpacity(0.5),
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
),
textAlign: TextAlign.end,
), ),
textAlign: TextAlign.end,
), ),
), ),
), ),

View File

@ -31,7 +31,7 @@ class ImmichAppBar extends ConsumerWidget implements PreferredSizeWidget {
final isDarkMode = Theme.of(context).brightness == Brightness.dark; final isDarkMode = Theme.of(context).brightness == Brightness.dark;
const widgetSize = 30.0; const widgetSize = 30.0;
buildProfilePhoto() { buildProfileIndicator() {
return InkWell( return InkWell(
onTap: () => showDialog( onTap: () => showDialog(
context: context, context: context,
@ -39,37 +39,33 @@ class ImmichAppBar extends ConsumerWidget implements PreferredSizeWidget {
builder: (ctx) => const ImmichAppBarDialog(), builder: (ctx) => const ImmichAppBarDialog(),
), ),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
child: authState.profileImagePath.isEmpty || user == null child: Badge(
? const Icon( label: Container(
Icons.face_outlined, decoration: BoxDecoration(
size: widgetSize, color: Colors.black,
) borderRadius: BorderRadius.circular(widgetSize / 2),
: UserCircleAvatar( ),
radius: 15, child: const Icon(
size: 27, Icons.info,
user: user, color: Color.fromARGB(255, 243, 188, 106),
), size: widgetSize / 2,
); ),
}
buildProfileIndicator() {
return Badge(
label: Container(
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(widgetSize / 2),
),
child: const Icon(
Icons.info,
color: Color.fromARGB(255, 243, 188, 106),
size: widgetSize / 2,
), ),
backgroundColor: Colors.transparent,
alignment: Alignment.bottomRight,
isLabelVisible: serverInfoState.isVersionMismatch,
offset: const Offset(2, 2),
child: authState.profileImagePath.isEmpty || user == null
? const Icon(
Icons.face_outlined,
size: widgetSize,
)
: UserCircleAvatar(
radius: 15,
size: 27,
user: user,
),
), ),
backgroundColor: Colors.transparent,
alignment: Alignment.bottomRight,
isLabelVisible: serverInfoState.isVersionMismatch,
offset: const Offset(2, 2),
child: buildProfilePhoto(),
); );
} }