Aktivitäten-GUI-Anpassungen
Dieser Commit ist enthalten in:
@ -280,9 +280,38 @@ class MainWindow:
|
|||||||
)
|
)
|
||||||
self.status_label.pack(side="left", padx=20, pady=5)
|
self.status_label.pack(side="left", padx=20, pady=5)
|
||||||
|
|
||||||
# Activity status (clickable)
|
# Own activity indicator (yellow LED)
|
||||||
|
self.own_activity_frame = ctk.CTkFrame(self.status_bar, fg_color="transparent")
|
||||||
|
self.own_activity_frame.pack(side="left", padx=(20, 0))
|
||||||
|
|
||||||
|
self.own_activity_led = ctk.CTkLabel(
|
||||||
|
self.own_activity_frame,
|
||||||
|
text="", # Will be set to yellow circle when active
|
||||||
|
font=('Segoe UI', 12),
|
||||||
|
text_color=COLORS['accent_warning'],
|
||||||
|
cursor="hand2"
|
||||||
|
)
|
||||||
|
self.own_activity_led.pack(side="left", padx=(0, 5))
|
||||||
|
|
||||||
|
self.own_activity_label = ctk.CTkLabel(
|
||||||
|
self.own_activity_frame,
|
||||||
|
text="",
|
||||||
|
font=FONTS['small'],
|
||||||
|
text_color=COLORS['accent_warning'],
|
||||||
|
cursor="hand2"
|
||||||
|
)
|
||||||
|
self.own_activity_label.pack(side="left")
|
||||||
|
|
||||||
|
# Bind mouseover events for own activity
|
||||||
|
self.own_activity_led.bind("<Enter>", self._show_own_activity_tooltip)
|
||||||
|
self.own_activity_led.bind("<Leave>", self._hide_activity_tooltip)
|
||||||
|
self.own_activity_label.bind("<Enter>", self._show_own_activity_tooltip)
|
||||||
|
self.own_activity_label.bind("<Leave>", self._hide_activity_tooltip)
|
||||||
|
self.own_activity_label.bind("<Button-1>", self.show_activity_details)
|
||||||
|
|
||||||
|
# Team activity status (blue LED)
|
||||||
self.activity_frame = ctk.CTkFrame(self.status_bar, fg_color="transparent")
|
self.activity_frame = ctk.CTkFrame(self.status_bar, fg_color="transparent")
|
||||||
self.activity_frame.pack(side="left", padx=(20, 0))
|
self.activity_frame.pack(side="left", padx=(10, 0))
|
||||||
|
|
||||||
self.activity_label = ctk.CTkLabel(
|
self.activity_label = ctk.CTkLabel(
|
||||||
self.activity_frame,
|
self.activity_frame,
|
||||||
@ -3084,9 +3113,25 @@ class MainWindow:
|
|||||||
|
|
||||||
def update_activity_display(self, activities):
|
def update_activity_display(self, activities):
|
||||||
"""Update activity display in status bar"""
|
"""Update activity display in status bar"""
|
||||||
|
from services.activity_sync import activity_service
|
||||||
|
|
||||||
|
# Update own activity indicator (yellow LED)
|
||||||
|
own_activities = activity_service.get_all_current_activities()
|
||||||
|
if own_activities:
|
||||||
|
self.own_activity_led.configure(text="🟡")
|
||||||
|
activity_count = len(own_activities)
|
||||||
|
if activity_count == 1:
|
||||||
|
self.own_activity_label.configure(text=f"{own_activities[0]['projectName']}")
|
||||||
|
else:
|
||||||
|
self.own_activity_label.configure(text=f"{activity_count} Projekte aktiv")
|
||||||
|
else:
|
||||||
|
self.own_activity_led.configure(text="")
|
||||||
|
self.own_activity_label.configure(text="")
|
||||||
|
|
||||||
|
# Update team activity indicator (blue LED)
|
||||||
count = len(activities)
|
count = len(activities)
|
||||||
if count > 0:
|
if count > 0:
|
||||||
self.activity_label.configure(text=f"🟢 {count} Teammitglieder aktiv")
|
self.activity_label.configure(text=f"🔵 {count} Teammitglieder aktiv")
|
||||||
else:
|
else:
|
||||||
self.activity_label.configure(text="")
|
self.activity_label.configure(text="")
|
||||||
|
|
||||||
@ -3112,6 +3157,55 @@ class MainWindow:
|
|||||||
# Schedule next update
|
# Schedule next update
|
||||||
self.root.after(5000, self.update_activity_status) # Update every 5 seconds
|
self.root.after(5000, self.update_activity_status) # Update every 5 seconds
|
||||||
|
|
||||||
|
def _show_own_activity_tooltip(self, event=None):
|
||||||
|
"""Show tooltip with own active projects"""
|
||||||
|
if hasattr(self, 'activity_tooltip'):
|
||||||
|
self.activity_tooltip.destroy()
|
||||||
|
|
||||||
|
from services.activity_sync import activity_service
|
||||||
|
own_activities = activity_service.get_all_current_activities()
|
||||||
|
|
||||||
|
if not own_activities:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.activity_tooltip = ctk.CTkToplevel(self.root)
|
||||||
|
self.activity_tooltip.wm_overrideredirect(True)
|
||||||
|
self.activity_tooltip.configure(fg_color=COLORS['bg_secondary'])
|
||||||
|
|
||||||
|
# Build tooltip text
|
||||||
|
if len(own_activities) == 1:
|
||||||
|
text = f"🟡 {activity_service.user_name}\nAktiv: {own_activities[0]['projectName']}"
|
||||||
|
else:
|
||||||
|
text = f"🟡 {activity_service.user_name}\nAktive Projekte:"
|
||||||
|
for activity in own_activities:
|
||||||
|
text += f"\n• {activity['projectName']}"
|
||||||
|
|
||||||
|
label = ctk.CTkLabel(
|
||||||
|
self.activity_tooltip,
|
||||||
|
text=text,
|
||||||
|
font=FONTS['small'],
|
||||||
|
text_color=COLORS['text_primary'],
|
||||||
|
fg_color=COLORS['bg_secondary'],
|
||||||
|
justify="left"
|
||||||
|
)
|
||||||
|
label.pack(padx=10, pady=8)
|
||||||
|
|
||||||
|
# Position tooltip above the LED
|
||||||
|
x = self.own_activity_led.winfo_rootx()
|
||||||
|
y = self.own_activity_led.winfo_rooty() - 10
|
||||||
|
|
||||||
|
# Update tooltip position
|
||||||
|
self.activity_tooltip.update_idletasks()
|
||||||
|
tooltip_height = self.activity_tooltip.winfo_reqheight()
|
||||||
|
y = y - tooltip_height
|
||||||
|
|
||||||
|
self.activity_tooltip.geometry(f"+{x}+{y}")
|
||||||
|
|
||||||
|
def _hide_activity_tooltip(self, event=None):
|
||||||
|
"""Hide activity tooltip"""
|
||||||
|
if hasattr(self, 'activity_tooltip'):
|
||||||
|
self.activity_tooltip.destroy()
|
||||||
|
|
||||||
def show_activity_details(self, event=None):
|
def show_activity_details(self, event=None):
|
||||||
"""Show detailed activity information"""
|
"""Show detailed activity information"""
|
||||||
from services.activity_sync import activity_service
|
from services.activity_sync import activity_service
|
||||||
|
|||||||
In neuem Issue referenzieren
Einen Benutzer sperren