Skip to content

Commit

Permalink
Merge pull request #656 from kartoza/timlinux/issue650
Browse files Browse the repository at this point in the history
Fix background colour for dark themes
  • Loading branch information
timlinux authored Dec 2, 2024
2 parents 96b44dc + f7ae2b7 commit 4b5223f
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 100 deletions.
1 change: 1 addition & 0 deletions geest/core/workflows/analysis_aggregation_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ def __init__(
.replace(" ", "_")
.replace("'", "")
) # should not be needed any more
self.layer_id = "wee"
self.weight_key = "dimension_weighting"
self.workflow_name = "analysis_aggregation"
13 changes: 9 additions & 4 deletions geest/gui/geest_dock.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
CreateProjectPanel,
)
from geest.core import set_setting, setting
from geest.utilities import resources_path, log_message
from geest.utilities import resources_path, log_message, is_qgis_dark_theme_active

INTRO_PANEL = 0
CREDITS_PANEL = 1
Expand Down Expand Up @@ -56,9 +56,14 @@ def __init__(
layout.setSpacing(0) # Remove spacing between elements

# Load the background image
self.background_image = QPixmap(
resources_path("resources", "images", "background.png")
)
if is_qgis_dark_theme_active():
self.background_image = QPixmap(
resources_path("resources", "images", "background-dark.png")
)
else:
self.background_image = QPixmap(
resources_path("resources", "images", "background.png")
)

# Create a stacked widget
self.stacked_widget: QStackedWidget = QStackedWidget()
Expand Down
1 change: 1 addition & 0 deletions geest/gui/panels/create_project_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def create_project(self):
feedback=feedback,
)
# Hook up the QTask feedback signal to the progress bar
self.progress_updated(0)
processor.progressChanged.connect(self.progress_updated)
processor.taskCompleted.connect(self.on_task_completed)

Expand Down
5 changes: 3 additions & 2 deletions geest/gui/panels/tree_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,9 @@ def working_directory_changed(self, new_directory):
analysis_data["working_folder"] = self.working_directory
# Use the last dir in the working directory path as the analysis name
if analysis_data.get("analysis_name", "Not Set"):
analysis_data["analysis_name"] = os.path.basename(
self.working_directory
analysis_name = os.path.basename(self.working_directory)
analysis_data["analysis_name"] = (
f"Women's Economic Empowerment - {analysis_name}"
)
analysis_item.setData(0, analysis_data.get("analysis_name", "Analysis"))
settings = QSettings()
Expand Down
Binary file added geest/resources/images/background-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
199 changes: 106 additions & 93 deletions geest/ui/create_project_panel_base.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,15 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="banner_label">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>../resources/geest-banner.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:16pt; font-weight:600;&quot;&gt;GEEST Project Creation&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0" colspan="3">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<item row="3" column="0" colspan="3">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
Expand All @@ -68,15 +39,25 @@
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="label_6">
<item row="8" column="0" colspan="3">
<widget class="QgsFieldComboBox" name="field_combo">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
</widget>
</item>
<item row="10" column="0" colspan="3">
<widget class="QLabel" name="label">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Now select a layer containing the &lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Admin0&lt;/span&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; boundary for your study area and the column in your dataset with the name of our area.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Set the analysis cell size (m). Smaller sizes will require longer processing times, but produce more detailed analysis results. Typically a value between &lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;100m&lt;/span&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; and &lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;1000m&lt;/span&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; would be used here.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
Expand All @@ -86,16 +67,7 @@
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QgsMapLayerComboBox" name="layer_combo">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
</widget>
</item>
<item row="7" column="1">
<item row="7" column="2">
<widget class="QToolButton" name="load_boundary_button">
<property name="font">
<font>
Expand All @@ -107,46 +79,20 @@
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QCheckBox" name="use_boundary_crs">
<property name="text">
<string>Use Coordinate Reference System of your boundary layer</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="enabled">
<bool>true</bool>
</property>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="banner_label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Set the analysis cell size (m). Smaller sizes will require longer processing times, but produce more detailed analysis results. Typically a value between &lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;100m&lt;/span&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; and &lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;1000m&lt;/span&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; would be used here.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
<property name="pixmap">
<pixmap>../resources/geest-banner.png</pixmap>
</property>
<property name="wordWrap">
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="12" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="11" column="0" colspan="2">
<item row="11" column="0" colspan="3">
<widget class="QSpinBox" name="cell_size_spinbox">
<property name="enabled">
<bool>true</bool>
Expand All @@ -170,16 +116,25 @@
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<widget class="QgsFieldComboBox" name="field_combo">
<item row="6" column="0" colspan="3">
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Now select a layer containing the &lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Admin0&lt;/span&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; boundary for your study area and the column in your dataset with the name of our area.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item row="4" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="folder_status_label">
Expand Down Expand Up @@ -211,9 +166,41 @@
</item>
</layout>
</item>
<item row="13" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<item row="7" column="0" colspan="2">
<widget class="QgsMapLayerComboBox" name="layer_combo">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
</widget>
</item>
<item row="9" column="0" colspan="3">
<widget class="QCheckBox" name="use_boundary_crs">
<property name="text">
<string>Use Coordinate Reference System of your boundary layer</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:16pt; font-weight:600;&quot;&gt;GEEST Project Creation&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="14" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" rowspan="2">
<widget class="QPushButton" name="previous_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
Expand All @@ -237,14 +224,7 @@
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progress_bar">
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item>
<item row="0" column="2" rowspan="2">
<widget class="QPushButton" name="next_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
Expand All @@ -268,9 +248,42 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QProgressBar" name="progress_bar">
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>88</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="5" column="0" colspan="2">
<item row="12" column="0" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0" colspan="3">
<widget class="QLabel" name="project_path_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
Expand Down
13 changes: 13 additions & 0 deletions geest/ui/ors_panel_base.ui
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,19 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="next_button">
<property name="sizePolicy">
Expand Down
Loading

0 comments on commit 4b5223f

Please sign in to comment.