scroll when focusing widgets

This commit is contained in:
Eduardo Bart
2012-06-01 21:38:26 -03:00
parent ba01909088
commit 59a80ffaf9
14 changed files with 38 additions and 21 deletions

View File

@@ -140,7 +140,7 @@ bool UIAnchorLayout::updateWidget(const UIWidgetPtr& widget, UIAnchorGroup& anch
// determine hooked widget edge point
Rect hookedWidgetRect = hookedWidget->getRect();
if(hookedWidget == parentWidget)
hookedWidgetRect = parentWidget->getClippingRect();
hookedWidgetRect = parentWidget->getPaddingRect();
int point = 0;
switch(anchor.getHookedEdge()) {

View File

@@ -79,7 +79,7 @@ bool UIGridLayout::internalUpdate()
UIWidgetList widgets = parentWidget->getChildren();
Rect clippingRect = parentWidget->getClippingRect();
Rect clippingRect = parentWidget->getPaddingRect();
Point topLeft = clippingRect.topLeft();
int numColumns = m_numColumns;

View File

@@ -46,7 +46,7 @@ bool UIHorizontalLayout::internalUpdate()
std::reverse(widgets.begin(), widgets.end());
bool changed = false;
Rect clippingRect = parentWidget->getClippingRect();
Rect clippingRect = parentWidget->getPaddingRect();
Point pos = (m_alignRight) ? clippingRect.topRight() : clippingRect.topLeft();
int preferredWidth = 0;
int gap;

View File

@@ -47,7 +47,7 @@ bool UIVerticalLayout::internalUpdate()
if(m_alignBottom)
std::reverse(widgets.begin(), widgets.end());
Rect clippingRect = parentWidget->getClippingRect();
Rect clippingRect = parentWidget->getPaddingRect();
Point pos = (m_alignBottom) ? clippingRect.bottomLeft() : clippingRect.topLeft();
int preferredHeight = 0;
int gap;

View File

@@ -61,7 +61,7 @@ void UIWidget::draw(const Rect& visibleRect, bool foregroundPane)
if(m_children.size() > 0) {
if(m_clipping)
g_painter->setClipRect(visibleRect.intersection(getClippingRect()));
g_painter->setClipRect(visibleRect.intersection(getPaddingRect()));
drawChildren(visibleRect, foregroundPane);
}
@@ -683,7 +683,7 @@ void UIWidget::bindRectToParent()
Rect boundRect = m_rect;
UIWidgetPtr parent = getParent();
if(parent) {
Rect parentRect = parent->getClippingRect();
Rect parentRect = parent->getPaddingRect();
boundRect.bind(parentRect);
}
@@ -980,7 +980,7 @@ int UIWidget::getChildIndex(const UIWidgetPtr& child)
return -1;
}
Rect UIWidget::getClippingRect()
Rect UIWidget::getPaddingRect()
{
Rect rect = m_rect;
rect.expand(-m_padding.top, -m_padding.right, -m_padding.bottom, -m_padding.left);
@@ -1007,7 +1007,7 @@ Rect UIWidget::getChildrenRect()
childrenRect = childrenRect.united(marginRect);
}
Rect myClippingRect = getClippingRect();
Rect myClippingRect = getPaddingRect();
if(!childrenRect.isValid())
childrenRect = myClippingRect;
else {

View File

@@ -137,7 +137,7 @@ public:
bool isChildLocked(const UIWidgetPtr& child);
bool hasChild(const UIWidgetPtr& child);
int getChildIndex(const UIWidgetPtr& child);
Rect getClippingRect();
Rect getPaddingRect();
Rect getMarginRect();
Rect getChildrenRect();
UIAnchorLayoutPtr getAnchoredLayout();
@@ -243,7 +243,7 @@ public:
bool isDestroyed() { return m_destroyed; }
bool hasChildren() { return m_children.size() > 0; }
bool containsChildPoint(const Point& point) { return getClippingRect().contains(point); }
bool containsChildPoint(const Point& point) { return getPaddingRect().contains(point); }
bool containsPoint(const Point& point) { return m_rect.contains(point); }
std::string getId() { return m_id; }