- fix: reduce height of the message panel when dragging from right to bottom
This commit is contained in:
parent
9dacc9bbb9
commit
2f0a7a3d89
1
NEWS.md
1
NEWS.md
|
@ -8,6 +8,7 @@ Red Panda C++ Version 1.1.1
|
|||
- fix: when run/debug the executable, add current compiler set's bin folders to path
|
||||
- fix: when open in shell, add current compiler set's bin folders to path
|
||||
- fix: when debug the executable using gdb server, add current compiler set's bin folders to path
|
||||
- fix: reduce height of the message panel when dragging from right to bottom
|
||||
|
||||
Red Panda C++ Version 1.1.0
|
||||
- enhancement: when ctrl+mouse cursor hovered an identifier or header name, use underline to highlight it
|
||||
|
|
|
@ -6266,6 +6266,8 @@ static void setSplitterInDockLocation(QSplitter* splitter, const Qt::DockWidgetA
|
|||
}
|
||||
void MainWindow::setDockExplorerToArea(const Qt::DockWidgetArea &area)
|
||||
{
|
||||
if (area==Qt::DockWidgetArea::NoDockWidgetArea)
|
||||
return;
|
||||
setDockTitlebarLocation(ui->dockExplorer,area);
|
||||
setTabsInDockLocation(ui->tabExplorer,area);
|
||||
ui->dockMessages->setAllowedAreas(
|
||||
|
@ -6277,15 +6279,32 @@ void MainWindow::setDockExplorerToArea(const Qt::DockWidgetArea &area)
|
|||
|
||||
void MainWindow::setDockMessagesToArea(const Qt::DockWidgetArea &area)
|
||||
{
|
||||
setDockTitlebarLocation(ui->dockMessages,area);
|
||||
setTabsInDockLocation(ui->tabMessages,area);
|
||||
setSplitterInDockLocation(ui->splitterDebug,area);
|
||||
setSplitterInDockLocation(ui->splitterProblem,area);
|
||||
Qt::DockWidgetArea effectiveArea;
|
||||
if (area==Qt::DockWidgetArea::NoDockWidgetArea) {
|
||||
switch (mMessagesDockLocation) {
|
||||
case Qt::DockWidgetArea::BottomDockWidgetArea:
|
||||
case Qt::DockWidgetArea::TopDockWidgetArea:
|
||||
effectiveArea = Qt::DockWidgetArea::RightDockWidgetArea;
|
||||
break;
|
||||
default:
|
||||
if (dockWidgetArea(ui->dockExplorer)!=Qt::DockWidgetArea::BottomDockWidgetArea)
|
||||
effectiveArea = Qt::DockWidgetArea::BottomDockWidgetArea;
|
||||
else
|
||||
effectiveArea = Qt::DockWidgetArea::LeftDockWidgetArea;
|
||||
}
|
||||
} else {
|
||||
effectiveArea = area;
|
||||
mMessagesDockLocation = area;
|
||||
setDockTitlebarLocation(ui->dockMessages,effectiveArea);
|
||||
}
|
||||
setTabsInDockLocation(ui->tabMessages,effectiveArea);
|
||||
setSplitterInDockLocation(ui->splitterDebug,effectiveArea);
|
||||
setSplitterInDockLocation(ui->splitterProblem,effectiveArea);
|
||||
ui->dockExplorer->setAllowedAreas(
|
||||
(Qt::DockWidgetArea::LeftDockWidgetArea |
|
||||
Qt::DockWidgetArea::BottomDockWidgetArea |
|
||||
Qt::DockWidgetArea::RightDockWidgetArea)
|
||||
& ~area);
|
||||
& ~effectiveArea);
|
||||
QGridLayout* layout=(QGridLayout*)ui->panelProblemCase->layout();
|
||||
layout->removeWidget(ui->widgetProblemCaseInputCaption);
|
||||
layout->removeWidget(ui->widgetProblemCaseOutputCaption);
|
||||
|
@ -6296,7 +6315,7 @@ void MainWindow::setDockMessagesToArea(const Qt::DockWidgetArea &area)
|
|||
layout->removeWidget(ui->lblProblemCaseInput);
|
||||
layout->removeWidget(ui->lblProblemCaseOutput);
|
||||
layout->removeWidget(ui->lblProblemCaseExpected);
|
||||
switch(area) {
|
||||
switch(effectiveArea) {
|
||||
case Qt::DockWidgetArea::BottomDockWidgetArea:
|
||||
case Qt::DockWidgetArea::TopDockWidgetArea:
|
||||
layout->addWidget(ui->widgetProblemCaseInputCaption, 0, 0, 1, 1);
|
||||
|
@ -7934,3 +7953,4 @@ void MainWindow::on_chkIgnoreSpaces_stateChanged(int /*arg1*/)
|
|||
pSettings->executor().setIgnoreSpacesWhenValidatingCases(ui->chkIgnoreSpaces->isChecked());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -713,6 +713,7 @@ private:
|
|||
QElapsedTimer mParserTimer;
|
||||
QFileSystemWatcher mFileSystemWatcher;
|
||||
std::shared_ptr<Project> mProject;
|
||||
Qt::DockWidgetArea mMessagesDockLocation;
|
||||
|
||||
std::shared_ptr<CodeCompletionPopup> mCompletionPopup;
|
||||
std::shared_ptr<HeaderCompletionPopup> mHeaderCompletionPopup;
|
||||
|
|
|
@ -1747,6 +1747,12 @@
|
|||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="LineNumberTextEditor" name="txtProblemCaseOutput">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QPlainTextEdit::NoWrap</enum>
|
||||
</property>
|
||||
|
@ -1757,6 +1763,12 @@
|
|||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="LineNumberTextEditor" name="txtProblemCaseExpected">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QPlainTextEdit::NoWrap</enum>
|
||||
</property>
|
||||
|
@ -1884,6 +1896,12 @@
|
|||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="LineNumberTextEditor" name="txtProblemCaseInput">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QPlainTextEdit::NoWrap</enum>
|
||||
</property>
|
||||
|
|
Loading…
Reference in New Issue