diff options
Diffstat (limited to 'lib/libtqtrla')
-rw-r--r-- | lib/libtqtrla/src/tqtrla.cpp | 21 | ||||
-rw-r--r-- | lib/libtqtrla/src/tqtrla.h | 3 |
2 files changed, 22 insertions, 2 deletions
diff --git a/lib/libtqtrla/src/tqtrla.cpp b/lib/libtqtrla/src/tqtrla.cpp index bda048d..cf26012 100644 --- a/lib/libtqtrla/src/tqtrla.cpp +++ b/lib/libtqtrla/src/tqtrla.cpp @@ -47,7 +47,7 @@ namespace KParts RemoteInstrumentPart::RemoteInstrumentPart(TQObject *parent, const char *name) : Part( parent, name ), - m_socket(NULL), connToServerConnecting(false), connToServerState(-1), connToServerTimeoutTimer(NULL) + m_socket(NULL), connToServerConnecting(false), connToServerState(-1), connToServerTimeoutTimer(NULL), m_fixedSize(false) { d = new RemoteInstrumentPartPrivate; @@ -70,6 +70,18 @@ namespace KParts return false; } + void RemoteInstrumentPart::setUsingFixedSize(bool fixed) { + m_fixedSize = fixed; + if (!fixed) { + TQWidget* parentWidget = dynamic_cast<TQWidget*>(parent()); + if (parentWidget) { + parentWidget->setMinimumSize(0, 0); + parentWidget->setMaximumSize(TQWIDGETSIZE_MAX, TQWIDGETSIZE_MAX); + } + } + emit(usingFixedSizeChanged(fixed)); + } + TQPtrList<KAction> RemoteInstrumentPart::menuActionList() { return TQPtrList<KAction>(); } @@ -77,7 +89,12 @@ namespace KParts void RemoteInstrumentPart::resize(TQSize size) { TQWidget* parentWidget = dynamic_cast<TQWidget*>(parent()); if (parentWidget) { - parentWidget->setFixedSize(size); + if (m_fixedSize) { + parentWidget->setFixedSize(size); + } + else { + parentWidget->resize(size); + } } } diff --git a/lib/libtqtrla/src/tqtrla.h b/lib/libtqtrla/src/tqtrla.h index faca985..fcc1285 100644 --- a/lib/libtqtrla/src/tqtrla.h +++ b/lib/libtqtrla/src/tqtrla.h @@ -56,6 +56,7 @@ namespace KParts protected: TQStringList textForServerError(TQString shortError); TQ_ULONG maximumSocketDataChunkSize(); + void setUsingFixedSize(bool fixed); public: int connectToServer(TQString server); @@ -74,6 +75,7 @@ namespace KParts signals: void statusMessageSet(const TQString&); + void usingFixedSizeChanged(bool); protected: KURL m_url; @@ -85,6 +87,7 @@ namespace KParts bool connToServerConnecting; int connToServerState; TQTimer *connToServerTimeoutTimer; + bool m_fixedSize; private: RemoteInstrumentPartPrivate *d; |