Upcoming campaigns show 'Starts' by default
This commit is contained in:
1 parent
3dbe1f02be
commit
92e54f5d59
1 file changed
+7
-1
@@ -233,10 +233,15 @@ class PaddedListbox(tk.Listbox):
|
|||||||
|
|
||||||
|
|
||||||
class MouseOverLabel(ttk.Label):
|
class MouseOverLabel(ttk.Label):
|
||||||
def __init__(self, *args, alt_text: str = '', **kwargs) -> None:
|
def __init__(self, *args, alt_text: str = '', reverse: bool = False, **kwargs) -> None:
|
||||||
self._org_text: str = kwargs.get("text", '')
|
self._org_text: str = kwargs.get("text", '')
|
||||||
self._alt_text: str = alt_text
|
self._alt_text: str = alt_text
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
if reverse:
|
||||||
|
self.bind("<Enter>", lambda e: self.config(text=self._org_text))
|
||||||
|
self.bind("<Leave>", lambda e: self.config(text=self._alt_text))
|
||||||
|
self.config(text=self._alt_text)
|
||||||
|
else:
|
||||||
self.bind("<Enter>", lambda e: self.config(text=self._alt_text))
|
self.bind("<Enter>", lambda e: self.config(text=self._alt_text))
|
||||||
self.bind("<Leave>", lambda e: self.config(text=self._org_text))
|
self.bind("<Leave>", lambda e: self.config(text=self._org_text))
|
||||||
|
|
||||||
@@ -1045,6 +1050,7 @@ class InventoryOverview:
|
|||||||
alt_text=(
|
alt_text=(
|
||||||
f"Starts: {campaign.starts_at.astimezone().replace(microsecond=0, tzinfo=None)}"
|
f"Starts: {campaign.starts_at.astimezone().replace(microsecond=0, tzinfo=None)}"
|
||||||
),
|
),
|
||||||
|
reverse=campaign.upcoming,
|
||||||
takefocus=False,
|
takefocus=False,
|
||||||
).grid(column=1, row=2, sticky="w", padx=4)
|
).grid(column=1, row=2, sticky="w", padx=4)
|
||||||
# Linking status
|
# Linking status
|
||||||
|
|||||||
Reference in new issue
Block a user