From 83b514db612cfd20dde83460b926f83b67a1258f Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr> Date: Wed, 7 Jun 2023 16:29:07 +0200 Subject: [PATCH] View: Some minor change. --- src/View/Geometry/PlotXY.py | 1 + src/View/Network/GraphWidget.py | 12 ++++++------ src/View/ui/BoundaryConditions.ui | 6 ++++++ src/View/ui/EditBoundaryConditions.ui | 9 ++++++++- src/View/ui/LateralContributions.ui | 6 ++++++ 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/View/Geometry/PlotXY.py b/src/View/Geometry/PlotXY.py index a64afbe5..36de09cc 100644 --- a/src/View/Geometry/PlotXY.py +++ b/src/View/Geometry/PlotXY.py @@ -51,6 +51,7 @@ class PlotXY(APlot): _translate("MainWindow_reach", "Y (m)"), color='green', fontsize=12 ) + self.canvas.axes.axis("equal") kp = self.data.get_kp() self.canvas.axes.set_xlim( diff --git a/src/View/Network/GraphWidget.py b/src/View/Network/GraphWidget.py index 6760af31..3cfdf47c 100644 --- a/src/View/Network/GraphWidget.py +++ b/src/View/Network/GraphWidget.py @@ -734,7 +734,7 @@ class GraphWidget(QGraphicsView): # Contextual menu - def menu_default(self, event, pos, items, menu): + def _menu_default(self, event, pos, items, menu): add_node = menu.addAction(_translate("Network", "Add node")) action = menu.exec_(self.mapToGlobal(event.pos())) @@ -742,7 +742,7 @@ class GraphWidget(QGraphicsView): if action == add_node: self.add_node(pos) - def menu_node(self, event, pos, items, menu): + def _menu_node(self, event, pos, items, menu): delete = menu.addAction(_translate("Network", "Delete the node")) disable = menu.addAction(_translate("Network", "Disable the node")) @@ -751,7 +751,7 @@ class GraphWidget(QGraphicsView): if action == delete: self.del_node(items[0]) - def menu_edge(self, event, pos, items, menu): + def _menu_edge(self, event, pos, items, menu): delete = menu.addAction(_translate("Network", "Delete the reach")) disable = menu.addAction(_translate("Network", "Disable the reach")) @@ -766,8 +766,8 @@ class GraphWidget(QGraphicsView): menu = QMenu(self) if len(items) == 0: - self.menu_default(event, pos, items, menu) + self._menu_default(event, pos, items, menu) elif type(items[0]) == NodeItem: - self.menu_node(event, pos, items, menu) + self._menu_node(event, pos, items, menu) elif type(items[0]) == EdgeItem: - self.menu_edge(event, pos, items, menu) + self._menu_edge(event, pos, items, menu) diff --git a/src/View/ui/BoundaryConditions.ui b/src/View/ui/BoundaryConditions.ui index 3097fd63..ac32ee3e 100644 --- a/src/View/ui/BoundaryConditions.ui +++ b/src/View/ui/BoundaryConditions.ui @@ -30,6 +30,12 @@ <enum>Qt::Horizontal</enum> </property> <widget class="QTabWidget" name="tabWidget"> + <property name="minimumSize"> + <size> + <width>300</width> + <height>0</height> + </size> + </property> <property name="currentIndex"> <number>0</number> </property> diff --git a/src/View/ui/EditBoundaryConditions.ui b/src/View/ui/EditBoundaryConditions.ui index 6a36a552..1fabe5fc 100644 --- a/src/View/ui/EditBoundaryConditions.ui +++ b/src/View/ui/EditBoundaryConditions.ui @@ -35,7 +35,14 @@ <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <widget class="QTableView" name="tableView"/> + <widget class="QTableView" name="tableView"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>200</height> + </size> + </property> + </widget> <widget class="QWidget" name="verticalLayoutWidget"> <layout class="QVBoxLayout" name="verticalLayout"/> </widget> diff --git a/src/View/ui/LateralContributions.ui b/src/View/ui/LateralContributions.ui index 3097fd63..ac32ee3e 100644 --- a/src/View/ui/LateralContributions.ui +++ b/src/View/ui/LateralContributions.ui @@ -30,6 +30,12 @@ <enum>Qt::Horizontal</enum> </property> <widget class="QTabWidget" name="tabWidget"> + <property name="minimumSize"> + <size> + <width>300</width> + <height>0</height> + </size> + </property> <property name="currentIndex"> <number>0</number> </property> -- GitLab