Fix tooltips

This commit is contained in:
Dain Nilsson 2024-04-11 10:28:54 +02:00
parent 80feeb5161
commit afecb681d2
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
6 changed files with 24 additions and 4 deletions

View File

@ -139,7 +139,7 @@ class _AppPageState extends ConsumerState<AppPage> {
// Fully expanded layout, close existing drawer if open // Fully expanded layout, close existing drawer if open
final scaffoldState = scaffoldGlobalKey.currentState; final scaffoldState = scaffoldGlobalKey.currentState;
if (scaffoldState?.isDrawerOpen == true) { if (scaffoldState?.isDrawerOpen == true) {
scaffoldState?.openEndDrawer(); scaffoldState?.closeDrawer();
} }
return _buildScaffold(context, false, true, true); return _buildScaffold(context, false, true, true);
} }
@ -481,6 +481,7 @@ class _AppPageState extends ConsumerState<AppPage> {
Scaffold _buildScaffold( Scaffold _buildScaffold(
BuildContext context, bool hasDrawer, bool hasRail, bool hasManage) { BuildContext context, bool hasDrawer, bool hasRail, bool hasManage) {
final l10n = AppLocalizations.of(context)!;
final fullyExpanded = !hasDrawer && hasRail && hasManage; final fullyExpanded = !hasDrawer && hasRail && hasManage;
final showNavigation = ref.watch(_navigationProvider); final showNavigation = ref.watch(_navigationProvider);
var body = _buildMainContent(context, hasManage); var body = _buildMainContent(context, hasManage);
@ -605,14 +606,23 @@ class _AppPageState extends ConsumerState<AppPage> {
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8), padding: const EdgeInsets.symmetric(horizontal: 8),
child: DrawerButton( child: IconButton(
icon: const Icon(Symbols.menu),
tooltip: showNavigation
? (fullyExpanded
? l10n.s_collapse_navigation
: MaterialLocalizations.of(context)
.openAppDrawerTooltip)
: l10n.s_expand_navigation,
onPressed: fullyExpanded onPressed: fullyExpanded
? () { ? () {
ref ref
.read(_navigationProvider.notifier) .read(_navigationProvider.notifier)
.toggleExpanded(); .toggleExpanded();
} }
: null, : () {
scaffoldGlobalKey.currentState?.openDrawer();
},
), ),
)), )),
const SizedBox(width: 12), const SizedBox(width: 12),
@ -644,7 +654,7 @@ class _AppPageState extends ConsumerState<AppPage> {
) )
: const Icon(Symbols.more_vert), : const Icon(Symbols.more_vert),
iconSize: 24, iconSize: 24,
tooltip: AppLocalizations.of(context)!.s_configure_yk, tooltip: l10n.s_configure_yk,
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
), ),
), ),

View File

@ -43,6 +43,8 @@
"s_details": null, "s_details": null,
"s_show_window": "Fenster anzeigen", "s_show_window": "Fenster anzeigen",
"s_hide_window": "Fenster verstecken", "s_hide_window": "Fenster verstecken",
"s_expand_navigation": null,
"s_collapse_navigation": null,
"q_rename_target": "{label} umbenennen?", "q_rename_target": "{label} umbenennen?",
"@q_rename_target": { "@q_rename_target": {
"placeholders": { "placeholders": {

View File

@ -43,6 +43,8 @@
"s_details": "Details", "s_details": "Details",
"s_show_window": "Show window", "s_show_window": "Show window",
"s_hide_window": "Hide window", "s_hide_window": "Hide window",
"s_expand_navigation": "Expand navigation",
"s_collapse_navigation": "Collapse navigation",
"q_rename_target": "Rename {label}?", "q_rename_target": "Rename {label}?",
"@q_rename_target": { "@q_rename_target": {
"placeholders": { "placeholders": {

View File

@ -43,6 +43,8 @@
"s_details": null, "s_details": null,
"s_show_window": "Afficher la fenêtre", "s_show_window": "Afficher la fenêtre",
"s_hide_window": "Masquer la fenêtre", "s_hide_window": "Masquer la fenêtre",
"s_expand_navigation": null,
"s_collapse_navigation": null,
"q_rename_target": "Renommer {label}?", "q_rename_target": "Renommer {label}?",
"@q_rename_target": { "@q_rename_target": {
"placeholders": { "placeholders": {

View File

@ -43,6 +43,8 @@
"s_details": null, "s_details": null,
"s_show_window": "ウィンドウを表示", "s_show_window": "ウィンドウを表示",
"s_hide_window": "ウィンドウを表示しない", "s_hide_window": "ウィンドウを表示しない",
"s_expand_navigation": null,
"s_collapse_navigation": null,
"q_rename_target": "{label}の名前を変更しますか?", "q_rename_target": "{label}の名前を変更しますか?",
"@q_rename_target": { "@q_rename_target": {
"placeholders": { "placeholders": {

View File

@ -43,6 +43,8 @@
"s_details": "Szczegóły", "s_details": "Szczegóły",
"s_show_window": "Pokaż okno", "s_show_window": "Pokaż okno",
"s_hide_window": "Ukryj okno", "s_hide_window": "Ukryj okno",
"s_expand_navigation": null,
"s_collapse_navigation": null,
"q_rename_target": "Zmienić nazwę {label}?", "q_rename_target": "Zmienić nazwę {label}?",
"@q_rename_target": { "@q_rename_target": {
"placeholders": { "placeholders": {