Skip to content

Commit

Permalink
update ui scale on the fly
Browse files Browse the repository at this point in the history
  • Loading branch information
bordoray committed Aug 29, 2023
1 parent 6c94595 commit 17806f9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/main_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ def init_ui(self):
]
)

self.ui.label_scale_value.setText(str(get_scale()))
# calculate export scale and show to ui
self._update_ui_scale()
# update export scale shown in ui when change map extent
iface.mapCanvas().extentsChanged.connect(self._update_ui_scale)

# close dialog when project cleared to avoid crash: Issue #55
QgsProject.instance().cleared.connect(self.close)
Expand Down Expand Up @@ -274,3 +277,6 @@ def _process_node_recursive(self, node, parent_node):

if child_type == "group":
self._process_node_recursive(child, item)

def _update_ui_scale(self):
self.ui.label_scale_value.setText(str(get_scale()))

0 comments on commit 17806f9

Please sign in to comment.