示例#1
0
void MythUIType::SetPosition(const MythPoint &pos)
{
    if (m_Area.topLeft() == pos)
        return;

    m_DirtyRegion = QRegion(m_Area.toQRect());

    m_Area.moveTopLeft(pos);

    RecalculateArea(false);

    SetRedraw();
}
示例#2
0
void MythUIType::SetSize(const QSize &size)
{
    if (size == m_Area.size())
        return;

    m_DirtyRegion = QRegion(m_Area.toQRect());

    m_Area.setSize(size);
    RecalculateArea();

    if (m_Parent)
        m_Parent->ExpandArea(m_Area.toQRect());

    SetRedraw();
}
示例#3
0
void MythUIType::SetArea(const MythRect &rect)
{
    if (rect == m_Area)
        return;

    m_DirtyRegion = QRegion(m_Area.toQRect());

    m_Area = rect;
    RecalculateArea();

    if (m_Parent)
        m_Parent->ExpandArea(m_Area.toQRect());

    SetRedraw();
}
示例#4
0
void MythUIType::SetPosition(const MythPoint &point)
{
    MythPoint  pos(point);

    if (m_Parent)
        pos.CalculatePoint(m_Parent->GetArea());
    else
        pos.CalculatePoint(GetMythMainWindow()->GetUIScreenRect());

    if (m_Area.topLeft() == pos)
        return;

    m_DirtyRegion = QRegion(m_Area.toQRect());

    m_Area.moveTopLeft(pos);

    RecalculateArea(false);

    SetRedraw();
}
示例#5
0
/**
 *  \brief Copy this widgets state from another.
 */
void MythUIType::CopyFrom(MythUIType *base)
{
    m_Visible = base->m_Visible;
    m_Enabled = base->m_Enabled;
    m_CanHaveFocus = base->m_CanHaveFocus;
    m_focusOrder = base->m_focusOrder;

    m_Area = base->m_Area;
    RecalculateArea();

    m_EnableInitiator = base->m_EnableInitiator;
    m_MinSize = base->m_MinSize;
    m_Vanish = base->m_Vanish;
    m_Vanished = false;
    m_Alpha = base->m_Alpha;
    m_AlphaChangeMode = base->m_AlphaChangeMode;
    m_AlphaChange = base->m_AlphaChange;
    m_AlphaMin = base->m_AlphaMin;
    m_AlphaMax = base->m_AlphaMax;

    m_Moving = base->m_Moving;
    m_XYDestination = base->m_XYDestination;
    m_XYSpeed = base->m_XYSpeed;
    m_deferload = base->m_deferload;

    QList<MythUIType *>::Iterator it;

    for (it = base->m_ChildrenList.begin(); it != base->m_ChildrenList.end();
         ++it)
    {
        MythUIType *child = GetChild((*it)->objectName());

        if (child)
            child->CopyFrom(*it);
        else
            (*it)->CreateCopy(this);
    }

    SetMinArea(base->m_MinArea);
}
示例#6
0
void MythUIType::SetArea(const MythRect &rect)
{
    if (rect == m_Area)
        return;

    m_DirtyRegion = QRegion(m_Area.toQRect());

    m_Area = rect;

    if (m_Area.width() > m_NormalSize.width())
        m_NormalSize.setWidth(m_Area.width());

    if (m_Area.height() > m_NormalSize.height())
        m_NormalSize.setHeight(m_Area.height());

    RecalculateArea();

    if (m_Parent)
        m_Parent->ExpandArea(m_Area.toQRect());

    SetRedraw();
}