diff --git a/src/QDetachTabWidget.cpp b/src/QDetachTabWidget.cpp index ae0ab8b..9e03553 100644 --- a/src/QDetachTabWidget.cpp +++ b/src/QDetachTabWidget.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include QDetachTabWidget::QDetachTabWidget(QWidget* parent) : QTabWidget(parent) { @@ -42,7 +43,7 @@ QWidget* QDetachTabWidget::tabWidget (int tabIndex) const { return _tabInfo[tabIndex]._widget; } -void QDetachTabWidget::detachTab (int tabIndex) { +void QDetachTabWidget::detachTab (int tabIndex, bool minimized) { // Get the tab the user selected. QWidget* w = widget(tabIndex); @@ -77,7 +78,12 @@ void QDetachTabWidget::detachTab (int tabIndex) { w->setWindowFlags(flags); w->setWindowTitle(tabinfo._title); w->setWindowIcon(windowIcon()); - w->showMinimized(); + + if (minimized) { + w->showMinimized(); + }else{ + w->showNormal(); + } // Connect the placeholder's 'reattach' signal to the slot. QObject::connect(placeholder, &QDetachTabWidgetPlaceholder::reattach, this, &QDetachTabWidget::handleTabClosedRequested); @@ -153,16 +159,19 @@ void QDetachTabWidget::handleShowContextMenu (const QPoint& point) { // Create the menu. QMenu menu("Window Action", this); - QAction* detachAction = menu.addAction(tr("Detach")); - QAction* reattachAction = menu.addAction(tr("Reattach")); + QAction* detachAction = menu.addAction(tr("Detach")); + QAction* detachMinimizedAction = menu.addAction(tr("Detach Minimized")); + QAction* reattachAction = menu.addAction(tr("Reattach")); // Enable/disable depending if it was already detached. QWidget* w = widget(tabIndex); if (w->objectName() == "QDetachTabWidgetPlaceholder") { detachAction->setEnabled(false); + detachMinimizedAction->setEnabled(false); reattachAction->setEnabled(true); }else{ detachAction->setEnabled(true); + detachMinimizedAction->setEnabled(true); reattachAction->setEnabled(false); } @@ -175,7 +184,19 @@ void QDetachTabWidget::handleShowContextMenu (const QPoint& point) { if (action == detachAction) { // Detach the tab. - detachTab(tabIndex); + detachTab(tabIndex, false); + + // Set the tabwidget to the placeholder tab. + setCurrentIndex(tabIndex); + } + + // + // Handle detaching a tab. + // + if (action == detachMinimizedAction) { + + // Detach the tab. + detachTab(tabIndex, true); // Set the tabwidget to the placeholder tab. setCurrentIndex(tabIndex); diff --git a/src/QDetachTabWidget.h b/src/QDetachTabWidget.h index c866b09..e9f8674 100644 --- a/src/QDetachTabWidget.h +++ b/src/QDetachTabWidget.h @@ -25,7 +25,7 @@ class QDetachTabWidget : public QTabWidget { QWidget* tabWidget (int tabIndex) const; public slots: - void detachTab (int tabIndex); + void detachTab (int tabIndex, bool minimized=false); void reattachTab (int tabIndex); signals: diff --git a/src/SeerConsoleWidget.cpp b/src/SeerConsoleWidget.cpp index bfe9d80..a0fa6f3 100644 --- a/src/SeerConsoleWidget.cpp +++ b/src/SeerConsoleWidget.cpp @@ -34,7 +34,6 @@ SeerConsoleWidget::SeerConsoleWidget (QWidget* parent) : QWidget(parent) { // Setup the widgets setWindowIcon(QIcon(":/seer/resources/seergdb_64x64.png")); setWindowTitle("Seer Console"); - setWindowFlags(Qt::Window | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); textEdit->setReadOnly(true); textEdit->setTextInteractionFlags(textEdit->textInteractionFlags() | Qt::TextSelectableByKeyboard); // Show cursor diff --git a/src/SeerEditorWidgetSourceAreas.cpp b/src/SeerEditorWidgetSourceAreas.cpp index 5bfcfb0..6891633 100644 --- a/src/SeerEditorWidgetSourceAreas.cpp +++ b/src/SeerEditorWidgetSourceAreas.cpp @@ -1767,7 +1767,7 @@ void SeerEditorWidgetSourceArea::handleText (const QString& text) { } if (id_text.toInt() == _selectedBreakpointId && _selectedBreakpointPosition != QPoint()) { - qDebug() << "XXX - Error displaying breakpoint info as a ToolTip"; + qDebug() << "Error displaying breakpoint info as a ToolTip"; } return; diff --git a/src/SeerGdbWidget.cpp b/src/SeerGdbWidget.cpp index f834a03..6173d42 100644 --- a/src/SeerGdbWidget.cpp +++ b/src/SeerGdbWidget.cpp @@ -2859,20 +2859,16 @@ void SeerGdbWidget::handleConsoleModeChanged () { } if (_consoleMode == "detached") { - logsTabWidget->detachTab(_consoleIndex); - _consoleWidget->setWindowState(Qt::WindowNoState); + logsTabWidget->detachTab(_consoleIndex, false); _consoleWidget->raise(); _consoleWidget->resetSize(); }else if (_consoleMode == "detachedminimized") { - logsTabWidget->detachTab(_consoleIndex); - _consoleWidget->setWindowState(Qt::WindowMinimized); + logsTabWidget->detachTab(_consoleIndex, true); _consoleWidget->resetSize(); }else if (_consoleMode == "attached") { logsTabWidget->reattachTab(_consoleIndex); - _consoleWidget->setWindowState(Qt::WindowNoState); }else{ logsTabWidget->reattachTab(_consoleIndex); - _consoleWidget->setWindowState(Qt::WindowNoState); } } diff --git a/src/SeerLogWidget.cpp b/src/SeerLogWidget.cpp index 31edc76..db354fe 100644 --- a/src/SeerLogWidget.cpp +++ b/src/SeerLogWidget.cpp @@ -54,13 +54,6 @@ void SeerLogWidget::setLogEnabled (bool flag) { void SeerLogWidget::moveToEnd () { - /* XXX - // Move to the end and then to the beginning of that line. - QTextCursor cursor = textEdit->textCursor(); - textEdit->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor); - textEdit->moveCursor(QTextCursor::StartOfBlock, QTextCursor::MoveAnchor); - */ - textEdit->verticalScrollBar()->setValue(textEdit->verticalScrollBar()->maximum()); } diff --git a/src/SeerStackFramesBrowserWidget.ui b/src/SeerStackFramesBrowserWidget.ui index cecc4ed..e5f45be 100644 --- a/src/SeerStackFramesBrowserWidget.ui +++ b/src/SeerStackFramesBrowserWidget.ui @@ -6,8 +6,8 @@ 0 0 - 794 - 528 + 600 + 700