aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Container.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/Container.cc')
-rw-r--r--src/FbTk/Container.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc
index 6270c6a..cea761b 100644
--- a/src/FbTk/Container.cc
+++ b/src/FbTk/Container.cc
@@ -324,7 +324,7 @@ void Container::repositionItems() {
324 // if we have a max total size, then we must also resize ourself 324 // if we have a max total size, then we must also resize ourself
325 // within that bound 325 // within that bound
326 Alignment align = alignment(); 326 Alignment align = alignment();
327 if (m_max_total_size && align != RELATIVE) { 327 if (m_max_total_size && (align != RELATIVE && align != RELATIVE_SMART)) {
328 total_width = (max_width_per_client + borderW) * num_items - borderW; 328 total_width = (max_width_per_client + borderW) * num_items - borderW;
329 if (total_width > m_max_total_size) { 329 if (total_width > m_max_total_size) {
330 total_width = m_max_total_size; 330 total_width = m_max_total_size;
@@ -379,7 +379,7 @@ void Container::repositionItems() {
379 unsigned int totalDemands = 0; 379 unsigned int totalDemands = 0;
380 std::vector<unsigned int> buttonDemands; 380 std::vector<unsigned int> buttonDemands;
381 381
382 if (align == RELATIVE || total_width == m_max_total_size) { 382 if (align == RELATIVE_SMART && total_width == m_max_total_size) {
383 buttonDemands.reserve(num_items); 383 buttonDemands.reserve(num_items);
384 for (it = begin(); it != it_end; ++it) { 384 for (it = begin(); it != it_end; ++it) {
385 buttonDemands.push_back((*it)->preferredWidth()); 385 buttonDemands.push_back((*it)->preferredWidth());
@@ -440,7 +440,7 @@ void Container::repositionItems() {
440 // rotate the x and y coords 440 // rotate the x and y coords
441 tmpx = next_x; 441 tmpx = next_x;
442 tmpy = -borderW; 442 tmpy = -borderW;
443 if (align == RELATIVE && totalDemands) { 443 if ((align == RELATIVE || align == RELATIVE_SMART) && totalDemands) {
444 tmpw = buttonDemands.at(i)*total_width/totalDemands + extra; 444 tmpw = buttonDemands.at(i)*total_width/totalDemands + extra;
445 } else { 445 } else {
446 tmpw = max_width_per_client + extra; 446 tmpw = max_width_per_client + extra;
@@ -469,6 +469,7 @@ unsigned int Container::maxWidthPerClient() const {
469 case LEFT: 469 case LEFT:
470 return m_max_size_per_client; 470 return m_max_size_per_client;
471 break; 471 break;
472 case RELATIVE_SMART:
472 case RELATIVE: 473 case RELATIVE:
473 if (size() == 0) 474 if (size() == 0)
474 return width(); 475 return width();