Commit ac394edb authored by Erwan Tulou's avatar Erwan Tulou

skins2: add a function that differentiates dependent and independent layouts.

In skins2, a window can have multiple layouts with two different goals.

First goal, layouts have the same original size and only differ in the
presentation (different color, ...). If the active layout gets resized,
the user expects the related inactive layouts with the same size to
automatically resize, should they become active.

Second goal, layouts are different in size, e.g a reduced layout and an
expanded layout. In this case, resizing the active layout doesn't mean
resizing the other inactive layouts, since they were not meant to be
similar in size in the first place.

This patch creates a function that will be used to differentiate these
two different use of layouts.
parent c42f8e52
......@@ -37,7 +37,9 @@
GenericLayout::GenericLayout( intf_thread_t *pIntf, int width, int height,
int minWidth, int maxWidth, int minHeight,
int maxHeight ):
SkinObject( pIntf ), m_pWindow( NULL ), m_rect( 0, 0, width, height ),
SkinObject( pIntf ), m_pWindow( NULL ),
m_original_width( width ), m_original_height( height ),
m_rect( 0, 0, width, height ),
m_minWidth( minWidth ), m_maxWidth( maxWidth ),
m_minHeight( minHeight ), m_maxHeight( maxHeight ), m_pVideoCtrlSet(),
m_visible( false ), m_pVarActive( NULL )
......
......@@ -107,6 +107,14 @@ public:
/// Resize the layout
virtual void resize( int width, int height );
/// determine whether layouts should be kept the same size
virtual bool isTightlyCoupledWith( const GenericLayout& otherLayout ) const
{
return m_original_width == otherLayout.m_original_width
&&
m_original_height == otherLayout.m_original_height;
}
/**
* Add a control in the layout at the given position, and
* the optional given layer
......@@ -147,6 +155,9 @@ public:
private:
/// Parent window of the layout
TopWindow *m_pWindow;
/// Layout original size
const int m_original_width;
const int m_original_height;
/// Layout size
SkinsRect m_rect;
int m_minWidth, m_maxWidth;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment