[Kstars-devel] KDE/kdeedu/kstars/kstars
Jason Harris
kstars at 30doradus.org
Wed Jan 24 06:16:43 CET 2007
SVN commit 626662 by harris:
Fixing image viewer. The window is now properly sized to match its
contents.
TODO: find a non-kludgy way to disable window resizing.
CCMAIL: kstars-devel at kde.org
M +5 -3 imageviewer.cpp
M +1 -1 imageviewer.h
--- trunk/KDE/kdeedu/kstars/kstars/imageviewer.cpp #626661:626662
@@ -39,9 +39,11 @@
#include <kapplication.h>
-ImageLabel::ImageLabel( QWidget *parent ) : QLabel( parent )
+ImageLabel::ImageLabel( QWidget *parent ) : QFrame( parent )
{
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
+ setFrameStyle( QFrame::StyledPanel | QFrame::Plain );
+ setLineWidth( 2 );
}
ImageLabel::~ImageLabel()
@@ -92,7 +94,6 @@
vlay->setMargin( 0 );
vlay->addWidget( View );
vlay->addWidget( Caption );
- vlay->addStretch();
connect( this, SIGNAL( user1Clicked() ), this, SLOT ( saveFileToDisc() ) );
@@ -203,7 +204,8 @@
//If the caption is wider than the image, set the window size
//to fit the caption
if ( Caption->width() > w ) w = Caption->width();
- View->setFixedSize( w, image.height() );
+ MainFrame->setFixedSize( w, image.height() + Caption->height() );
+
update();
}
--- trunk/KDE/kdeedu/kstars/kstars/imageviewer.h #626661:626662
@@ -32,7 +32,7 @@
class KUrl;
class KStars;
-class ImageLabel : public QLabel {
+class ImageLabel : public QFrame {
Q_OBJECT
public:
ImageLabel( QWidget *parent );
More information about the Kstars-devel
mailing list