diff options
Diffstat (limited to 'clients/tde/src/app/views/instrumentview.cpp')
-rw-r--r-- | clients/tde/src/app/views/instrumentview.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/clients/tde/src/app/views/instrumentview.cpp b/clients/tde/src/app/views/instrumentview.cpp index b2fd5db..4cad117 100644 --- a/clients/tde/src/app/views/instrumentview.cpp +++ b/clients/tde/src/app/views/instrumentview.cpp @@ -15,6 +15,7 @@ InstrumentView::InstrumentView(const TQString &library, TQWidget *parentWidget, : KMdiChildView(parentWidget, name, f) , m_libraryName(library) , m_instrumentPart( 0 ) + , m_fixedSize( false ) , m_canary( NULL ) { init(); @@ -24,6 +25,7 @@ InstrumentView::InstrumentView(const TQString &library, const TQString &caption, : KMdiChildView(caption, parentWidget, name, f) , m_libraryName(library) , m_instrumentPart( 0 ) + , m_fixedSize( false ) , m_canary( NULL ) { init(); @@ -45,18 +47,39 @@ void InstrumentView::init() { else { m_instrumentPart = (InstrumentPart *)factory->create(TQT_TQOBJECT(this), "part", "KParts::RemoteInstrumentPart"); connect(m_instrumentPart, SIGNAL(statusMessageSet(const TQString&)), this, SLOT(setStatusMessage(const TQString&))); + connect(m_instrumentPart, SIGNAL(usingFixedSizeChanged(bool)), this, SLOT(setUsingFixedSize(bool))); } } -void InstrumentView::resizeEvent(TQResizeEvent *) { +void InstrumentView::setChildSizeToHint() { if (m_instrumentPart) { TQWidget *childPartWidget = m_instrumentPart->widget(); if (childPartWidget) { - setFixedSize(childPartWidget->sizeHint()); + if (m_fixedSize) { + setFixedSize(childPartWidget->sizeHint()); + } + else { + TQSize childSizeHint = childPartWidget->sizeHint(); + setMinimumSize(childSizeHint.width(), childSizeHint.height()); + childPartWidget->resize(size()); + } } } } +void InstrumentView::setUsingFixedSize(bool fixed) { + m_fixedSize = fixed; + if (!fixed) { + setMinimumSize(0, 0); + setMaximumSize(TQWIDGETSIZE_MAX, TQWIDGETSIZE_MAX); + } + setChildSizeToHint(); +} + +void InstrumentView::resizeEvent(TQResizeEvent *) { + setChildSizeToHint(); +} + TQPtrList<KAction> InstrumentView::menuActionList() { if (m_instrumentPart) { return m_instrumentPart->menuActionList(); |