diff --git a/lib/l10n b/lib/l10n index 045288ea..cf76a2a7 160000 --- a/lib/l10n +++ b/lib/l10n @@ -1 +1 @@ -Subproject commit 045288ea2a1d6b2248de084fdbacafc2256e1313 +Subproject commit cf76a2a70e96e49991a63bbde6d45911caaaf05f diff --git a/lib/widget/home.dart b/lib/widget/home.dart index cf0ea78a..d3abca7a 100644 --- a/lib/widget/home.dart +++ b/lib/widget/home.dart @@ -41,7 +41,7 @@ class _InvenTreeHomePageState extends State { BuildContext _context; - void _search() { + void _searchParts() { if (!InvenTreeAPI().checkConnection(context)) return; showSearch( @@ -50,6 +50,15 @@ class _InvenTreeHomePageState extends State { ); } + void _searchStock() { + if (!InvenTreeAPI().checkConnection(context)) return; + + showSearch( + context: context, + delegate: StockSearchDelegate() + ); + } + void _scan(BuildContext context) { if (!InvenTreeAPI().checkConnection(context)) return; @@ -207,11 +216,13 @@ class _InvenTreeHomePageState extends State { appBar: AppBar( title: Text(I18N.of(context).appTitle), actions: [ + /* IconButton( icon: FaIcon(FontAwesomeIcons.search), tooltip: I18N.of(context).search, - onPressed: _search, + onPressed: _searchParts, ), + */ ], ), drawer: new InvenTreeDrawer(context), @@ -225,17 +236,6 @@ class _InvenTreeHomePageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Column( - children: [ - - IconButton( - icon: new FaIcon(FontAwesomeIcons.search), - tooltip: I18N.of(context).search, - onPressed: _search, - ), - Text(I18N.of(context).search), - ], - ), Column( children: [ IconButton( @@ -262,6 +262,19 @@ class _InvenTreeHomePageState extends State { Text(I18N.of(context).parts), ], ), + Column( + children: [ + + IconButton( + icon: new FaIcon(FontAwesomeIcons.search), + tooltip: I18N.of(context).searchParts, + onPressed: _searchParts, + ), + Text(I18N.of(context).searchParts), + ], + ), + // TODO - Re-add starred parts link + /* Column( children: [ IconButton( @@ -273,6 +286,13 @@ class _InvenTreeHomePageState extends State { Text("Starred Parts"), ] ), + */ + ], + ), + Spacer(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ Column( children: [ IconButton( @@ -283,7 +303,17 @@ class _InvenTreeHomePageState extends State { Text(I18N.of(context).stock), ], ), - ], + Column( + children: [ + IconButton( + icon: new FaIcon(FontAwesomeIcons.search), + tooltip: I18N.of(context).searchStock, + onPressed: _searchStock, + ), + Text(I18N.of(context).searchStock), + ], + ), + ] ), Spacer(), // TODO - Re-add these when the features actually do something.. diff --git a/lib/widget/search.dart b/lib/widget/search.dart index 1f194c1a..a354c8cf 100644 --- a/lib/widget/search.dart +++ b/lib/widget/search.dart @@ -267,7 +267,7 @@ class StockSearchDelegate extends SearchDelegate { return ListTile( title: Text(item.partName), - subtitle: Text(item.partDescription), + subtitle: Text(item.locationName), leading: InvenTreeAPI().getImage( item.partThumbnail, width: 40,