Skip to content
Snippets Groups Projects
Commit 76511ea7 authored by Lan Dam's avatar Lan Dam
Browse files

move edit icon images to images/

parent 878c1273
No related branches found
No related tags found
1 merge request!213Implement widget to display valueColors
Pipeline #3225 passed with stage
in 4 minutes and 23 seconds
......@@ -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;")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment