From 76511ea79754375b499e5da2ba2827a6cc16edb2 Mon Sep 17 00:00:00 2001 From: ldam <ldam@passcal.nmt.edu> Date: Thu, 2 Nov 2023 16:15:47 -0600 Subject: [PATCH] move edit icon images to images/ --- .../edit_icon_black_background.png | Bin .../edit_icon_white_background.png | Bin .../value_color_helper/value_color_widget.py | 14 +++++++++----- 3 files changed, 9 insertions(+), 5 deletions(-) rename sohstationviewer/{view/db_config/value_color_helper => images}/edit_icon_black_background.png (100%) rename sohstationviewer/{view/db_config/value_color_helper => images}/edit_icon_white_background.png (100%) diff --git a/sohstationviewer/view/db_config/value_color_helper/edit_icon_black_background.png b/sohstationviewer/images/edit_icon_black_background.png similarity index 100% rename from sohstationviewer/view/db_config/value_color_helper/edit_icon_black_background.png rename to sohstationviewer/images/edit_icon_black_background.png diff --git a/sohstationviewer/view/db_config/value_color_helper/edit_icon_white_background.png b/sohstationviewer/images/edit_icon_white_background.png similarity index 100% rename from sohstationviewer/view/db_config/value_color_helper/edit_icon_white_background.png rename to sohstationviewer/images/edit_icon_white_background.png diff --git a/sohstationviewer/view/db_config/value_color_helper/value_color_widget.py b/sohstationviewer/view/db_config/value_color_helper/value_color_widget.py index b1f9014f1..914655d5f 100644 --- a/sohstationviewer/view/db_config/value_color_helper/value_color_widget.py +++ b/sohstationviewer/view/db_config/value_color_helper/value_color_widget.py @@ -13,7 +13,12 @@ from sohstationviewer.view.db_config.value_color_helper.functions import \ class ValueColorWidget(QTextEdit): - def __init__(self, parent, background): + def __init__(self, parent: Optional[QWidget], background: str): + """ + Widget to display valueColors and call a dialog to edit tha value + :param parent: the parent widget + :param background: 'B'/'W': flag indicating background color + """ QtWidgets.QTextEdit.__init__(self, parent) self.set_background(background) # string for value color to be saved in DB @@ -36,12 +41,11 @@ class ValueColorWidget(QTextEdit): self.edit_button = QtWidgets.QToolButton(self) self.edit_button.setCursor(Qt.PointingHandCursor) current_file_path = os.path.abspath(__file__) - icon_path = Path(current_file_path).parent - + root_path = Path(current_file_path).parent.parent.parent.parent if background == 'B': - img_file = f"{icon_path}/edit_icon_black_background.png" + img_file = f"{root_path}/images/edit_icon_black_background.png" else: - img_file = f"{icon_path}/edit_icon_white_background.png" + img_file = f"{root_path}/images/edit_icon_white_background.png" self.edit_button.setIcon(QtGui.QIcon(img_file)) self.edit_button.setStyleSheet( "background: transparent; border: none;") -- GitLab