=> c8089179f84a2cabd84a47a800aaadd9af8bd9b8
[1mdiff --git a/src/app.c b/src/app.c[m [1mindex b799b627..cf8a7119 100644[m [1m--- a/src/app.c[m [1m+++ b/src/app.c[m [36m@@ -139,7 +139,8 @@[m [mconst iString *dateStr_(const iDate *date) {[m [m static iString *serializePrefs_App_(const iApp *d) {[m iString *str = new_String();[m [31m- const iSidebarWidget *sidebar = findWidget_App("sidebar");[m [32m+[m[32m const iSidebarWidget *sidebar = findWidget_App("sidebar");[m [32m+[m[32m const iSidebarWidget *sidebar2 = findWidget_App("sidebar2");[m appendFormat_String(str, "window.retain arg:%d\n", d->prefs.retainWindowSize);[m if (d->prefs.retainWindowSize) {[m const iBool isMaximized = (SDL_GetWindowFlags(d->window->win) & SDL_WINDOW_MAXIMIZED) != 0;[m [36m@@ -150,6 +151,7 @@[m [mstatic iString *serializePrefs_App_(const iApp *d) {[m h = d->window->lastRect.size.y;[m appendFormat_String(str, "window.setrect width:%d height:%d coord:%d %d\n", w, h, x, y);[m appendFormat_String(str, "sidebar.width arg:%d\n", width_SidebarWidget(sidebar));[m [32m+[m[32m appendFormat_String(str, "sidebar2.width arg:%d\n", width_SidebarWidget(sidebar2));[m /* On macOS, maximization should be applied at creation time or the window will take[m a moment to animate to its maximized size. */[m #if !defined (iPlatformApple)[m [36m@@ -160,10 +162,16 @@[m [mstatic iString *serializePrefs_App_(const iApp *d) {[m iUnused(isMaximized);[m #endif[m }[m [31m- if (isVisible_Widget(sidebar)) {[m [31m- appendCStr_String(str, "sidebar.toggle\n");[m [32m+[m[32m /* Sidebars. */ {[m [32m+[m[32m if (isVisible_Widget(sidebar)) {[m [32m+[m[32m appendCStr_String(str, "sidebar.toggle\n");[m [32m+[m[32m }[m [32m+[m[32m appendFormat_String(str, "sidebar.mode arg:%d\n", mode_SidebarWidget(sidebar));[m [32m+[m[32m if (isVisible_Widget(sidebar2)) {[m [32m+[m[32m appendCStr_String(str, "sidebar2.toggle\n");[m [32m+[m[32m }[m [32m+[m[32m appendFormat_String(str, "sidebar2.mode arg:%d\n", mode_SidebarWidget(sidebar2));[m }[m [31m- appendFormat_String(str, "sidebar.mode arg:%d\n", mode_SidebarWidget(sidebar));[m appendFormat_String(str, "uiscale arg:%f\n", uiScale_Window(d->window));[m appendFormat_String(str, "prefs.dialogtab arg:%d\n", d->prefs.dialogTab);[m appendFormat_String(str, "font.set arg:%d\n", d->prefs.font);[m [1mdiff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c[m [1mindex a6cc8187..0d931080 100644[m [1m--- a/src/ui/documentwidget.c[m [1m+++ b/src/ui/documentwidget.c[m [36m@@ -2909,6 +2909,7 @@[m [mstatic void drawSideElements_DocumentWidget_(const iDocumentWidget *d) {[m iMax(0, scrollMax_DocumentWidget_(d) - value_Anim(&d->scrollY)))),[m tmQuoteIcon_ColorId);[m }[m [32m+[m[32m#if 0[m /* Outline on the right side. */[m const float outlineOpacity = value_Anim(&d->outlineOpacity);[m if (prefs_App()->hoverOutline && !isEmpty_Array(&d->outline) && outlineOpacity > 0.0f) {[m [36m@@ -2964,8 +2965,9 @@[m [mstatic void drawSideElements_DocumentWidget_(const iDocumentWidget *d) {[m setOpacity_Text(1.0f);[m SDL_SetRenderDrawBlendMode(renderer_Window(get_Window()), SDL_BLENDMODE_NONE);[m }[m [32m+[m[32m#endif[m unsetClip_Paint(&p);[m [31m- }[m [32m+[m[32m}[m [m static void drawPlayers_DocumentWidget_(const iDocumentWidget *d, iPaint *p) {[m iConstForEach(PtrArray, i, &d->visiblePlayers) {[m [1mdiff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c[m [1mindex 5baa08f7..121e9a7c 100644[m [1m--- a/src/ui/sidebarwidget.c[m [1m+++ b/src/ui/sidebarwidget.c[m [36m@@ -84,7 +84,9 @@[m [miDefineObjectConstruction(SidebarItem)[m [m struct Impl_SidebarWidget {[m iWidget widget;[m [32m+[m[32m enum iSidebarSide side;[m enum iSidebarMode mode;[m [32m+[m[32m iString cmdPrefix;[m iWidget * blank;[m iListWidget * list;[m int modeScroll[max_SidebarMode];[m [36m@@ -92,12 +94,11 @@[m [mstruct Impl_SidebarWidget {[m int maxButtonLabelWidth;[m int width;[m iWidget * resizer;[m [31m- SDL_Cursor * resizeCursor;[m iWidget * menu;[m iSidebarItem * contextItem; /* list item accessed in the context menu */[m };[m [m [31m-iDefineObjectConstruction(SidebarWidget)[m [32m+[m[32miDefineObjectConstructionArgs(SidebarWidget, (enum iSidebarSide side), side)[m [m static iBool isResizing_SidebarWidget_(const iSidebarWidget *d) {[m return (flags_Widget(d->resizer) & pressed_WidgetFlag) != 0;[m [36m@@ -408,16 +409,19 @@[m [mstatic const char *tightModeLabels_[max_SidebarMode] = {[m "\U0001f5b9",[m };[m [m [31m-void init_SidebarWidget(iSidebarWidget *d) {[m [32m+[m[32mvoid init_SidebarWidget(iSidebarWidget *d, enum iSidebarSide side) {[m iWidget *w = as_Widget(d);[m init_Widget(w);[m [31m- setId_Widget(w, "sidebar");[m [32m+[m[32m setId_Widget(w, side == left_SideBarSide ? "sidebar" : "sidebar2");[m [32m+[m[32m initCopy_String(&d->cmdPrefix, id_Widget(w));[m [32m+[m[32m appendChar_String(&d->cmdPrefix, '.');[m setBackgroundColor_Widget(w, none_ColorId);[m setFlags_Widget(w,[m collapse_WidgetFlag | hidden_WidgetFlag | arrangeHorizontal_WidgetFlag |[m resizeWidthOfChildren_WidgetFlag,[m iTrue);[m iZap(d->modeScroll);[m [32m+[m[32m d->side = side;[m d->mode = -1;[m d->width = 60 * gap_UI;[m setFlags_Widget(w, fixedWidth_WidgetFlag, iTrue);[m [36m@@ -428,8 +432,9 @@[m [mvoid init_SidebarWidget(iSidebarWidget *d) {[m for (int i = 0; i < max_SidebarMode; i++) {[m d->modeButtons[i] = addChildFlags_Widget([m buttons,[m [31m- iClob([m [31m- new_LabelWidget(tightModeLabels_[i], format_CStr("sidebar.mode arg:%d", i))),[m [32m+[m[32m iClob(new_LabelWidget([m [32m+[m[32m tightModeLabels_[i],[m [32m+[m[32m format_CStr("%s.mode arg:%d", cstr_String(id_Widget(w)), i))),[m frameless_WidgetFlag);[m d->maxButtonLabelWidth =[m iMaxi(d->maxButtonLabelWidth,[m [36m@@ -448,21 +453,22 @@[m [mvoid init_SidebarWidget(iSidebarWidget *d) {[m addChildFlags_Widget(content, iClob(d->blank), resizeChildren_WidgetFlag);[m addChildFlags_Widget(vdiv, iClob(content), expand_WidgetFlag);[m setMode_SidebarWidget(d, bookmarks_SidebarMode);[m [31m- d->resizer = addChildFlags_Widget([m [31m- w,[m [31m- iClob(new_Widget()),[m [31m- hover_WidgetFlag | commandOnClick_WidgetFlag | fixedWidth_WidgetFlag |[m [31m- resizeToParentHeight_WidgetFlag | moveToParentRightEdge_WidgetFlag);[m [31m- setId_Widget(d->resizer, "sidebar.grab");[m [32m+[m[32m d->resizer =[m [32m+[m[32m addChildFlags_Widget(w,[m [32m+[m[32m iClob(new_Widget()),[m [32m+[m[32m hover_WidgetFlag | commandOnClick_WidgetFlag | fixedWidth_WidgetFlag |[m [32m+[m[32m resizeToParentHeight_WidgetFlag |[m [32m+[m[32m (side == left_SideBarSide ? moveToParentRightEdge_WidgetFlag[m [32m+[m[32m : moveToParentLeftEdge_WidgetFlag));[m [32m+[m[32m setId_Widget(d->resizer, side == left_SideBarSide ? "sidebar.grab" : "sidebar2.grab");[m d->resizer->rect.size.x = gap_UI;[m setBackgroundColor_Widget(d->resizer, none_ColorId);[m [31m- d->resizeCursor = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEWE);[m d->menu = NULL;[m addAction_Widget(w, SDLK_r, KMOD_PRIMARY | KMOD_SHIFT, "feeds.refresh");[m }[m [m void deinit_SidebarWidget(iSidebarWidget *d) {[m [31m- SDL_FreeCursor(d->resizeCursor);[m [32m+[m[32m deinit_String(&d->cmdPrefix);[m }[m [m static const iGmIdentity *constHoverIdentity_SidebarWidget_(const iSidebarWidget *d) {[m [36m@@ -594,6 +600,43 @@[m [miBool handleBookmarkEditorCommands_SidebarWidget_(iWidget *editor, const char *c[m return iFalse;[m }[m [m [32m+[m[32mstatic iBool handleSidebarCommand_SidebarWidget_(iSidebarWidget *d, const char *cmd) {[m [32m+[m[32m iWidget *w = as_Widget(d);[m [32m+[m[32m if (equal_Command(cmd, "width")) {[m [32m+[m[32m setWidth_SidebarWidget(d, arg_Command(cmd));[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m [32m+[m[32m else if (equal_Command(cmd, "mode")) {[m [32m+[m[32m const iBool wasChanged = setMode_SidebarWidget(d, arg_Command(cmd));[m [32m+[m[32m updateItems_SidebarWidget_(d);[m [32m+[m[32m if ((argLabel_Command(cmd, "show") && !isVisible_Widget(w)) ||[m [32m+[m[32m (argLabel_Command(cmd, "toggle") && (!isVisible_Widget(w) || !wasChanged))) {[m [32m+[m[32m postCommandf_App("%s.toggle", cstr_String(id_Widget(w)));[m [32m+[m[32m }[m [32m+[m[32m scrollOffset_ListWidget(d->list, 0);[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m [32m+[m[32m else if (equal_Command(cmd, "toggle")) {[m [32m+[m[32m if (arg_Command(cmd) && isVisible_Widget(w)) {[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m [32m+[m[32m setFlags_Widget(w, hidden_WidgetFlag, isVisible_Widget(w));[m [32m+[m[32m if (isVisible_Widget(w)) {[m [32m+[m[32m w->rect.size.x = d->width;[m [32m+[m[32m invalidate_ListWidget(d->list);[m [32m+[m[32m }[m [32m+[m[32m arrange_Widget(w->parent);[m [32m+[m[32m updateSize_DocumentWidget(document_App());[m [32m+[m[32m if (isVisible_Widget(w)) {[m [32m+[m[32m updateItems_SidebarWidget_(d);[m [32m+[m[32m scrollOffset_ListWidget(d->list, 0);[m [32m+[m[32m }[m [32m+[m[32m refresh_Widget(w->parent);[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m [32m+[m[32m return iFalse;[m [32m+[m[32m}[m [32m+[m static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) {[m iWidget *w = as_Widget(d);[m /* Handle commands. */[m [36m@@ -602,7 +645,27 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m }[m else if (ev->type == SDL_USEREVENT && ev->user.code == command_UserEventCode) {[m const char *cmd = command_UserEvent(ev);[m [31m- if (isCommand_Widget(w, ev, "mouse.clicked")) {[m [32m+[m[32m if (equal_Command(cmd, "tabs.changed") || equal_Command(cmd, "document.changed")) {[m [32m+[m[32m updateItems_SidebarWidget_(d);[m [32m+[m[32m scrollOffset_ListWidget(d->list, 0);[m [32m+[m[32m }[m [32m+[m[32m else if (equal_Command(cmd, "visited.changed") &&[m [32m+[m[32m (d->mode == history_SidebarMode || d->mode == feeds_SidebarMode)) {[m [32m+[m[32m updateItems_SidebarWidget_(d);[m [32m+[m[32m }[m [32m+[m[32m else if (equal_Command(cmd, "bookmarks.changed") && (d->mode == bookmarks_SidebarMode ||[m [32m+[m[32m d->mode == feeds_SidebarMode)) {[m [32m+[m[32m updateItems_SidebarWidget_(d);[m [32m+[m[32m }[m [32m+[m[32m else if (equal_Command(cmd, "idents.changed") && d->mode == identities_SidebarMode) {[m [32m+[m[32m updateItems_SidebarWidget_(d);[m [32m+[m[32m }[m [32m+[m[32m else if (startsWith_CStr(cmd, cstr_String(&d->cmdPrefix))) {[m [32m+[m[32m if (handleSidebarCommand_SidebarWidget_(d, cmd + size_String(&d->cmdPrefix))) {[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m [32m+[m[32m }[m [32m+[m[32m else if (isCommand_Widget(w, ev, "mouse.clicked")) {[m if (argLabel_Command(cmd, "button") == SDL_BUTTON_LEFT) {[m if (arg_Command(cmd)) {[m setFlags_Widget(d->resizer, pressed_WidgetFlag, iTrue);[m [36m@@ -624,7 +687,13 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m else if (isCommand_Widget(w, ev, "mouse.moved")) {[m if (isResizing_SidebarWidget_(d)) {[m const iInt2 local = localCoord_Widget(w, coord_Command(cmd));[m [31m- setWidth_SidebarWidget(d, local.x + d->resizer->rect.size.x / 2);[m [32m+[m[32m const int resMid = d->resizer->rect.size.x / 2;[m [32m+[m[32m setWidth_SidebarWidget([m [32m+[m[32m d,[m [32m+[m[32m (d->side == left_SideBarSide[m [32m+[m[32m ? local.x[m [32m+[m[32m : (rootSize_Window(get_Window()).x - coord_Command(cmd).x)) +[m [32m+[m[32m resMid);[m }[m return iTrue;[m }[m [36m@@ -638,50 +707,14 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m else if (isCommand_Widget(w, ev, "menu.closed")) {[m setFlags_Widget(as_Widget(d->list), disabled_WidgetFlag, iFalse);[m }[m [31m- else if (equal_Command(cmd, "sidebar.width")) {[m [31m- setWidth_SidebarWidget(d, arg_Command(cmd));[m [31m- return iTrue;[m [31m- }[m [31m- else if (equal_Command(cmd, "sidebar.mode")) {[m [31m- const iBool wasChanged = setMode_SidebarWidget(d, arg_Command(cmd));[m [31m- updateItems_SidebarWidget_(d);[m [31m- if ((argLabel_Command(cmd, "show") && !isVisible_Widget(w)) ||[m [31m- (argLabel_Command(cmd, "toggle") && (!isVisible_Widget(w) || !wasChanged))) {[m [31m- postCommand_App("sidebar.toggle");[m [31m- }[m [31m- scrollOffset_ListWidget(d->list, 0);[m [31m- return iTrue;[m [31m- }[m [31m- else if (equal_Command(cmd, "sidebar.toggle")) {[m [31m- if (arg_Command(cmd) && isVisible_Widget(w)) {[m [31m- return iTrue;[m [31m- }[m [31m- setFlags_Widget(w, hidden_WidgetFlag, isVisible_Widget(w));[m [31m- if (isVisible_Widget(w)) {[m [31m- w->rect.size.x = d->width;[m [31m- invalidate_ListWidget(d->list);[m [31m- }[m [31m- arrange_Widget(w->parent);[m [31m- updateSize_DocumentWidget(document_App());[m [31m- if (isVisible_Widget(w)) {[m [31m- updateItems_SidebarWidget_(d);[m [31m- scrollOffset_ListWidget(d->list, 0);[m [31m- }[m [31m- refresh_Widget(w->parent);[m [31m- return iTrue;[m [31m- }[m [31m- else if (equal_Command(cmd, "tabs.changed") || equal_Command(cmd, "document.changed")) {[m [31m- updateItems_SidebarWidget_(d);[m [31m- scrollOffset_ListWidget(d->list, 0);[m [31m- }[m [31m- else if (equal_Command(cmd, "bookmark.copy")) {[m [32m+[m[32m else if (isCommand_Widget(w, ev, "bookmark.copy")) {[m const iSidebarItem *item = d->contextItem;[m if (d->mode == bookmarks_SidebarMode && item) {[m SDL_SetClipboardText(cstr_String(&item->url));[m }[m return iTrue;[m }[m [31m- else if (equal_Command(cmd, "bookmark.edit")) {[m [32m+[m[32m else if (isCommand_Widget(w, ev, "bookmark.edit")) {[m const iSidebarItem *item = d->contextItem;[m if (d->mode == bookmarks_SidebarMode && item) {[m setFlags_Widget(w, disabled_WidgetFlag, iTrue);[m [36m@@ -695,7 +728,7 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m }[m return iTrue;[m }[m [31m- else if (equal_Command(cmd, "bookmark.tag")) {[m [32m+[m[32m else if (isCommand_Widget(w, ev, "bookmark.tag")) {[m const iSidebarItem *item = d->contextItem;[m if (d->mode == bookmarks_SidebarMode && item) {[m const char *tag = cstr_String(string_Command(cmd, "tag"));[m [36m@@ -713,7 +746,7 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m }[m return iTrue;[m }[m [31m- else if (equal_Command(cmd, "bookmark.delete")) {[m [32m+[m[32m else if (isCommand_Widget(w, ev, "bookmark.delete")) {[m const iSidebarItem *item = d->contextItem;[m if (d->mode == bookmarks_SidebarMode && item && remove_Bookmarks(bookmarks_App(), item->id)) {[m removeEntries_Feeds(item->id);[m [36m@@ -721,10 +754,6 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m }[m return iTrue;[m }[m [31m- else if (equal_Command(cmd, "visited.changed") &&[m [31m- (d->mode == history_SidebarMode || d->mode == feeds_SidebarMode)) {[m [31m- updateItems_SidebarWidget_(d);[m [31m- }[m else if (equal_Command(cmd, "feeds.update.finished") && d->mode == feeds_SidebarMode) {[m updateItems_SidebarWidget_(d);[m }[m [36m@@ -742,11 +771,11 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m else if (startsWith_CStr(cmd, "feed.entry.") && d->mode == feeds_SidebarMode) {[m const iSidebarItem *item = d->contextItem;[m if (item) {[m [31m- if (equal_Command(cmd, "feed.entry.opentab")) {[m [32m+[m[32m if (isCommand_Widget(w, ev, "feed.entry.opentab")) {[m postCommandf_App("open newtab:1 url:%s", cstr_String(&item->url));[m return iTrue;[m }[m [31m- if (equal_Command(cmd, "feed.entry.toggleread")) {[m [32m+[m[32m if (isCommand_Widget(w, ev, "feed.entry.toggleread")) {[m iVisited *vis = visited_App();[m if (containsUrl_Visited(vis, &item->url)) {[m removeUrl_Visited(vis, &item->url);[m [36m@@ -757,18 +786,18 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m postCommand_App("visited.changed");[m return iTrue;[m }[m [31m- if (equal_Command(cmd, "feed.entry.bookmark")) {[m [32m+[m[32m if (isCommand_Widget(w, ev, "feed.entry.bookmark")) {[m makeBookmarkCreation_Widget(&item->url, &item->label, item->icon);[m postCommand_App("focus.set id:bmed.title");[m return iTrue;[m }[m iBookmark *feedBookmark = get_Bookmarks(bookmarks_App(), item->id);[m if (feedBookmark) {[m [31m- if (equal_Command(cmd, "feed.entry.openfeed")) {[m [32m+[m[32m if (isCommand_Widget(w, ev, "feed.entry.openfeed")) {[m postCommandf_App("open url:%s", cstr_String(&feedBookmark->url));[m return iTrue;[m }[m [31m- if (equal_Command(cmd, "feed.entry.edit")) {[m [32m+[m[32m if (isCommand_Widget(w, ev, "feed.entry.edit")) {[m setFlags_Widget(w, disabled_WidgetFlag, iTrue);[m iWidget *dlg = makeBookmarkEditor_Widget();[m setText_InputWidget(findChild_Widget(dlg, "bmed.title"), &feedBookmark->title);[m [36m@@ -778,7 +807,7 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m setFocus_Widget(findChild_Widget(dlg, "bmed.title"));[m return iTrue;[m }[m [31m- if (equal_Command(cmd, "feed.entry.unsubscribe")) {[m [32m+[m[32m if (isCommand_Widget(w, ev, "feed.entry.unsubscribe")) {[m if (arg_Command(cmd)) {[m removeTag_Bookmark(feedBookmark, "subscribed");[m removeEntries_Feeds(id_Bookmark(feedBookmark));[m [36m@@ -791,7 +820,7 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m cstr_String(&feedBookmark->title)),[m (const char *[]){ "Cancel",[m uiTextCaution_ColorEscape "Unsubscribe" },[m [31m- (const char *[]){ "cancel", "feed.entry.unsubscribe arg:1" },[m [32m+[m[32m (const char *[]){ "cancel", "feed.entry.unsubscribe arg:1" }, /* FIXME: which sidebar */[m 2);[m }[m return iTrue;[m [36m@@ -799,13 +828,6 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m }[m }[m }[m [31m- else if (equal_Command(cmd, "bookmarks.changed") && (d->mode == bookmarks_SidebarMode ||[m [31m- d->mode == feeds_SidebarMode)) {[m [31m- updateItems_SidebarWidget_(d);[m [31m- }[m [31m- else if (equal_Command(cmd, "idents.changed") && d->mode == identities_SidebarMode) {[m [31m- updateItems_SidebarWidget_(d);[m [31m- }[m else if (isCommand_Widget(w, ev, "ident.use")) {[m iGmIdentity * ident = menuIdentity_SidebarWidget_(d);[m const iString *tabUrl = url_DocumentWidget(document_App());[m [36m@@ -843,7 +865,7 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m }[m return iTrue;[m }[m [31m- else if (equal_Command(cmd, "ident.setnotes")) {[m [32m+[m[32m else if (isCommand_Widget(w, ev, "ident.setnotes")) {[m iGmIdentity *ident = pointerLabel_Command(cmd, "ident");[m if (ident) {[m setCStr_String(&ident->notes, suffixPtr_Command(cmd, "value"));[m [36m@@ -864,7 +886,7 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m }[m return iTrue;[m }[m [31m- else if (equal_Command(cmd, "ident.delete")) {[m [32m+[m[32m else if (isCommand_Widget(w, ev, "ident.delete")) {[m iSidebarItem *item = d->contextItem;[m if (argLabel_Command(cmd, "confirm")) {[m makeQuestion_Widget(uiTextCaution_ColorEscape "DELETE IDENTITY",[m [36m@@ -876,7 +898,7 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m (const char *[]){ "Cancel",[m uiTextCaution_ColorEscape[m "Delete Identity and Files" },[m [31m- (const char *[]){ "cancel", "ident.delete confirm:0" },[m [32m+[m[32m (const char *[]){ "cancel", "ident.delete confirm:0" }, /* FIXME: which sidebar */[m 2);[m return iTrue;[m }[m [36m@@ -884,7 +906,7 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m updateItems_SidebarWidget_(d);[m return iTrue;[m }[m [31m- else if (equal_Command(cmd, "history.delete")) {[m [32m+[m[32m else if (isCommand_Widget(w, ev, "history.delete")) {[m if (d->contextItem && !isEmpty_String(&d->contextItem->url)) {[m removeUrl_Visited(visited_App(), &d->contextItem->url);[m updateItems_SidebarWidget_(d);[m [36m@@ -892,14 +914,14 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m }[m return iTrue;[m }[m [31m- else if (equal_Command(cmd, "history.copy")) {[m [32m+[m[32m else if (isCommand_Widget(w, ev, "history.copy")) {[m const iSidebarItem *item = d->contextItem;[m if (item && !isEmpty_String(&item->url)) {[m SDL_SetClipboardText(cstr_String(&item->url));[m }[m return iTrue;[m }[m [31m- else if (equal_Command(cmd, "history.addbookmark")) {[m [32m+[m[32m else if (isCommand_Widget(w, ev, "history.addbookmark")) {[m const iSidebarItem *item = d->contextItem;[m if (!isEmpty_String(&item->url)) {[m makeBookmarkCreation_Widget([m [1mdiff --git a/src/ui/sidebarwidget.h b/src/ui/sidebarwidget.h[m [1mindex 0d4ed9c8..fa74e049 100644[m [1m--- a/src/ui/sidebarwidget.h[m [1m+++ b/src/ui/sidebarwidget.h[m [36m@@ -33,8 +33,13 @@[m [menum iSidebarMode {[m max_SidebarMode[m };[m [m [32m+[m[32menum iSidebarSide {[m [32m+[m[32m left_SideBarSide,[m [32m+[m[32m right_SideBarSide,[m [32m+[m[32m};[m [32m+[m iDeclareWidgetClass(SidebarWidget)[m [31m-iDeclareObjectConstruction(SidebarWidget)[m [32m+[m[32miDeclareObjectConstructionArgs(SidebarWidget, enum iSidebarSide side)[m [m iBool setMode_SidebarWidget (iSidebarWidget *, enum iSidebarMode mode);[m [m [1mdiff --git a/src/ui/util.c b/src/ui/util.c[m [1mindex d9997004..ef69b5f1 100644[m [1m--- a/src/ui/util.c[m [1m+++ b/src/ui/util.c[m [36m@@ -1031,8 +1031,8 @@[m [miWidget *makePreferences_Widget(void) {[m appendTwoColumnPage_(tabs, "General", '1', &headings, &values);[m addChild_Widget(headings, iClob(makeHeading_Widget("Downloads folder:")));[m setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.downloads");[m [31m- addChild_Widget(headings, iClob(makeHeading_Widget("Outline on scrollbar:")));[m [31m- addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoveroutline")));[m [32m+[m[32m /*addChild_Widget(headings, iClob(makeHeading_Widget("Outline on scrollbar:")));[m [32m+[m[32m addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoveroutline")));*/[m addChild_Widget(headings, iClob(makeHeading_Widget("Smooth scrolling:")));[m addChild_Widget(values, iClob(makeToggle_Widget("prefs.smoothscroll")));[m addChild_Widget(headings, iClob(makeHeading_Widget("Load image on scroll:")));[m [1mdiff --git a/src/ui/widget.c b/src/ui/widget.c[m [1mindex 4d50da38..f3e73ee7 100644[m [1m--- a/src/ui/widget.c[m [1m+++ b/src/ui/widget.c[m [36m@@ -263,10 +263,13 @@[m [mvoid arrange_Widget(iWidget *d) {[m setFlags_Widget(d, wasCollapsed_WidgetFlag, iTrue);[m return;[m }[m [31m- if (d->flags & moveToParentRightEdge_WidgetFlag) {[m [32m+[m[32m if (d->flags & moveToParentLeftEdge_WidgetFlag) {[m [32m+[m[32m d->rect.pos.x = d->padding[0];[m [32m+[m[32m }[m [32m+[m[32m else if (d->flags & moveToParentRightEdge_WidgetFlag) {[m d->rect.pos.x = width_Rect(innerRect_Widget_(d->parent)) - width_Rect(d->rect);[m }[m [31m- if (d->flags & centerHorizontal_WidgetFlag) {[m [32m+[m[32m else if (d->flags & centerHorizontal_WidgetFlag) {[m centerHorizontal_Widget_(d);[m }[m if (d->flags & resizeToParentWidth_WidgetFlag) {[m [36m@@ -388,7 +391,8 @@[m [mvoid arrange_Widget(iWidget *d) {[m continue;[m }[m if (d->flags & (arrangeHorizontal_WidgetFlag | arrangeVertical_WidgetFlag)) {[m [31m- if (child->flags & moveToParentRightEdge_WidgetFlag) {[m [32m+[m[32m if (child->flags &[m [32m+[m[32m (moveToParentLeftEdge_WidgetFlag | moveToParentRightEdge_WidgetFlag)) {[m continue; /* Not part of the sequential arrangement .*/[m }[m child->rect.pos = pos;[m [36m@@ -422,7 +426,8 @@[m [mvoid arrange_Widget(iWidget *d) {[m iForEach(ObjectList, j, d->children) {[m iWidget *child = as_Widget(j.object);[m if (child->flags &[m [31m- (resizeToParentWidth_WidgetFlag | moveToParentRightEdge_WidgetFlag)) {[m [32m+[m[32m (resizeToParentWidth_WidgetFlag | moveToParentLeftEdge_WidgetFlag |[m [32m+[m[32m moveToParentRightEdge_WidgetFlag)) {[m arrange_Widget(child);[m }[m }[m [1mdiff --git a/src/ui/widget.h b/src/ui/widget.h[m [1mindex 278ae081..f06a6607 100644[m [1m--- a/src/ui/widget.h[m [1m+++ b/src/ui/widget.h[m [36m@@ -85,10 +85,11 @@[m [menum iWidgetFlag {[m /* 64-bit extended flags */[m #define wasCollapsed_WidgetFlag iBit64(32)[m #define centerHorizontal_WidgetFlag iBit64(33)[m [31m-#define moveToParentRightEdge_WidgetFlag iBit64(34)[m [31m-#define wrapText_WidgetFlag iBit64(35)[m [31m-#define borderTop_WidgetFlag iBit64(36)[m [31m-#define overflowScrollable_WidgetFlag iBit64(37)[m [32m+[m[32m#define moveToParentLeftEdge_WidgetFlag iBit64(34)[m [32m+[m[32m#define moveToParentRightEdge_WidgetFlag iBit64(35)[m [32m+[m[32m#define wrapText_WidgetFlag iBit64(36)[m [32m+[m[32m#define borderTop_WidgetFlag iBit64(37)[m [32m+[m[32m#define overflowScrollable_WidgetFlag iBit64(38)[m [m enum iWidgetAddPos {[m back_WidgetAddPos,[m [1mdiff --git a/src/ui/window.c b/src/ui/window.c[m [1mindex 199e35a7..53300d24 100644[m [1m--- a/src/ui/window.c[m [1m+++ b/src/ui/window.c[m [36m@@ -109,7 +109,8 @@[m [mstatic const iMenuItem navMenuItems_[] = {[m { "---", 0, 0, NULL },[m { "Show Feed Entries", 0, 0, "!open url:about:feeds" },[m { "---", 0, 0, NULL },[m [31m- { "Toggle Sidebar", SDLK_l, KMOD_PRIMARY | KMOD_SHIFT, "sidebar.toggle" },[m [32m+[m[32m { "Toggle Left Sidebar", SDLK_l, KMOD_PRIMARY | KMOD_SHIFT, "sidebar.toggle" },[m [32m+[m[32m { "Toggle Right Sidebar", SDLK_p, KMOD_PRIMARY | KMOD_SHIFT, "sidebar2.toggle" },[m { "Zoom In", SDLK_EQUALS, KMOD_PRIMARY, "zoom.delta arg:10" },[m { "Zoom Out", SDLK_MINUS, KMOD_PRIMARY, "zoom.delta arg:-10" },[m { "Reset Zoom", SDLK_0, KMOD_PRIMARY, "zoom.set arg:100" },[m [36m@@ -144,7 +145,8 @@[m [mstatic const iMenuItem viewMenuItems_[] = {[m { "Show History", '3', KMOD_PRIMARY, "sidebar.mode arg:2 toggle:1" },[m { "Show Identities", '4', KMOD_PRIMARY, "sidebar.mode arg:3 toggle:1" },[m { "Show Page Outline", '5', KMOD_PRIMARY, "sidebar.mode arg:4 toggle:1" },[m [31m- { "Toggle Sidebar", SDLK_l, KMOD_PRIMARY | KMOD_SHIFT, "sidebar.toggle" },[m [32m+[m[32m { "Toggle Left Sidebar", SDLK_l, KMOD_PRIMARY | KMOD_SHIFT, "sidebar.toggle" },[m [32m+[m[32m { "Toggle Right Sidebar", SDLK_p, KMOD_PRIMARY | KMOD_SHIFT, "sidebar2.toggle" },[m { "---", 0, 0, NULL },[m { "Go Back", SDLK_LEFTBRACKET, KMOD_PRIMARY, "navigate.back" },[m { "Go Forward", SDLK_RIGHTBRACKET, KMOD_PRIMARY, "navigate.forward" },[m [36m@@ -459,10 +461,12 @@[m [mstatic void setupUserInterface_Window(iWindow *d) {[m addChild_Widget(buttons, iClob(newIcon_LabelWidget("\u2795", 0, 0, "tabs.new"))),[m "newtab");[m }[m [31m- /* Side bar. */ {[m [32m+[m[32m /* Side bars. */ {[m iWidget *content = findChild_Widget(d->root, "tabs.content");[m [31m- iSidebarWidget *sidebar = new_SidebarWidget();[m [31m- addChildPos_Widget(content, iClob(sidebar), front_WidgetAddPos);[m [32m+[m[32m iSidebarWidget *sidebar1 = new_SidebarWidget(left_SideBarSide);[m [32m+[m[32m addChildPos_Widget(content, iClob(sidebar1), front_WidgetAddPos);[m [32m+[m[32m iSidebarWidget *sidebar2 = new_SidebarWidget(right_SideBarSide);[m [32m+[m[32m addChildPos_Widget(content, iClob(sidebar2), back_WidgetAddPos);[m }[m /* Lookup results. */ {[m iLookupWidget *lookup = new_LookupWidget();[m
text/gemini; charset=utf-8
This content has been proxied by September (3851b).