gui fix with self.columnconfigure(1, weight=0) in class MainFrame (row 36)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import threading
|
||||
import tkinter as tk
|
||||
import webbrowser
|
||||
from functools import partial
|
||||
@@ -54,12 +55,6 @@ class MenuBar(ttk.Frame):
|
||||
self.animated_icon_frame.bind("<Button-1>", lambda e: self.updater())
|
||||
self.animated_icon.bind("<Button-1>", lambda e: self.updater())
|
||||
|
||||
res = GiteaUpdate.api_down(
|
||||
AppConfig.UPDATE_URL, AppConfig.VERSION, ConfigManager.get(
|
||||
"updates")
|
||||
)
|
||||
self.update_ui_for_update(res)
|
||||
|
||||
# Tooltip Menu
|
||||
self.tooltip_label = tk.StringVar()
|
||||
self.tooltip_update_label()
|
||||
@@ -91,6 +86,19 @@ class MenuBar(ttk.Frame):
|
||||
self.log_btn.grid(column=11, row=0, sticky='e')
|
||||
Tooltip(self.log_btn, "Show Log", state_var=self.tooltip_state)
|
||||
|
||||
self.update_thread = threading.Thread(target=self.check_for_updates, daemon=True)
|
||||
self.update_thread.start()
|
||||
|
||||
def check_for_updates(self):
|
||||
"""
|
||||
Checks for updates in a separate thread.
|
||||
"""
|
||||
res = GiteaUpdate.api_down(
|
||||
AppConfig.UPDATE_URL, AppConfig.VERSION, ConfigManager.get("updates")
|
||||
)
|
||||
# Schedule the UI update in the main thread
|
||||
self.after(0, self.update_ui_for_update, res)
|
||||
|
||||
def update_ui_for_update(self, res):
|
||||
self.animated_icon_frame.grid_remove()
|
||||
self.animated_icon.hide()
|
||||
|
Reference in New Issue
Block a user