diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-14 14:20:13 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-14 14:24:00 +0200 |
commit | f81dcd10b9c09524a00b3b819679eca1d7ad6bf5 (patch) | |
tree | c315f7dd51908a9564e0081528d67cf11cb8a799 /src/ui/sidebarwidget.c | |
parent | b18205c60ee2c4549cf521e02f0223aec46e90b5 (diff) |
SidebarWidget: Handling feed entry URLs with spaces
The sidebar failed to realize that an entry was the current one and/or already read, because URL encoding is not consistently applied.
This needs addressing soon — internally, all URLs should have a consistent format (fully encoded or decoded, NFC normalized).
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 dc1a60dc..679d8e6f 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -134,7 +134,8 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { | |||
134 | d->menu = NULL; | 134 | d->menu = NULL; |
135 | switch (d->mode) { | 135 | switch (d->mode) { |
136 | case feeds_SidebarMode: { | 136 | case feeds_SidebarMode: { |
137 | const iString *docUrl = url_DocumentWidget(document_App()); | 137 | const iString *docUrl = withSpacesEncoded_String(url_DocumentWidget(document_App())); |
138 | /* TODO: internal URI normalization */ | ||
138 | iTime now; | 139 | iTime now; |
139 | iDate on; | 140 | iDate on; |
140 | initCurrent_Time(&now); | 141 | initCurrent_Time(&now); |
@@ -490,6 +491,7 @@ void init_SidebarWidget(iSidebarWidget *d, enum iSidebarSide side) { | |||
490 | d->list = new_ListWidget(); | 491 | d->list = new_ListWidget(); |
491 | setPadding_Widget(as_Widget(d->list), 0, gap_UI, 0, gap_UI); | 492 | setPadding_Widget(as_Widget(d->list), 0, gap_UI, 0, gap_UI); |
492 | addChild_Widget(content, iClob(d->list)); | 493 | addChild_Widget(content, iClob(d->list)); |
494 | d->contextItem = NULL; | ||
493 | d->blank = new_Widget(); | 495 | d->blank = new_Widget(); |
494 | addChildFlags_Widget(content, iClob(d->blank), resizeChildren_WidgetFlag); | 496 | addChildFlags_Widget(content, iClob(d->blank), resizeChildren_WidgetFlag); |
495 | addChildFlags_Widget(vdiv, iClob(content), expand_WidgetFlag); | 497 | addChildFlags_Widget(vdiv, iClob(content), expand_WidgetFlag); |
@@ -1037,6 +1039,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
1037 | } | 1039 | } |
1038 | if (d->menu && ev->type == SDL_MOUSEBUTTONDOWN) { | 1040 | if (d->menu && ev->type == SDL_MOUSEBUTTONDOWN) { |
1039 | if (ev->button.button == SDL_BUTTON_RIGHT) { | 1041 | if (ev->button.button == SDL_BUTTON_RIGHT) { |
1042 | d->contextItem = NULL; | ||
1040 | if (!isVisible_Widget(d->menu)) { | 1043 | if (!isVisible_Widget(d->menu)) { |
1041 | updateMouseHover_ListWidget(d->list); | 1044 | updateMouseHover_ListWidget(d->list); |
1042 | } | 1045 | } |