diff options
Diffstat (limited to 'linden/indra/llui/llcombobox.cpp')
-rw-r--r-- | linden/indra/llui/llcombobox.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/linden/indra/llui/llcombobox.cpp b/linden/indra/llui/llcombobox.cpp index 983dd43..e00454a 100644 --- a/linden/indra/llui/llcombobox.cpp +++ b/linden/indra/llui/llcombobox.cpp | |||
@@ -55,8 +55,7 @@ S32 LLCOMBOBOX_WIDTH = 0; | |||
55 | 55 | ||
56 | LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString& label, | 56 | LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString& label, |
57 | void (*commit_callback)(LLUICtrl*,void*), | 57 | void (*commit_callback)(LLUICtrl*,void*), |
58 | void *callback_userdata, | 58 | void *callback_userdata |
59 | S32 list_width | ||
60 | ) | 59 | ) |
61 | : LLUICtrl(name, rect, TRUE, commit_callback, callback_userdata, | 60 | : LLUICtrl(name, rect, TRUE, commit_callback, callback_userdata, |
62 | FOLLOWS_LEFT | FOLLOWS_TOP), | 61 | FOLLOWS_LEFT | FOLLOWS_TOP), |
@@ -99,10 +98,7 @@ LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString | |||
99 | addChild(mButton); | 98 | addChild(mButton); |
100 | 99 | ||
101 | // Default size, will be set by arrange() call in button callback. | 100 | // Default size, will be set by arrange() call in button callback. |
102 | if (list_width == 0) | 101 | S32 list_width = mRect.getWidth() + SCROLLBAR_SIZE; |
103 | { | ||
104 | list_width = mRect.getWidth() + SCROLLBAR_SIZE; | ||
105 | } | ||
106 | r.setOriginAndSize(0, 16, list_width, 220); | 102 | r.setOriginAndSize(0, 16, list_width, 220); |
107 | 103 | ||
108 | // disallow multiple selection | 104 | // disallow multiple selection |
@@ -503,12 +499,14 @@ void LLComboBox::showList() | |||
503 | 499 | ||
504 | LLRect rect = mList->getRect(); | 500 | LLRect rect = mList->getRect(); |
505 | 501 | ||
502 | S32 list_width = mRect.getWidth() + SCROLLBAR_SIZE; | ||
503 | |||
506 | if (mListPosition == BELOW) | 504 | if (mListPosition == BELOW) |
507 | { | 505 | { |
508 | if (rect.getHeight() <= -root_view_local.mBottom) | 506 | if (rect.getHeight() <= -root_view_local.mBottom) |
509 | { | 507 | { |
510 | // Move rect so it hangs off the bottom of this view | 508 | // Move rect so it hangs off the bottom of this view |
511 | rect.setLeftTopAndSize(0, 0, rect.getWidth(), rect.getHeight() ); | 509 | rect.setLeftTopAndSize(0, 0, list_width, rect.getHeight() ); |
512 | } | 510 | } |
513 | else | 511 | else |
514 | { | 512 | { |
@@ -516,12 +514,12 @@ void LLComboBox::showList() | |||
516 | if (-root_view_local.mBottom > root_view_local.mTop - mRect.getHeight()) | 514 | if (-root_view_local.mBottom > root_view_local.mTop - mRect.getHeight()) |
517 | { | 515 | { |
518 | // Move rect so it hangs off the bottom of this view | 516 | // Move rect so it hangs off the bottom of this view |
519 | rect.setLeftTopAndSize(0, 0, rect.getWidth(), llmin(-root_view_local.mBottom, rect.getHeight())); | 517 | rect.setLeftTopAndSize(0, 0, list_width, llmin(-root_view_local.mBottom, rect.getHeight())); |
520 | } | 518 | } |
521 | else | 519 | else |
522 | { | 520 | { |
523 | // move rect so it stacks on top of this view (clipped to size of screen) | 521 | // move rect so it stacks on top of this view (clipped to size of screen) |
524 | rect.setOriginAndSize(0, mRect.getHeight(), rect.getWidth(), llmin(root_view_local.mTop - mRect.getHeight(), rect.getHeight())); | 522 | rect.setOriginAndSize(0, mRect.getHeight(), list_width, llmin(root_view_local.mTop - mRect.getHeight(), rect.getHeight())); |
525 | } | 523 | } |
526 | } | 524 | } |
527 | } | 525 | } |
@@ -530,7 +528,7 @@ void LLComboBox::showList() | |||
530 | if (rect.getHeight() <= root_view_local.mTop - mRect.getHeight()) | 528 | if (rect.getHeight() <= root_view_local.mTop - mRect.getHeight()) |
531 | { | 529 | { |
532 | // move rect so it stacks on top of this view (clipped to size of screen) | 530 | // move rect so it stacks on top of this view (clipped to size of screen) |
533 | rect.setOriginAndSize(0, mRect.getHeight(), rect.getWidth(), llmin(root_view_local.mTop - mRect.getHeight(), rect.getHeight())); | 531 | rect.setOriginAndSize(0, mRect.getHeight(), list_width, llmin(root_view_local.mTop - mRect.getHeight(), rect.getHeight())); |
534 | } | 532 | } |
535 | else | 533 | else |
536 | { | 534 | { |
@@ -538,12 +536,12 @@ void LLComboBox::showList() | |||
538 | if (-root_view_local.mBottom > root_view_local.mTop - mRect.getHeight()) | 536 | if (-root_view_local.mBottom > root_view_local.mTop - mRect.getHeight()) |
539 | { | 537 | { |
540 | // Move rect so it hangs off the bottom of this view | 538 | // Move rect so it hangs off the bottom of this view |
541 | rect.setLeftTopAndSize(0, 0, rect.getWidth(), llmin(-root_view_local.mBottom, rect.getHeight())); | 539 | rect.setLeftTopAndSize(0, 0, list_width, llmin(-root_view_local.mBottom, rect.getHeight())); |
542 | } | 540 | } |
543 | else | 541 | else |
544 | { | 542 | { |
545 | // move rect so it stacks on top of this view (clipped to size of screen) | 543 | // move rect so it stacks on top of this view (clipped to size of screen) |
546 | rect.setOriginAndSize(0, mRect.getHeight(), rect.getWidth(), llmin(root_view_local.mTop - mRect.getHeight(), rect.getHeight())); | 544 | rect.setOriginAndSize(0, mRect.getHeight(), list_width, llmin(root_view_local.mTop - mRect.getHeight(), rect.getHeight())); |
547 | } | 545 | } |
548 | } | 546 | } |
549 | 547 | ||