update zoom % on statusbar

This commit is contained in:
Huy Pham 2019-12-16 12:04:18 -08:00
parent 3ceb5cde3e
commit 34c0b91228
2 changed files with 7 additions and 1 deletions

View file

@ -464,6 +464,8 @@ class CanvasGraph(tk.Canvas):
) )
logging.info("ratio: %s", self.ratio) logging.info("ratio: %s", self.ratio)
logging.info("offset: %s", self.offset) logging.info("offset: %s", self.offset)
self.app.statusbar.zoom.config(text="%s" % (int(self.ratio * 100)) + "%")
if self.wallpaper: if self.wallpaper:
self.redraw_wallpaper() self.redraw_wallpaper()

View file

@ -46,7 +46,11 @@ class StatusBar(ttk.Frame):
self.status.grid(row=0, column=1, sticky="ew") self.status.grid(row=0, column=1, sticky="ew")
self.zoom = ttk.Label( self.zoom = ttk.Label(
self, text="ZOOM TBD", anchor=tk.CENTER, borderwidth=1, relief=tk.RIDGE self,
text="%s" % (int(self.app.canvas.ratio * 100)) + "%",
anchor=tk.CENTER,
borderwidth=1,
relief=tk.RIDGE,
) )
self.zoom.grid(row=0, column=2, sticky="ew") self.zoom.grid(row=0, column=2, sticky="ew")