diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-04-28 21:23:07 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-04-28 21:23:07 +0200 |
commit | 2a3189f3e9cad900f6d25075931cdb5d8e14bed3 (patch) | |
tree | 83f52f8f45b1cbf638d8c1696057d5fbc6fbaf7e | |
parent | 0a879beae4e398e4d777cde842e081c8438506db (diff) |
Some more rendering optimisations and a win32 resize fix.
-rw-r--r-- | plugingui/window.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/plugingui/window.cc b/plugingui/window.cc index 2426d9e..580a3c6 100644 --- a/plugingui/window.cc +++ b/plugingui/window.cc @@ -32,6 +32,7 @@ #include <stdlib.h> #include <string.h> +#include <hugin.hpp> #ifdef X11 #include "nativewindow_x11.h" @@ -44,7 +45,7 @@ GUI::Window *gwindow = NULL; GUI::Window::Window(GlobalContext *gctx) - : Widget(NULL), wpixbuf(1000, 1000), back(":bg.png"), logo(":logo.png") + : Widget(NULL), wpixbuf(100, 100), back(":bg.png"), logo(":logo.png") { gwindow = this; @@ -80,6 +81,8 @@ void GUI::Window::setCaption(std::string caption) void GUI::Window::repaintEvent(GUI::RepaintEvent *e) { + if(!visible()) return; + Painter p(this); p.drawImageStretched(0,0, &back, width(), height()); p.drawImage(width() - logo.width(), @@ -89,6 +92,14 @@ void GUI::Window::repaintEvent(GUI::RepaintEvent *e) void GUI::Window::resize(int width, int height) { if(width < 1 || height < 1) return; + +#ifdef WIN32 + // Fix to force buffer size reallocation + // FIXME: This should've been done indirectly through a WM_SIZE message in the + // EventHandler... + resized(width, height); +#endif + native->resize(width, height); Widget::resize(width, height); } @@ -161,6 +172,8 @@ void GUI::Window::updateBuffer() void GUI::Window::resized(size_t w, size_t h) { + if(_width == w && _height == h) return; + _width = w; _height = h; wpixbuf.realloc(w, h); |