diff options
Diffstat (limited to 'navit/graphics/qt5/QNavitQuick.cpp')
| -rw-r--r-- | navit/graphics/qt5/QNavitQuick.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/navit/graphics/qt5/QNavitQuick.cpp b/navit/graphics/qt5/QNavitQuick.cpp index 6981f3af7..dcd0d2aa5 100644 --- a/navit/graphics/qt5/QNavitQuick.cpp +++ b/navit/graphics/qt5/QNavitQuick.cpp @@ -16,7 +16,6 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -//Style with: clang-format -style=WebKit -i #include <glib.h> #ifdef HAVE_UNISTD_H @@ -91,7 +90,10 @@ void QNavitQuick::paint(QPainter* painter) { painter->drawPixmap(graphics_priv->scroll_x, graphics_priv->scroll_y, *graphics_priv->pixmap, boundingRect().x(), boundingRect().y(), boundingRect().width(), boundingRect().height()); - paintOverlays(painter, graphics_priv, &event); + /* disable on root pane disables ALL overlays (for drag of background) */ + if(!(graphics_priv->disable)) { + paintOverlays(painter, graphics_priv, &event); + } } void QNavitQuick::keyPressEvent(QKeyEvent* event) { @@ -171,11 +173,14 @@ void QNavitQuick::geometryChanged(const QRectF& newGeometry, const QRectF& oldGe return; } if (graphics_priv->pixmap != NULL) { - delete graphics_priv->pixmap; - graphics_priv->pixmap = NULL; + if((width() != graphics_priv->pixmap->width()) || (height() != graphics_priv->pixmap->height())) { + delete graphics_priv->pixmap; + graphics_priv->pixmap = NULL; + } + } + if (graphics_priv->pixmap == NULL) { + graphics_priv->pixmap = new QPixmap(width(), height()); } - - graphics_priv->pixmap = new QPixmap(width(), height()); painter = new QPainter(graphics_priv->pixmap); if (painter != NULL) { QBrush brush; |
