More resizing

This commit is contained in:
James Grogan 2022-11-14 15:31:38 +00:00
parent 9ade0e2d4b
commit be94bf0185
11 changed files with 44 additions and 3 deletions

View file

@ -33,6 +33,8 @@ public:
virtual void clear() = 0;
virtual void onResize(unsigned width, unsigned height) = 0;
protected:
mt::Window* mWindow{nullptr};
};

View file

@ -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()

View file

@ -2,8 +2,8 @@
ResizeEvent::ResizeEvent(unsigned width, unsigned height)
: UiEvent(),
mWidth(),
mHeight()
mWidth(width),
mHeight(height)
{
mType = UiEvent::Type::Resize;
}

View file

@ -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];