diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-12-04 09:26:52 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-12-04 09:26:52 +0200 |
commit | 39d66598f3641749bd3e2b9b2588e921912d4ec7 (patch) | |
tree | abb7998d0165e0e1e598278da8d8e836bf705afc /src/ui/sidebarwidget.c | |
parent | c8089179f84a2cabd84a47a800aaadd9af8bd9b8 (diff) |
SidebarWidget: Interaction with the right sidebar
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r-- | src/ui/sidebarwidget.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 121e9a7c..ca4404d5 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -580,7 +580,8 @@ void setWidth_SidebarWidget(iSidebarWidget *d, int width) { | |||
580 | 580 | ||
581 | iBool handleBookmarkEditorCommands_SidebarWidget_(iWidget *editor, const char *cmd) { | 581 | iBool handleBookmarkEditorCommands_SidebarWidget_(iWidget *editor, const char *cmd) { |
582 | if (equal_Command(cmd, "bmed.accept") || equal_Command(cmd, "cancel")) { | 582 | if (equal_Command(cmd, "bmed.accept") || equal_Command(cmd, "cancel")) { |
583 | iSidebarWidget *d = findWidget_App("sidebar"); | 583 | iAssert(startsWith_String(id_Widget(editor), "bmed.")); |
584 | iSidebarWidget *d = findWidget_App(cstr_String(id_Widget(editor)) + 5); /* bmed.sidebar */ | ||
584 | if (equal_Command(cmd, "bmed.accept")) { | 585 | if (equal_Command(cmd, "bmed.accept")) { |
585 | const iString *title = text_InputWidget(findChild_Widget(editor, "bmed.title")); | 586 | const iString *title = text_InputWidget(findChild_Widget(editor, "bmed.title")); |
586 | const iString *url = text_InputWidget(findChild_Widget(editor, "bmed.url")); | 587 | const iString *url = text_InputWidget(findChild_Widget(editor, "bmed.url")); |
@@ -719,6 +720,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
719 | if (d->mode == bookmarks_SidebarMode && item) { | 720 | if (d->mode == bookmarks_SidebarMode && item) { |
720 | setFlags_Widget(w, disabled_WidgetFlag, iTrue); | 721 | setFlags_Widget(w, disabled_WidgetFlag, iTrue); |
721 | iWidget *dlg = makeBookmarkEditor_Widget(); | 722 | iWidget *dlg = makeBookmarkEditor_Widget(); |
723 | setId_Widget(dlg, format_CStr("bmed.%s", cstr_String(id_Widget(w)))); | ||
722 | iBookmark *bm = get_Bookmarks(bookmarks_App(), item->id); | 724 | iBookmark *bm = get_Bookmarks(bookmarks_App(), item->id); |
723 | setText_InputWidget(findChild_Widget(dlg, "bmed.title"), &bm->title); | 725 | setText_InputWidget(findChild_Widget(dlg, "bmed.title"), &bm->title); |
724 | setText_InputWidget(findChild_Widget(dlg, "bmed.url"), &bm->url); | 726 | setText_InputWidget(findChild_Widget(dlg, "bmed.url"), &bm->url); |
@@ -800,6 +802,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
800 | if (isCommand_Widget(w, ev, "feed.entry.edit")) { | 802 | if (isCommand_Widget(w, ev, "feed.entry.edit")) { |
801 | setFlags_Widget(w, disabled_WidgetFlag, iTrue); | 803 | setFlags_Widget(w, disabled_WidgetFlag, iTrue); |
802 | iWidget *dlg = makeBookmarkEditor_Widget(); | 804 | iWidget *dlg = makeBookmarkEditor_Widget(); |
805 | setId_Widget(dlg, format_CStr("bmed.%s", cstr_String(id_Widget(w)))); | ||
803 | setText_InputWidget(findChild_Widget(dlg, "bmed.title"), &feedBookmark->title); | 806 | setText_InputWidget(findChild_Widget(dlg, "bmed.title"), &feedBookmark->title); |
804 | setText_InputWidget(findChild_Widget(dlg, "bmed.url"), &feedBookmark->url); | 807 | setText_InputWidget(findChild_Widget(dlg, "bmed.url"), &feedBookmark->url); |
805 | setText_InputWidget(findChild_Widget(dlg, "bmed.tags"), &feedBookmark->tags); | 808 | setText_InputWidget(findChild_Widget(dlg, "bmed.tags"), &feedBookmark->tags); |