Skip to content

Commit e896b9a

Browse files
author
Dimitar Tasev
committed
Move welcome screen bg image to gui/ui/images so that it gets packaged
Set stylesheet in code with full path to image
1 parent 9da7e0e commit e896b9a

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

mantidimaging/gui/ui/welcome_screen_dialog.ui

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,13 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>600</width>
10-
<height>400</height>
9+
<width>510</width>
10+
<height>340</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>About Mantid Imaging</string>
1515
</property>
16-
<property name="styleSheet">
17-
<string notr="true">#WelcomeScreenDialog {
18-
border-image:url(images/welcome_screen_background.png);
19-
min-width:30em; min-height:20em;
20-
max-width:30em; max-height:20em;
21-
}</string>
22-
</property>
2316
<layout class="QVBoxLayout" name="verticalLayout">
2417
<item>
2518
<widget class="QLabel" name="version_label">

mantidimaging/gui/windows/welcome_screen/view.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (C) 2020 ISIS Rutherford Appleton Laboratory UKRI
22
# SPDX - License - Identifier: GPL-3.0-or-later
33

4+
from mantidimaging.core.utility import finder
5+
import os
46
from PyQt5.QtWidgets import QLabel
57

68
from mantidimaging.gui.mvp_base import BaseDialogView
@@ -9,6 +11,12 @@
911
class WelcomeScreenView(BaseDialogView):
1012
def __init__(self, parent, presenter):
1113
super(WelcomeScreenView, self).__init__(parent, "gui/ui/welcome_screen_dialog.ui")
14+
base_path = os.path.join(finder.get_external_location(__file__), finder.ROOT_PACKAGE)
15+
16+
bg_image = os.path.join(base_path, "gui/ui/images/welcome_screen_background.png")
17+
self.setStyleSheet("#WelcomeScreenDialog {"
18+
f"border-image:url({bg_image});"
19+
"min-width:30em; min-height:20em;max-width:30em; max-height:20em;}")
1220
self.presenter = presenter
1321

1422
self.issue_box.setVisible(False)

0 commit comments

Comments
 (0)