mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 06:40:05 +00:00
Calendar: Add ability to view events
This commit is contained in:
parent
0d41f6cf89
commit
433fe3dc26
Notes:
sideshowbarker
2024-07-17 02:06:40 +09:00
Author: https://github.com/notSanil
Commit: 433fe3dc26
Pull-request: https://github.com/SerenityOS/serenity/pull/23065
Reviewed-by: https://github.com/ADKaster ✅
7 changed files with 179 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "CalendarWidget.h"
|
||||
#include "AddEventDialog.h"
|
||||
#include "ViewEventDialog.h"
|
||||
#include <AK/JsonParser.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <LibConfig/Client.h>
|
||||
|
@ -298,8 +299,17 @@ ErrorOr<NonnullRefPtr<GUI::Action>> CalendarWidget::create_open_settings_action(
|
|||
void CalendarWidget::create_on_tile_doubleclick()
|
||||
{
|
||||
m_event_calendar->on_tile_doubleclick = [&] {
|
||||
for (const auto& event : m_event_calendar->event_manager().events()) {
|
||||
auto start = event.start;
|
||||
auto selected_date = m_event_calendar->selected_date();
|
||||
|
||||
if (start.year() == selected_date.year() && start.month() == selected_date.month() && start.day() == selected_date.day()) {
|
||||
ViewEventDialog::show(selected_date, m_event_calendar->event_manager(), window());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
AddEventDialog::show(m_event_calendar->selected_date(), m_event_calendar->event_manager(), window());
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue