diff options
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r-- | src/ui/sidebarwidget.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index ca4404d5..0c17995e 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -564,8 +564,11 @@ static void checkModeButtonLayout_SidebarWidget_(iSidebarWidget *d) { | |||
564 | } | 564 | } |
565 | 565 | ||
566 | void setWidth_SidebarWidget(iSidebarWidget *d, int width) { | 566 | void setWidth_SidebarWidget(iSidebarWidget *d, int width) { |
567 | iWidget *w = as_Widget(d); | 567 | iWidget * w = as_Widget(d); |
568 | width = iClamp(width, 30 * gap_UI, rootSize_Window(get_Window()).x - 50 * gap_UI); | 568 | /* Even less space if the other sidebar is visible, too. */ |
569 | const int otherWidth = | ||
570 | width_Widget(findWidget_App(d->side == left_SideBarSide ? "sidebar2" : "sidebar")); | ||
571 | width = iClamp(width, 30 * gap_UI, rootSize_Window(get_Window()).x - 50 * gap_UI - otherWidth); | ||
569 | d->width = width; | 572 | d->width = width; |
570 | if (isVisible_Widget(w)) { | 573 | if (isVisible_Widget(w)) { |
571 | w->rect.size.x = width; | 574 | w->rect.size.x = width; |