Ticket #3415: t3415_cleanup_dropdown_v1.patch
File t3415_cleanup_dropdown_v1.patch, 2.8 KB (added by , 9 years ago) |
---|
-
source/gui/CDropDown.cpp
489 491 490 492 CPos pos(m_CachedActualSize.left, m_CachedActualSize.top); 491 493 DrawText(selected, color, pos, bz+0.1f, cliparea); 492 494 } 493 495 494 bool* scrollbar = NULL;495 bool old;496 GUI<bool>::GetSettingPointer(this, "scrollbar", scrollbar);497 498 old = *scrollbar;499 500 496 if (m_Open) 501 { 502 if (m_HideScrollBar) 503 *scrollbar = false; 504 505 DrawList(m_ElementHighlight, "sprite_list", "sprite_selectarea", "textcolor"); 506 507 if (m_HideScrollBar) 508 *scrollbar = old; 509 } 497 DrawList(m_ElementHighlight, "sprite_list", "sprite_selectarea", "textcolor", m_HideScrollBar); 510 498 } 511 499 512 500 // When a dropdown list is opened, it needs to be visible above all the other 513 501 // controls on the page. The only way I can think of to do this is to increase 514 502 // its z value when opened, so that it's probably on top. -
source/gui/CList.cpp
292 293 GUI<int>::GetSetting(this, "selected", selected); 293 294 294 295 DrawList(selected, "sprite", "sprite_selectarea", "textcolor"); 295 296 } 296 297 297 void CList::DrawList(const int& selected, const CStr& _sprite, const CStr& _sprite_selected, const CStr& _textcolor )298 void CList::DrawList(const int& selected, const CStr& _sprite, const CStr& _sprite_selected, const CStr& _textcolor, const bool hideScrollbar) 298 299 { 299 300 float bz = GetBufferedZ(); 300 301 301 302 // First call draw on ScrollBarOwner 302 303 bool scrollbar; 303 304 GUI<bool>::GetSetting(this, "scrollbar", scrollbar); 305 scrollbar = scrollbar && !hideScrollbar; 304 306 305 307 if (scrollbar) 306 308 IGUIScrollBarOwner::Draw(); 307 309 308 310 if (GetGUI()) -
source/gui/CList.h
83 83 virtual bool HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile); 84 84 85 85 // Called every time the auto-scrolling should be checked. 86 86 void UpdateAutoScroll(); 87 87 88 // Extended drawing interface, this is so that classes built on the this one 89 // can use other sprite names. 90 virtual void DrawList(const int& selected, const CStr& _sprite, const CStr& _sprite_selected, const CStr& _textcolor); 88 // Extended drawing interface, this is so that classes built on this one can use other sprite names. 89 virtual void DrawList(const int& selected, const CStr& _sprite, const CStr& _sprite_selected, const CStr& _textcolor, const bool hideScrollbar = false); 91 90 92 91 // Get the area of the list. This is so that it can easily be changed, like in CDropDown 93 92 // where the area is not equal to m_CachedActualSize. 94 93 virtual CRect GetListRect() const { return m_CachedActualSize; } 95 94