From 8a114d345f4681305b888beaa33a9b1305c22fe4 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 26 Jul 2021 23:18:52 +1000 Subject: [PATCH] Display "action" items with color --- assets/release_notes.md | 6 +++++- lib/app_colors.dart | 2 ++ lib/widget/category_display.dart | 6 +++++- lib/widget/location_display.dart | 5 +++-- lib/widget/part_detail.dart | 11 +++++------ lib/widget/stock_detail.dart | 32 ++++++++++++++++++-------------- 6 files changed, 38 insertions(+), 24 deletions(-) diff --git a/assets/release_notes.md b/assets/release_notes.md index c1a31d5d..a8a0f6b6 100644 --- a/assets/release_notes.md +++ b/assets/release_notes.md @@ -4,7 +4,11 @@ ### 0.3.0 - July 2021 --- - +- Adds new "API driven" forms +- Improvements for Part editing form +- Improvements for PartCategory editing form +- Improvements for StockLocation editing form +- Adds ability to edit StockItem - Updated translations ### 0.2.10 - July 2021 diff --git a/lib/app_colors.dart b/lib/app_colors.dart index 73db5f30..a4797c6a 100644 --- a/lib/app_colors.dart +++ b/lib/app_colors.dart @@ -5,6 +5,8 @@ import 'dart:ui'; const Color COLOR_GRAY = Color.fromRGBO(50, 50, 50, 1); const Color COLOR_GRAY_LIGHT = Color.fromRGBO(150, 150, 150, 1); +const Color COLOR_CLICK = Color.fromRGBO(175, 150, 100, 0.9); + const Color COLOR_BLUE = Color.fromRGBO(0, 0, 250, 1); const Color COLOR_STAR = Color.fromRGBO(250, 250, 100, 1); diff --git a/lib/widget/category_display.dart b/lib/widget/category_display.dart index 4388cdd0..87433f13 100644 --- a/lib/widget/category_display.dart +++ b/lib/widget/category_display.dart @@ -1,5 +1,6 @@ import 'package:inventree/api.dart'; +import 'package:inventree/app_colors.dart'; import 'package:inventree/app_settings.dart'; import 'package:inventree/inventree/part.dart'; import 'package:inventree/inventree/sentry.dart'; @@ -166,7 +167,10 @@ class _CategoryDisplayState extends RefreshableState { ListTile( title: Text(L10().parentCategory), subtitle: Text("${category?.parentpathstring}"), - leading: FaIcon(FontAwesomeIcons.levelUpAlt), + leading: FaIcon( + FontAwesomeIcons.levelUpAlt, + color: COLOR_CLICK, + ), onTap: () { if (category == null || ((category?.parentId ?? 0) < 0)) { Navigator.push(context, MaterialPageRoute(builder: (context) => CategoryDisplayWidget(null))); diff --git a/lib/widget/location_display.dart b/lib/widget/location_display.dart index b1ffffef..93bacd2e 100644 --- a/lib/widget/location_display.dart +++ b/lib/widget/location_display.dart @@ -1,5 +1,6 @@ import 'package:inventree/api.dart'; import 'package:inventree/api_form.dart'; +import 'package:inventree/app_colors.dart'; import 'package:inventree/app_settings.dart'; import 'package:inventree/barcode.dart'; import 'package:inventree/inventree/sentry.dart'; @@ -176,7 +177,7 @@ class _LocationDisplayState extends RefreshableState { ListTile( title: Text(L10().parentCategory), subtitle: Text("${location!.parentpathstring}"), - leading: FaIcon(FontAwesomeIcons.levelUpAlt), + leading: FaIcon(FontAwesomeIcons.levelUpAlt, color: COLOR_CLICK), onTap: () { int parent = location?.parentId ?? -1; @@ -302,7 +303,7 @@ List detailTiles() { tiles.add( ListTile( title: Text(L10().barcodeScanInItems), - leading: FaIcon(FontAwesomeIcons.exchangeAlt), + leading: FaIcon(FontAwesomeIcons.exchangeAlt, color: COLOR_CLICK), trailing: FaIcon(FontAwesomeIcons.qrcode), onTap: () { diff --git a/lib/widget/part_detail.dart b/lib/widget/part_detail.dart index 032cdb2e..9fb5037a 100644 --- a/lib/widget/part_detail.dart +++ b/lib/widget/part_detail.dart @@ -275,7 +275,7 @@ class _PartDisplayState extends RefreshableState { ListTile( title: Text(L10().partCategory), subtitle: Text("${part.categoryName}"), - leading: FaIcon(FontAwesomeIcons.sitemap), + leading: FaIcon(FontAwesomeIcons.sitemap, color: COLOR_CLICK), onTap: () { if (part.categoryId > 0) { InvenTreePartCategory().get(part.categoryId).then((var cat) { @@ -294,7 +294,7 @@ class _PartDisplayState extends RefreshableState { ListTile( title: Text(L10().partCategory), subtitle: Text(L10().partCategoryTopLevel), - leading: FaIcon(FontAwesomeIcons.sitemap), + leading: FaIcon(FontAwesomeIcons.sitemap, color: COLOR_CLICK), onTap: () { Navigator.push(context, MaterialPageRoute(builder: (context) => CategoryDisplayWidget(null))); }, @@ -306,7 +306,7 @@ class _PartDisplayState extends RefreshableState { tiles.add( ListTile( title: Text(L10().stock), - leading: FaIcon(FontAwesomeIcons.boxes), + leading: FaIcon(FontAwesomeIcons.boxes, color: COLOR_CLICK), trailing: Text("${part.inStockString}"), onTap: () { setState(() { @@ -392,8 +392,7 @@ class _PartDisplayState extends RefreshableState { tiles.add( ListTile( title: Text("${part.link}"), - leading: FaIcon(FontAwesomeIcons.link), - trailing: FaIcon(FontAwesomeIcons.externalLinkAlt), + leading: FaIcon(FontAwesomeIcons.link, color: COLOR_CLICK), onTap: () { part.openLink(); }, @@ -417,7 +416,7 @@ class _PartDisplayState extends RefreshableState { tiles.add( ListTile( title: Text(L10().notes), - leading: FaIcon(FontAwesomeIcons.stickyNote), + leading: FaIcon(FontAwesomeIcons.stickyNote, color: COLOR_CLICK), trailing: Text(""), onTap: () { Navigator.push( diff --git a/lib/widget/stock_detail.dart b/lib/widget/stock_detail.dart index d04bfb3f..9d1e0ac0 100644 --- a/lib/widget/stock_detail.dart +++ b/lib/widget/stock_detail.dart @@ -1,3 +1,4 @@ +import 'package:inventree/app_colors.dart'; import 'package:inventree/barcode.dart'; import 'package:inventree/inventree/model.dart'; import 'package:inventree/inventree/stock.dart'; @@ -434,7 +435,10 @@ class _StockItemDisplayState extends RefreshableState { ListTile( title: Text(L10().stockLocation), subtitle: Text("${item.locationPathString}"), - leading: FaIcon(FontAwesomeIcons.mapMarkerAlt), + leading: FaIcon( + FontAwesomeIcons.mapMarkerAlt, + color: COLOR_CLICK, + ), onTap: () { if (item.locationId > 0) { InvenTreeStockLocation().get(item.locationId).then((var loc) { @@ -503,9 +507,10 @@ class _StockItemDisplayState extends RefreshableState { tiles.add( ListTile( title: Text("${item.link}"), - leading: FaIcon(FontAwesomeIcons.link), - trailing: Text(""), - onTap: null, + leading: FaIcon(FontAwesomeIcons.link, color: COLOR_CLICK), + onTap: () { + item.openLink(); + }, ) ); } @@ -514,7 +519,7 @@ class _StockItemDisplayState extends RefreshableState { tiles.add( ListTile( title: Text(L10().testResults), - leading: FaIcon(FontAwesomeIcons.tasks), + leading: FaIcon(FontAwesomeIcons.tasks, color: COLOR_CLICK), trailing: Text("${item.testResultCount}"), onTap: () { Navigator.push( @@ -550,8 +555,7 @@ class _StockItemDisplayState extends RefreshableState { tiles.add( ListTile( title: Text(L10().notes), - leading: FaIcon(FontAwesomeIcons.stickyNote), - trailing: Text(""), + leading: FaIcon(FontAwesomeIcons.stickyNote, color: COLOR_CLICK), onTap: () { Navigator.push( context, @@ -594,7 +598,7 @@ class _StockItemDisplayState extends RefreshableState { tiles.add( ListTile( title: Text(L10().countStock), - leading: FaIcon(FontAwesomeIcons.checkCircle), + leading: FaIcon(FontAwesomeIcons.checkCircle, color: COLOR_CLICK), onTap: _countStockDialog, trailing: Text(item.quantityString), ) @@ -603,7 +607,7 @@ class _StockItemDisplayState extends RefreshableState { tiles.add( ListTile( title: Text(L10().removeStock), - leading: FaIcon(FontAwesomeIcons.minusCircle), + leading: FaIcon(FontAwesomeIcons.minusCircle, color: COLOR_CLICK), onTap: _removeStockDialog, ) ); @@ -611,7 +615,7 @@ class _StockItemDisplayState extends RefreshableState { tiles.add( ListTile( title: Text(L10().addStock), - leading: FaIcon(FontAwesomeIcons.plusCircle), + leading: FaIcon(FontAwesomeIcons.plusCircle, color: COLOR_CLICK), onTap: _addStockDialog, ) ); @@ -620,7 +624,7 @@ class _StockItemDisplayState extends RefreshableState { tiles.add( ListTile( title: Text(L10().transferStock), - leading: FaIcon(FontAwesomeIcons.exchangeAlt), + leading: FaIcon(FontAwesomeIcons.exchangeAlt, color: COLOR_CLICK), onTap: () { _transferStockDialog(context); }, ) ); @@ -629,7 +633,7 @@ class _StockItemDisplayState extends RefreshableState { tiles.add( ListTile( title: Text(L10().scanIntoLocation), - leading: FaIcon(FontAwesomeIcons.exchangeAlt), + leading: FaIcon(FontAwesomeIcons.exchangeAlt, color: COLOR_CLICK), trailing: FaIcon(FontAwesomeIcons.qrcode), onTap: () { Navigator.push( @@ -647,7 +651,7 @@ class _StockItemDisplayState extends RefreshableState { tiles.add( ListTile( title: Text(L10().barcodeAssign), - leading: FaIcon(FontAwesomeIcons.barcode), + leading: FaIcon(FontAwesomeIcons.barcode, color: COLOR_CLICK), trailing: FaIcon(FontAwesomeIcons.qrcode), onTap: () { Navigator.push( @@ -663,7 +667,7 @@ class _StockItemDisplayState extends RefreshableState { tiles.add( ListTile( title: Text(L10().barcodeUnassign), - leading: FaIcon(FontAwesomeIcons.barcode), + leading: FaIcon(FontAwesomeIcons.barcode, color: COLOR_CLICK), onTap: () { _unassignBarcode(context); }