diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-28 13:35:13 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-28 13:35:13 +0300 |
commit | 4034349b4c0cabd5c1c02e4cc033752586e8a061 (patch) | |
tree | 150bfe4489cd51cd9e8eaf23a7e7d8f87889065f /src | |
parent | 879d6247ea6d83cad9b68a0eb4d8929c981c2ac3 (diff) |
SidebarWidget: Max limit for sidebar width
Must leave some space for the document.
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/sidebarwidget.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 8bf64b5c..0477adec 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -416,7 +416,7 @@ static void checkModeButtonLayout_SidebarWidget_(iSidebarWidget *d) { | |||
416 | 416 | ||
417 | void setWidth_SidebarWidget(iSidebarWidget *d, int width) { | 417 | void setWidth_SidebarWidget(iSidebarWidget *d, int width) { |
418 | iWidget *w = as_Widget(d); | 418 | iWidget *w = as_Widget(d); |
419 | width = iMax(30 * gap_UI, width); | 419 | width = iClamp(width, 30 * gap_UI, rootSize_Window(get_Window()).x - 50 * gap_UI); |
420 | d->width = width; | 420 | d->width = width; |
421 | if (isVisible_Widget(w)) { | 421 | if (isVisible_Widget(w)) { |
422 | w->rect.size.x = width; | 422 | w->rect.size.x = width; |