Add option to hide tooltips
This commit is contained in:
parent
ffe2a300e4
commit
afc457534f
|
|
@ -1,8 +1,10 @@
|
||||||
// Flutter imports:
|
// Flutter imports:
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
|
|
||||||
// Project imports:
|
// Project imports:
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/icons.dart';
|
import 'package:invoiceninja_flutter/utils/icons.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
|
|
||||||
|
|
@ -28,6 +30,7 @@ class ActionMenuButton extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final List<PopupMenuEntry<EntityAction>> actions = [];
|
final List<PopupMenuEntry<EntityAction>> actions = [];
|
||||||
|
final store = StoreProvider.of<AppState>(context);
|
||||||
|
|
||||||
if (isSaving) {
|
if (isSaving) {
|
||||||
return IconButton(
|
return IconButton(
|
||||||
|
|
@ -75,6 +78,7 @@ class ActionMenuButton extends StatelessWidget {
|
||||||
onSelected(context, action);
|
onSelected(context, action);
|
||||||
},
|
},
|
||||||
enabled: actions.isNotEmpty,
|
enabled: actions.isNotEmpty,
|
||||||
|
tooltip: store.state.prefState.enableTooltips ? null : '',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final state = StoreProvider.of<AppState>(context).state;
|
final state = StoreProvider.of<AppState>(context).state;
|
||||||
|
final prefState = state.prefState;
|
||||||
|
|
||||||
final _showFilterStateSheet = () {
|
final _showFilterStateSheet = () {
|
||||||
if (closeBottomSheet() == kFilterStatePanel) {
|
if (closeBottomSheet() == kFilterStatePanel) {
|
||||||
|
|
@ -410,7 +411,9 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
if (!widget.hideListOptions) ...[
|
if (!widget.hideListOptions) ...[
|
||||||
if (isMobile(context))
|
if (isMobile(context))
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: localization.multiselect,
|
tooltip: prefState.enableTooltips
|
||||||
|
? localization.multiselect
|
||||||
|
: null,
|
||||||
icon: Icon(Icons.check_box),
|
icon: Icon(Icons.check_box),
|
||||||
onPressed: () => widget.onCheckboxPressed(),
|
onPressed: () => widget.onCheckboxPressed(),
|
||||||
),
|
),
|
||||||
|
|
@ -429,7 +432,8 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
),
|
),
|
||||||
if (widget.statuses.isNotEmpty && isMobile(context))
|
if (widget.statuses.isNotEmpty && isMobile(context))
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: localization.status,
|
tooltip:
|
||||||
|
prefState.enableTooltips ? localization.status : null,
|
||||||
icon: Icon(Icons.filter),
|
icon: Icon(Icons.filter),
|
||||||
onPressed: _showFilterStatusSheet,
|
onPressed: _showFilterStatusSheet,
|
||||||
color: store.state
|
color: store.state
|
||||||
|
|
@ -440,8 +444,10 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
),
|
),
|
||||||
if (widget.customValues1.isNotEmpty)
|
if (widget.customValues1.isNotEmpty)
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: localization.filteredBy.replaceFirst(
|
tooltip: prefState.enableTooltips
|
||||||
':value', widget.customValues1.join(', ')),
|
? localization.filteredBy.replaceFirst(
|
||||||
|
':value', widget.customValues1.join(', '))
|
||||||
|
: null,
|
||||||
icon: Icon(Icons.looks_one),
|
icon: Icon(Icons.looks_one),
|
||||||
onPressed: _showFilterCustom1Sheet,
|
onPressed: _showFilterCustom1Sheet,
|
||||||
color: store.state
|
color: store.state
|
||||||
|
|
@ -452,8 +458,10 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
),
|
),
|
||||||
if (widget.customValues2.isNotEmpty)
|
if (widget.customValues2.isNotEmpty)
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: localization.filteredBy.replaceFirst(
|
tooltip: prefState.enableTooltips
|
||||||
':value', widget.customValues2.join(', ')),
|
? localization.filteredBy.replaceFirst(
|
||||||
|
':value', widget.customValues2.join(', '))
|
||||||
|
: null,
|
||||||
icon: Icon(Icons.looks_two),
|
icon: Icon(Icons.looks_two),
|
||||||
onPressed: _showFilterCustom2Sheet,
|
onPressed: _showFilterCustom2Sheet,
|
||||||
color: store.state
|
color: store.state
|
||||||
|
|
@ -464,8 +472,10 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
),
|
),
|
||||||
if (widget.customValues3.isNotEmpty)
|
if (widget.customValues3.isNotEmpty)
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: localization.filteredBy.replaceFirst(
|
tooltip: prefState.enableTooltips
|
||||||
':value', widget.customValues3.join(', ')),
|
? localization.filteredBy.replaceFirst(
|
||||||
|
':value', widget.customValues3.join(', '))
|
||||||
|
: '',
|
||||||
icon: Icon(Icons.looks_3),
|
icon: Icon(Icons.looks_3),
|
||||||
onPressed: _showFilterCustom3Sheet,
|
onPressed: _showFilterCustom3Sheet,
|
||||||
color: store.state
|
color: store.state
|
||||||
|
|
@ -476,8 +486,10 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
),
|
),
|
||||||
if (widget.customValues4.isNotEmpty)
|
if (widget.customValues4.isNotEmpty)
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: localization.filteredBy.replaceFirst(
|
tooltip: prefState.enableTooltips
|
||||||
':value', widget.customValues4.join(', ')),
|
? localization.filteredBy.replaceFirst(
|
||||||
|
':value', widget.customValues4.join(', '))
|
||||||
|
: '',
|
||||||
icon: Icon(Icons.looks_4),
|
icon: Icon(Icons.looks_4),
|
||||||
onPressed: _showFilterCustom4Sheet,
|
onPressed: _showFilterCustom4Sheet,
|
||||||
color: store.state
|
color: store.state
|
||||||
|
|
@ -488,8 +500,11 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
),
|
),
|
||||||
if (!widget.entityType.isSetting)
|
if (!widget.entityType.isSetting)
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip:
|
tooltip: prefState.enableTooltips
|
||||||
isList ? localization.showTable : localization.showList,
|
? (isList
|
||||||
|
? localization.showTable
|
||||||
|
: localization.showList)
|
||||||
|
: null,
|
||||||
icon: Icon(isList ? Icons.table_chart : Icons.view_list),
|
icon: Icon(isList ? Icons.table_chart : Icons.view_list),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
store.dispatch(SwitchListTableLayout());
|
store.dispatch(SwitchListTableLayout());
|
||||||
|
|
@ -498,7 +513,8 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
if (!widget.hideListOptions) ...[
|
if (!widget.hideListOptions) ...[
|
||||||
if (isList && widget.sortFields.isNotEmpty)
|
if (isList && widget.sortFields.isNotEmpty)
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: localization.sort,
|
tooltip:
|
||||||
|
prefState.enableTooltips ? localization.sort : null,
|
||||||
icon: Icon(Icons.sort_by_alpha),
|
icon: Icon(Icons.sort_by_alpha),
|
||||||
onPressed: _showSortSheet,
|
onPressed: _showSortSheet,
|
||||||
),
|
),
|
||||||
|
|
@ -515,14 +531,18 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
else
|
else
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(Icons.view_week),
|
icon: Icon(Icons.view_week),
|
||||||
tooltip: localization.columns,
|
tooltip: prefState.enableTooltips
|
||||||
|
? localization.columns
|
||||||
|
: null,
|
||||||
onPressed: _onColumnsPressed,
|
onPressed: _onColumnsPressed,
|
||||||
),
|
),
|
||||||
if (state.prefState.isDesktop)
|
if (state.prefState.isDesktop)
|
||||||
AppBorder(
|
AppBorder(
|
||||||
isLeft: true,
|
isLeft: true,
|
||||||
child: Tooltip(
|
child: Tooltip(
|
||||||
message: localization.refreshData,
|
message: prefState.enableTooltips
|
||||||
|
? localization.refreshData
|
||||||
|
: '',
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () => store.dispatch(RefreshData()),
|
onTap: () => store.dispatch(RefreshData()),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ class ListScaffold extends StatelessWidget {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final store = StoreProvider.of<AppState>(context);
|
final store = StoreProvider.of<AppState>(context);
|
||||||
final state = store.state;
|
final state = store.state;
|
||||||
|
final prefState = state.prefState;
|
||||||
final localization = AppLocalization.of(context);
|
final localization = AppLocalization.of(context);
|
||||||
final isSettings = entityType.isSetting;
|
final isSettings = entityType.isSetting;
|
||||||
|
|
||||||
|
|
@ -80,6 +81,7 @@ class ListScaffold extends StatelessWidget {
|
||||||
} else if (entityType != null && entityType != EntityType.settings) {
|
} else if (entityType != null && entityType != EntityType.settings) {
|
||||||
leading = IconButton(
|
leading = IconButton(
|
||||||
icon: Icon(Icons.add),
|
icon: Icon(Icons.add),
|
||||||
|
tooltip: prefState.enableTooltips ? localization.createNew : null,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
createEntityByType(entityType: entityType, context: context);
|
createEntityByType(entityType: entityType, context: context);
|
||||||
},
|
},
|
||||||
|
|
@ -93,6 +95,7 @@ class ListScaffold extends StatelessWidget {
|
||||||
Expanded(
|
Expanded(
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: Icon(Icons.check_box),
|
icon: Icon(Icons.check_box),
|
||||||
|
tooltip: prefState.enableTooltips ? localization.multiselect : null,
|
||||||
onPressed: state.prefState.showKanban &&
|
onPressed: state.prefState.showKanban &&
|
||||||
state.uiState.mainRoute == '${EntityType.task}'
|
state.uiState.mainRoute == '${EntityType.task}'
|
||||||
? null
|
? null
|
||||||
|
|
@ -144,7 +147,9 @@ class ListScaffold extends StatelessWidget {
|
||||||
Builder(
|
Builder(
|
||||||
builder: (context) => IconButton(
|
builder: (context) => IconButton(
|
||||||
padding: const EdgeInsets.only(left: 4, right: 20),
|
padding: const EdgeInsets.only(left: 4, right: 20),
|
||||||
tooltip: localization.history,
|
tooltip: prefState.enableTooltips
|
||||||
|
? localization.history
|
||||||
|
: null,
|
||||||
icon: Icon(Icons.history),
|
icon: Icon(Icons.history),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (isMobile(context) ||
|
if (isMobile(context) ||
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ class EntityDataTableSource extends AppDataTableSource {
|
||||||
@override
|
@override
|
||||||
DataRow getRow(int index) {
|
DataRow getRow(int index) {
|
||||||
final state = StoreProvider.of<AppState>(context).state;
|
final state = StoreProvider.of<AppState>(context).state;
|
||||||
|
final prefState = state.prefState;
|
||||||
final entity = entityMap[entityList[index]];
|
final entity = entityMap[entityList[index]];
|
||||||
entityPresenter.initialize(entity, context);
|
entityPresenter.initialize(entity, context);
|
||||||
|
|
||||||
|
|
@ -113,7 +114,9 @@ class EntityDataTableSource extends AppDataTableSource {
|
||||||
Row(
|
Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: AppLocalization.of(context).editRecord,
|
tooltip: prefState.enableTooltips
|
||||||
|
? AppLocalization.of(context).editRecord
|
||||||
|
: null,
|
||||||
onPressed: () => editEntity(context: context, entity: entity),
|
onPressed: () => editEntity(context: context, entity: entity),
|
||||||
icon: GestureDetector(
|
icon: GestureDetector(
|
||||||
child: Icon(MdiIcons.circleEditOutline),
|
child: Icon(MdiIcons.circleEditOutline),
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,9 @@ class _DashboardScreenState extends State<DashboardScreen>
|
||||||
Builder(
|
Builder(
|
||||||
builder: (context) => IconButton(
|
builder: (context) => IconButton(
|
||||||
padding: const EdgeInsets.only(left: 4, right: 20),
|
padding: const EdgeInsets.only(left: 4, right: 20),
|
||||||
tooltip: localization.history,
|
tooltip: state.prefState.enableTooltips
|
||||||
|
? localization.history
|
||||||
|
: null,
|
||||||
icon: Icon(Icons.history),
|
icon: Icon(Icons.history),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (isMobile(context) || state.prefState.isHistoryFloated) {
|
if (isMobile(context) || state.prefState.isHistoryFloated) {
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,9 @@ class ReportsScreen extends StatelessWidget {
|
||||||
builder: (context) => IconButton(
|
builder: (context) => IconButton(
|
||||||
icon: Icon(Icons.history),
|
icon: Icon(Icons.history),
|
||||||
padding: const EdgeInsets.only(left: 4, right: 20),
|
padding: const EdgeInsets.only(left: 4, right: 20),
|
||||||
tooltip: localization.history,
|
tooltip: state.prefState.enableTooltips
|
||||||
|
? localization.history
|
||||||
|
: null,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (isMobile(context) ||
|
if (isMobile(context) ||
|
||||||
state.prefState.isHistoryFloated) {
|
state.prefState.isHistoryFloated) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue