Skip to content

Commit

Permalink
Fix info icon background and size
Browse files Browse the repository at this point in the history
  • Loading branch information
elibon99 committed Jan 20, 2025
1 parent 94db3b1 commit 1524ad1
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 26 deletions.
1 change: 1 addition & 0 deletions lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"s_collapse_navigation": "Navigation minimieren",
"s_show_menu": "Menü anzeigen",
"s_hide_menu": "Menü ausblenden",
"s_more_info": null,
"q_rename_target": "{label} umbenennen?",
"@q_rename_target": {
"placeholders": {
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"s_collapse_navigation": "Collapse navigation",
"s_show_menu": "Show menu",
"s_hide_menu": "Hide menu",
"s_more_info": "More info",
"q_rename_target": "Rename {label}?",
"@q_rename_target": {
"placeholders": {
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"s_collapse_navigation": "Réduire la navigation",
"s_show_menu": "Afficher le menu",
"s_hide_menu": "Cacher le menu",
"s_more_info": null,
"q_rename_target": "Renommer {label}\u00a0?",
"@q_rename_target": {
"placeholders": {
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/app_ja.arb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"s_collapse_navigation": "ナビゲーションを閉じる",
"s_show_menu": "メニューを表示する",
"s_hide_menu": "メニューを隠す",
"s_more_info": null,
"q_rename_target": "{label}の名前を変更しますか?",
"@q_rename_target": {
"placeholders": {
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"s_collapse_navigation": "Zwiń nawigację",
"s_show_menu": "Pokaż menu",
"s_hide_menu": "Ukryj menu",
"s_more_info": null,
"q_rename_target": "Zmienić nazwę {label}?",
"@q_rename_target": {
"placeholders": {
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/app_sk.arb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"s_collapse_navigation": "Zbaliť navigáciu",
"s_show_menu": "Zobraziť ponuku",
"s_hide_menu": "Skryť ponuku",
"s_more_info": null,
"q_rename_target": "Premenovať {label}?",
"@q_rename_target": {
"placeholders": {
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/app_vi.arb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"s_collapse_navigation": "Thu gọn điều hướng",
"s_show_menu": "Hiển thị thực đơn",
"s_hide_menu": "Ẩn thực đơn",
"s_more_info": null,
"q_rename_target": "Đổi tên {label}?",
"@q_rename_target": {
"placeholders": {
Expand Down
4 changes: 2 additions & 2 deletions lib/piv/views/generate_key_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ class _GenerateKeyDialogState extends ConsumerState<GenerateKeyDialog> {
},
),
InfoPopupButton(
size: 28,
iconSize: 18,
size: 30,
iconSize: 20,
showDialog: constraints.maxWidth < maxWidth,
infoText: RichText(
text: TextSpan(
Expand Down
38 changes: 14 additions & 24 deletions lib/widgets/info_popup_button.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:material_symbols_icons/symbols.dart';

import '../app/message.dart';
import 'responsive_dialog.dart';
Expand Down Expand Up @@ -27,32 +29,22 @@ class InfoPopupButton extends StatelessWidget {

@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context)!;
if (!showDialog) {
return PopupMenuButton(
tooltip: l10n.s_more_info,
constraints: BoxConstraints(maxWidth: 250, maxHeight: 400),
key: _menuKey,
popUpAnimationStyle: AnimationStyle(duration: Duration.zero),
menuPadding: EdgeInsets.zero,
padding: EdgeInsets.zero,
child: Material(
child: SizedBox(
height: size,
width: size,
child: IconButton(
constraints: size != null
? BoxConstraints(maxHeight: size!, maxWidth: size!)
: null,
onPressed: () {
dynamic state = _menuKey.currentState;
state.showButtonMenu();
},
icon: Icon(
Icons.info,
size: iconSize,
color: Theme.of(context).colorScheme.primary,
),
padding: EdgeInsets.zero,
),
borderRadius: BorderRadius.circular(25),
child: SizedBox(
height: size,
width: size,
child: Icon(
Symbols.info,
size: iconSize,
color: Theme.of(context).colorScheme.primary,
),
),
itemBuilder: (context) {
Expand All @@ -66,9 +58,7 @@ class InfoPopupButton extends StatelessWidget {
height: size,
width: size,
child: IconButton(
constraints: size != null
? BoxConstraints(maxHeight: size!, maxWidth: size!)
: null,
tooltip: l10n.s_more_info,
onPressed: () {
// Show info content in dialog on smaller screens and mobile
showBlurDialog(
Expand All @@ -80,7 +70,7 @@ class InfoPopupButton extends StatelessWidget {
);
},
icon: Icon(
Icons.info,
Symbols.info,
size: iconSize,
color: Theme.of(context).colorScheme.primary,
),
Expand Down

0 comments on commit 1524ad1

Please sign in to comment.