From 5792fe4e6622c1ab8ecb4db96c852996e80c9dcc Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Wed, 9 Nov 2022 13:22:41 -0500 Subject: [PATCH] 2022-11-09 Fred Gleason * Fixed a bug in the 'Edit Image' dialog in rdadmin(1) that could cause the image display to be incorrectly scaled/positioned. Signed-off-by: Fred Gleason --- ChangeLog | 3 +++ rdadmin/edit_image.cpp | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a9d3832..0b3fb209 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23638,3 +23638,6 @@ 2022-11-09 Fred Gleason * Added an image format check to rddbmgr(8) to prevent it from attempting to generate thumbnail images from non-JPEG/PNG images. +2022-11-09 Fred Gleason + * Fixed a bug in the 'Edit Image' dialog in rdadmin(1) that could + cause the image display to be incorrectly scaled/positioned. diff --git a/rdadmin/edit_image.cpp b/rdadmin/edit_image.cpp index e868c1f6..7c670d0b 100644 --- a/rdadmin/edit_image.cpp +++ b/rdadmin/edit_image.cpp @@ -2,7 +2,7 @@ // // View a pixmap image and modify its metadata // -// (C) Copyright 2020-2021 Fred Gleason +// (C) Copyright 2020-2022 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -35,6 +35,7 @@ EditImage::EditImage(QWidget *parent) setMinimumHeight(150); c_image_label=new QLabel(this); + c_image_label->setScaledContents(true); c_description_label=new QLabel(tr("Description")+":",this); c_description_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); @@ -167,7 +168,7 @@ void EditImage::resizeEvent(QResizeEvent *e) int h=size().height(); c_image_label-> - setGeometry(10,2,w-EDIT_IMAGE_WIDTH_OFFSET,h-EDIT_IMAGE_HEIGHT_OFFSET); + setGeometry(10,2,w-EDIT_IMAGE_WIDTH_OFFSET,h-EDIT_IMAGE_HEIGHT_OFFSET-20); c_image_label->setPixmap(QPixmap::fromImage(c_image. scaled(c_image_label->size(),Qt::KeepAspectRatio)));