Skip to content

Commit

Permalink
Fix non spatial layer again
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinBuira committed Nov 12, 2024
1 parent 7b3d20d commit 3c4a0cc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Mergin/version_viewer_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,15 @@ def set_splitters_state(self):
else:
self.splitter_vertical.setSizes([120, 200, 40])

do_calc_height = True
state = settings.value("Mergin/VersionViewerSplitterSize")
if state:
self.splitter_map_table.restoreState(state)
else:

if self.splitter_map_table.sizes()[0] != 0:
do_calc_height = False

if do_calc_height:
height = max([self.map_canvas.minimumSizeHint().height(), self.attribute_table.minimumSizeHint().height()])
self.splitter_map_table.setSizes([height, height])

Expand Down Expand Up @@ -497,8 +502,12 @@ def update_canvas(self, layers):

if self.current_diff.isSpatial() == False:
self.map_canvas.setEnabled(False)
self.save_splitters_state()
self.splitter_map_table.setSizes([0, 1])
else:
self.map_canvas.setEnabled(True)
self.set_splitters_state()


self.update_canvas_layers(layers)
self.update_canvas_extend(layers)
Expand Down

0 comments on commit 3c4a0cc

Please sign in to comment.