From c13e7b0f873e4857f1ce7924c0a72609df3ddca2 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 24 Jul 2020 01:08:02 +0530 Subject: platform independent library and image paths, flake8 compliant --- src/frontEnd/ProjectExplorer.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/frontEnd/ProjectExplorer.py') diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index f0227164..d327427c 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -33,23 +33,27 @@ class ProjectExplorer(QtGui.QWidget): self.treewidget.setColumnHidden(1, True) # CSS + init_path = '../../' + if os.name == 'nt': + init_path = '' + self.treewidget.setStyleSheet(" \ QTreeView { border-radius: 15px; border: 1px \ solid gray; padding: 5px; width: 200px; height: 150px; }\ QTreeView::branch:has-siblings:!adjoins-item { \ - border-image: url(images/vline.png) 0;} \ + border-image: url(" + init_path + "images/vline.png) 0;} \ QTreeView::branch:has-siblings:adjoins-item { \ - border-image: url(images/branch-more.png) 0; } \ + border-image: url(" + init_path + "images/branch-more.png) 0; } \ QTreeView::branch:!has-children:!has-siblings:adjoins-item { \ - border-image: url(images/branch-end.png) 0; } \ + border-image: url(" + init_path + "images/branch-end.png) 0; } \ QTreeView::branch:has-children:!has-siblings:closed, \ QTreeView::branch:closed:has-children:has-siblings { \ border-image: none; \ - image: url(images/branch-closed.png); } \ + image: url(" + init_path + "images/branch-closed.png); } \ QTreeView::branch:open:has-children:!has-siblings, \ QTreeView::branch:open:has-children:has-siblings { \ border-image: none; \ - image: url(images/branch-open.png); } \ + image: url(" + init_path + "images/branch-open.png); } \ ") for parents, children in list( -- cgit