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