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 b1f9014f15f13ac80771ba9917ebf2686ef30e13..914655d5f2e22b25606e5dad769056aedd2b2287 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;")