done for now
This commit is contained in:
parent
0e5264e917
commit
52e9117229
5
main.py
5
main.py
|
@ -60,6 +60,7 @@ class CalendarWindow(Gtk.ApplicationWindow):
|
|||
self.calendar = Gtk.Calendar()
|
||||
self.calendar.fill = True
|
||||
self.calendar.expand = True
|
||||
self.calendar.set_size_request(400,400)
|
||||
self.calendar_box.add(self.calendar)
|
||||
self.calendar_box.add(Gtk.Label(label="PlaceHolder"))
|
||||
self.main_box = Gtk.Paned(orientation=Gtk.Orientation.HORIZONTAL) # Box containing the list view and cal/buttons
|
||||
|
@ -70,7 +71,6 @@ class CalendarWindow(Gtk.ApplicationWindow):
|
|||
self.calendar.connect("day_selected",self._on_day_selected)
|
||||
|
||||
def _on_day_selected(self,calendar):
|
||||
print("day selected")
|
||||
calendar_date = calendar.get_date()
|
||||
date = datetime.date(calendar_date.year,calendar_date.month+1,calendar_date.day)
|
||||
self.header_bar.set_subtitle(date.isoformat())
|
||||
|
@ -78,9 +78,7 @@ class CalendarWindow(Gtk.ApplicationWindow):
|
|||
|
||||
|
||||
def populate_day(self,date):
|
||||
print(date)
|
||||
for c in self.event_list.get_children():
|
||||
print(c)
|
||||
c.destroy()
|
||||
events = parse_event_list(get_event_list(date))
|
||||
sorted_events = sorted(events, key=lambda k: k['start'])
|
||||
|
@ -94,6 +92,7 @@ class EventRow(Gtk.ListBoxRow):
|
|||
super().__init__()
|
||||
self.description_label = Gtk.Label(label=event['description'])
|
||||
self.box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
||||
self.box.padding = 20
|
||||
if event['type'] != 'event':
|
||||
timespan = f"{event['start'].strftime('%H:%M')} - {event['end'].strftime('%H:%M')}"
|
||||
self.timespan_label = Gtk.Label(label=timespan)
|
||||
|
|
Reference in New Issue