gui fix with self.columnconfigure(1, weight=0) in class MainFrame (row 36)

This commit is contained in:
2025-08-11 00:15:23 +02:00
parent 65271a50d7
commit f5768d2118
4 changed files with 39 additions and 21 deletions

View File

@@ -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()