More resizing
This commit is contained in:
parent
9ade0e2d4b
commit
be94bf0185
11 changed files with 44 additions and 3 deletions
|
@ -33,6 +33,8 @@ public:
|
|||
|
||||
virtual void clear() = 0;
|
||||
|
||||
virtual void onResize(unsigned width, unsigned height) = 0;
|
||||
|
||||
protected:
|
||||
mt::Window* mWindow{nullptr};
|
||||
};
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#include "Screen.h"
|
||||
#include "Image.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace mt
|
||||
{
|
||||
|
||||
|
@ -41,6 +43,11 @@ void Window::setSize(unsigned width, unsigned height)
|
|||
{
|
||||
DrawingSurface::setSize(width, height);
|
||||
mWidget->setBounds(width, height);
|
||||
|
||||
if (mPlatformWindow)
|
||||
{
|
||||
mPlatformWindow->onResize(width, height);
|
||||
}
|
||||
}
|
||||
|
||||
void Window::clearPlatformWindow()
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
ResizeEvent::ResizeEvent(unsigned width, unsigned height)
|
||||
: UiEvent(),
|
||||
mWidth(),
|
||||
mHeight()
|
||||
mWidth(width),
|
||||
mHeight(height)
|
||||
{
|
||||
mType = UiEvent::Type::Resize;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <iostream>
|
||||
|
||||
HorizontalSpacer::HorizontalSpacer()
|
||||
: Widget(),
|
||||
|
@ -35,6 +36,7 @@ void HorizontalSpacer::addChildLayers(const PaintEvent* event)
|
|||
{
|
||||
height = mSize.mMaxHeight;
|
||||
}
|
||||
|
||||
for(std::size_t idx=0; idx<mChildren.size(); idx++)
|
||||
{
|
||||
auto& child = mChildren[idx];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue