Fixes #1286 (Dialogue topic list clips with window frame)

The first problem was with the ScrollView skin, which had a full-sized client area. Since the scrollbar starts out visible, MyGUI expects the client area to be smaller to accomodate for the scrollbar width. As a result, the starting canvas size becomes bigger than the view size.
Another bug was with the MWList code: reducing the canvas size for the scrollbar is not needed, since MyGUI is already doing that, and attempting to do it manually interferes with the view offset.
actorid
scrawl 11 years ago
parent 518a32c19d
commit a35f7c73ae

@ -48,7 +48,7 @@ namespace MWGui
void MWList::redraw(bool scrollbarShown)
{
const int _scrollBarWidth = 24; // fetch this from skin?
const int _scrollBarWidth = 20; // fetch this from skin?
const int scrollBarWidth = scrollbarShown ? _scrollBarWidth : 0;
const int spacing = 3;
size_t scrollbarPosition = mScrollView->getScrollPosition();
@ -83,7 +83,7 @@ namespace MWGui
else
{
MyGUI::ImageBox* separator = mScrollView->createWidget<MyGUI::ImageBox>("MW_HLine",
MyGUI::IntCoord(2, mItemHeight, mScrollView->getWidth()-4, 18),
MyGUI::IntCoord(2, mItemHeight, mScrollView->getWidth() - scrollBarWidth - 4, 18),
MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch);
separator->setNeedMouseFocus(false);
@ -91,7 +91,7 @@ namespace MWGui
}
++i;
}
mScrollView->setCanvasSize(mClient->getSize().width + (_scrollBarWidth-scrollBarWidth), std::max(mItemHeight, mClient->getSize().height));
mScrollView->setCanvasSize(mClient->getSize().width, std::max(mItemHeight, mClient->getSize().height));
if (!scrollbarShown && mItemHeight > mClient->getSize().height)
redraw(true);

@ -3,12 +3,12 @@
<MyGUI type="Skin">
<Skin name="MW_ScrollView" size="516 516">
<Child type="Widget" skin="" offset="0 0 516 516" align="Stretch" name="Client"/>
<Child type="Widget" skin="" offset="0 0 502 516" align="Stretch" name="Client"/>
<Child type="MWScrollBar" skin="MW_VScroll" offset="498 3 14 509" align="Right Top VStretch" name="VScroll"/>
</Skin>
<Skin name="MW_ScrollViewH" size="516 516">
<Child type="Widget" skin="" offset="0 0 516 516" align="Stretch" name="Client"/>
<Child type="Widget" skin="" offset="0 0 516 502" align="Stretch" name="Client"/>
<Child type="MWScrollBar" skin="MW_HScroll" offset="3 498 509 14" align="Left Bottom HStretch" name="HScroll"/>
</Skin>

Loading…
Cancel
Save