Browse Source

Set geometry constraints on ImageAboutWindow, for auto-scaling

Signed-off-by: falkTX <falktx@falktx.com>
pull/309/head
falkTX 4 years ago
parent
commit
d708051751
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 15 additions and 4 deletions
  1. +15
    -4
      dgl/src/ImageBaseWidgets.cpp

+ 15
- 4
dgl/src/ImageBaseWidgets.cpp View File

@@ -29,8 +29,11 @@ ImageBaseAboutWindow<ImageType>::ImageBaseAboutWindow(Window& parentWindow, cons
setResizable(false);
setTitle("About");

if (image.isValid())
setSize(image.getSize());
if (image.isInvalid())
return;

setSize(image.getSize());
setGeometryConstraints(image.getWidth(), image.getHeight(), true, true);
}

template <class ImageType>
@@ -41,8 +44,11 @@ ImageBaseAboutWindow<ImageType>::ImageBaseAboutWindow(TopLevelWidget* const pare
setResizable(false);
setTitle("About");

if (image.isValid())
setSize(image.getSize());
if (image.isInvalid())
return;

setSize(image.getSize());
setGeometryConstraints(image.getWidth(), image.getHeight(), true, true);
}

template <class ImageType>
@@ -52,7 +58,12 @@ void ImageBaseAboutWindow<ImageType>::setImage(const ImageType& image)
return;

img = image;

if (image.isInvalid())
return;

setSize(image.getSize());
setGeometryConstraints(image.getWidth(), image.getHeight(), true, true);
}

template <class ImageType>


Loading…
Cancel
Save