From 7aa27a231cafd0f2a7fd38b53d17153a1c89e7f6 Mon Sep 17 00:00:00 2001 From: casey Date: Mon, 4 Jul 2016 22:48:06 -0700 Subject: [PATCH] Allow category list width to grow dynamically up to 40 columns. --- src/musikbox/app/layout/BrowseLayout.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/musikbox/app/layout/BrowseLayout.cpp b/src/musikbox/app/layout/BrowseLayout.cpp index 3f8b556dd..835fb02c2 100755 --- a/src/musikbox/app/layout/BrowseLayout.cpp +++ b/src/musikbox/app/layout/BrowseLayout.cpp @@ -44,8 +44,8 @@ using namespace musik::core::library::constants; -#define CATEGORY_WIDTH 25 #define DEFAULT_CATEGORY constants::Track::ARTIST +static size_t MAX_CATEGORY_WIDTH = 40; using namespace musik::core; using namespace musik::core::audio; @@ -78,10 +78,12 @@ void BrowseLayout::Layout() { this->MoveAndResize(x, y, cx, cy); - this->categoryList->MoveAndResize(x, y, CATEGORY_WIDTH, cy); + size_t categoryWidth = std::min(MAX_CATEGORY_WIDTH, cx / 4); + + this->categoryList->MoveAndResize(x, y, categoryWidth, cy); this->trackList->MoveAndResize( - x + CATEGORY_WIDTH, y, cx - CATEGORY_WIDTH, cy); + x + categoryWidth, y, cx - categoryWidth, cy); this->categoryList->SetFocusOrder(0); this->trackList->SetFocusOrder(1);