From a0962c9c97194c550663d16a23b67d936edaee96 Mon Sep 17 00:00:00 2001 From: Aliaksei Pilko Date: Mon, 1 Mar 2021 17:47:21 +0000 Subject: [PATCH] Various UI improvements --- seedpod_ground_risk/layers/geojson_layer.py | 2 +- seedpod_ground_risk/ui_resources/layerListDelegate.ui | 2 +- seedpod_ground_risk/ui_resources/layerlistdelegate.py | 5 +++-- seedpod_ground_risk/ui_resources/main.ui | 11 ++++++++--- seedpod_ground_risk/ui_resources/mainwindow.py | 9 +++++---- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/seedpod_ground_risk/layers/geojson_layer.py b/seedpod_ground_risk/layers/geojson_layer.py index 591807c..0113dee 100644 --- a/seedpod_ground_risk/layers/geojson_layer.py +++ b/seedpod_ground_risk/layers/geojson_layer.py @@ -64,7 +64,7 @@ def annotate(self, data: List[gpd.GeoDataFrame], raster_data: Tuple[Dict[str, np gv.Contours(self.dataframe).opts(line_width=4, line_color='magenta'), gv.Polygons(self.buffer_poly).opts(style={'alpha': 0.3, 'color': 'cyan'}), # Add the path stats as a text annotation to the final path point - gv.Text(self.endpoint[0], self.endpoint[1], label_str), + gv.Text(self.endpoint[0], self.endpoint[1], label_str, fontsize=20).opts(style={'color': 'blue'}), *annotation_layers ]) else: diff --git a/seedpod_ground_risk/ui_resources/layerListDelegate.ui b/seedpod_ground_risk/ui_resources/layerListDelegate.ui index 068ec94..bf1afdf 100644 --- a/seedpod_ground_risk/ui_resources/layerListDelegate.ui +++ b/seedpod_ground_risk/ui_resources/layerListDelegate.ui @@ -90,7 +90,7 @@ - data tag + diff --git a/seedpod_ground_risk/ui_resources/layerlistdelegate.py b/seedpod_ground_risk/ui_resources/layerlistdelegate.py index 65bd986..b74783c 100644 --- a/seedpod_ground_risk/ui_resources/layerlistdelegate.py +++ b/seedpod_ground_risk/ui_resources/layerlistdelegate.py @@ -58,6 +58,7 @@ def setupUi(self, delegate): self.verticalLayout.addWidget(self.dataTagLabel) + self.horizontalLayout.addLayout(self.verticalLayout) self.horizontalSpacer = QSpacerItem(178, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) @@ -80,12 +81,12 @@ def setupUi(self, delegate): self.retranslateUi(delegate) QMetaObject.connectSlotsByName(delegate) - # setupUi def retranslateUi(self, delegate): delegate.setWindowTitle(QCoreApplication.translate("delegate", u"Form", None)) self.nameLabel.setText(QCoreApplication.translate("delegate", u"Key", None)) - self.dataTagLabel.setText(QCoreApplication.translate("delegate", u"data tag", None)) + self.dataTagLabel.setText("") self.pushButton.setText("") # retranslateUi + diff --git a/seedpod_ground_risk/ui_resources/main.ui b/seedpod_ground_risk/ui_resources/main.ui index 3987f45..d3344b5 100644 --- a/seedpod_ground_risk/ui_resources/main.ui +++ b/seedpod_ground_risk/ui_resources/main.ui @@ -84,13 +84,19 @@ 405 - 500 + 490 + + 5 + + + 5 + @@ -138,7 +144,6 @@ - @@ -151,7 +156,7 @@ - Export + Export .png diff --git a/seedpod_ground_risk/ui_resources/mainwindow.py b/seedpod_ground_risk/ui_resources/mainwindow.py index ba81f4f..8c09849 100644 --- a/seedpod_ground_risk/ui_resources/mainwindow.py +++ b/seedpod_ground_risk/ui_resources/mainwindow.py @@ -63,17 +63,19 @@ def setupUi(self, MainWindow): self.listWidget.setEnabled(False) sizePolicy.setHeightForWidth(self.listWidget.sizePolicy().hasHeightForWidth()) self.listWidget.setSizePolicy(sizePolicy) - self.listWidget.setMinimumSize(QSize(405, 500)) + self.listWidget.setMinimumSize(QSize(405, 490)) self.verticalLayout.addWidget(self.listWidget) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") + self.horizontalLayout.setContentsMargins(-1, 5, -1, 5) self.addLayerButton = QPushButton(self.verticalLayoutWidget) self.addLayerButton.setObjectName(u"addLayerButton") self.horizontalLayout.addWidget(self.addLayerButton) + self.verticalLayout.addLayout(self.horizontalLayout) self.splitter.addWidget(self.verticalLayoutWidget) @@ -96,7 +98,6 @@ def setupUi(self, MainWindow): self.toolBar.addAction(self.actionAbout_App) self.toolBar.addAction(self.actionAbout_Static_Sources) self.toolBar.addSeparator() - self.toolBar.addAction(self.actionImport) self.toolBar.addAction(self.actionExport) self.toolBar.addSeparator() self.toolBar.addAction(self.actionGenerate) @@ -110,14 +111,14 @@ def setupUi(self, MainWindow): def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"SEEDPOD Ground Risk", None)) self.actionImport.setText(QCoreApplication.translate("MainWindow", u"Import", None)) - self.actionExport.setText(QCoreApplication.translate("MainWindow", u"Export", None)) + self.actionExport.setText(QCoreApplication.translate("MainWindow", u"Export .png", None)) self.actionAbout_Static_Sources.setText(QCoreApplication.translate("MainWindow", u"About Static Data", None)) self.actionAbout_App.setText(QCoreApplication.translate("MainWindow", u"About App", None)) self.actionRasterise.setText(QCoreApplication.translate("MainWindow", u"Rasterise", None)) self.actionGenerate.setText(QCoreApplication.translate("MainWindow", u"Generate", None)) # if QT_CONFIG(tooltip) self.actionGenerate.setToolTip(QCoreApplication.translate("MainWindow", u"Generate Map for current view", None)) - # endif // QT_CONFIG(tooltip) + #endif // QT_CONFIG(tooltip) self.addLayerButton.setText(QCoreApplication.translate("MainWindow", u"Add Layer", None)) self.toolBar.setWindowTitle(QCoreApplication.translate("MainWindow", u"toolBar", None)) # retranslateUi