From c0cd88f0642e1fca083660a9e1084142176745c1 Mon Sep 17 00:00:00 2001 From: Oscar Alvarez Date: Wed, 30 Dec 2020 14:07:15 -0500 Subject: [PATCH] Minor fixes --- app/commons/custom_button.py | 18 ++++++++++------- app/css/base.css | 2 +- app/css/flat_button_large.css | 26 ++++++++++++++++++++++-- app/css/flat_button_small.css | 37 ++++++++++++++++++++++------------- app/dialogs.py | 18 ++++++++--------- app/store.py | 2 ++ 6 files changed, 70 insertions(+), 33 deletions(-) diff --git a/app/commons/custom_button.py b/app/commons/custom_button.py index 5f69cef..3485867 100644 --- a/app/commons/custom_button.py +++ b/app/commons/custom_button.py @@ -83,23 +83,27 @@ class CustomButton(QPushButton): label_title.setObjectName('label_title') rows.append(label_title) + label_custom_button = None if desc_extractor: desc = record.get(desc_extractor) if not desc: desc = record.get('rec_name') if len(desc) > 29: desc = desc[0:29] - label_custom_button = QLabel(desc, self) - label_custom_button.setAlignment(Qt.AlignCenter | Qt.AlignCenter) - label_custom_button.setObjectName('label_custom_button') - rows.append(label_custom_button) + if len(rows) > 0: + label_custom_button = QLabel(desc, self) + label_custom_button.setAlignment(Qt.AlignCenter | Qt.AlignCenter) + label_custom_button.setObjectName('label_custom_button') + rows.append(label_custom_button) + else: + self.setText(desc) - if len(rows) == 1: - pass - elif len(rows) > 1: + if len(rows) > 1: vbox = QVBoxLayout() for w in rows: vbox.addWidget(w, 1) + # if label_custom_button: + # label_custom_button.move(vbox.rect().center()) self.setLayout(vbox) method = getattr(parent, method) diff --git a/app/css/base.css b/app/css/base.css index fcc5a0e..1f8fe66 100644 --- a/app/css/base.css +++ b/app/css/base.css @@ -80,7 +80,7 @@ QAbstractButton:pressed { max-height: 50px; } -#field_invoice_type { +#field_invoice_type, #field_kind { color : #424242; min-height: 25px; font : 16pt; diff --git a/app/css/flat_button_large.css b/app/css/flat_button_large.css index 70a4c54..d55b371 100644 --- a/app/css/flat_button_large.css +++ b/app/css/flat_button_large.css @@ -1,3 +1,22 @@ +#standard_button { + border-style: groove; + font: 12pt; + color: rgb(80, 80, 80); + background-color: white; + height: 80px; + font-weight: bold; + border-width: 0px; + border-radius: 5px; + text-align: center; +} + +#standard_button::hover { + background-color: rgb(227, 255, 159); +} + +#standard_button::pressed { + background-color: rgb(195, 228, 113); +} #product_button { font-family: "DejaVu Sans"; @@ -37,7 +56,9 @@ padding-right: auto; margin-left: auto; margin-right: auto; - color: rgb(70, 70, 70); + background-color: rgb(70, 70, 70); + /* color: rgb(70, 70, 70); */ + color: rgb(193, 41, 41); text-align: center; width: 100%; } @@ -51,7 +72,8 @@ font-family: "DejaVu Sans"; border-style: groove; font: 10pt; - color: rgb(102, 102, 102); + color: rgb(80, 80, 80); + font-weight: bold; background-color: white; min-height: 130px; max-height: 160px; diff --git a/app/css/flat_button_small.css b/app/css/flat_button_small.css index 79b86d4..d605bc8 100644 --- a/app/css/flat_button_small.css +++ b/app/css/flat_button_small.css @@ -1,16 +1,23 @@ - #standard_button { border-style: groove; - font: 7pt; + font: 10pt; color: rgb(80, 80, 80); background-color: white; - max-height: 60px; - max-width : 140px; + height: 60px; + font-weight: bold; border-width: 0px; border-radius: 5px; text-align: center; } +#standard_button::hover { + background-color: rgb(227, 255, 159); +} + +#standard_button::pressed { + background-color: rgb(195, 228, 113); +} + #product_button { border-style: groove; font: 6pt; @@ -59,16 +66,18 @@ } #category_button { - font-family: "DejaVu Sans"; - border-style: groove; - font: 8pt; - color: rgb(102, 102, 102); - background-color : white; - min-height: 90px; - max-height: 120px; - border-width: 0px; - border-radius: 5px; - text-align: center; + font-family: "DejaVu Sans"; + border-style: groove; + font: 9pt; + color: rgb(80, 80, 80); + font-weight: bold; + background-color: white; + min-height: 130px; + max-height: 160px; + width : 130px; + border-width: 0px; + border-radius: 10px; + text-align: center; } #category_button::hover { diff --git a/app/dialogs.py b/app/dialogs.py index f4f4874..ae4b156 100644 --- a/app/dialogs.py +++ b/app/dialogs.py @@ -553,15 +553,7 @@ class DialogPrintInvoice(QWidget): def get(self): view = [ - ('invoice_number_ask', {'name': self.tr('INVOICE NUMBER')}), - ('printer_ask', { - 'name': self.tr('PRINTER'), - 'type': 'selection', - 'values': [ - (1, 'POS'), - (2, 'LASER') - ], - }), + ('invoice_number_ask', {'name': self.tr('ORDER / INVOICE NUMBER')}), ('type_ask', { 'name': self.tr('TYPE'), 'type': 'selection', @@ -571,6 +563,14 @@ class DialogPrintInvoice(QWidget): ('delivery', self.tr('DELIVERY')) ], }), + ('printer_ask', { + 'name': self.tr('PRINTER'), + 'type': 'selection', + 'values': [ + (1, 'POS'), + (2, 'LASER') + ], + }), ] return QuickDialog(self._parent, 'action', data=view) diff --git a/app/store.py b/app/store.py index 00a9e4d..2594fb1 100644 --- a/app/store.py +++ b/app/store.py @@ -26,6 +26,8 @@ class StoreView(object): field.setText('') field_ask = getattr(self.parent, 'field_' + k + '_ask', None) + if field_ask == 'invoice_number_ask': + continue if field_ask and hasattr(field_ask, 'setText'): field_ask.setText('')