- fix: when messages panel is docked at right, its width not correctly restored when restart.

This commit is contained in:
Roy Qu 2022-06-17 18:18:12 +08:00
parent 2f0a7a3d89
commit 5c2c2bead2
6 changed files with 20 additions and 19 deletions

View File

@ -9,6 +9,7 @@ Red Panda C++ Version 1.1.1
- 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
- fix: when messages panel is docked at right, its width not correctly restored when restart.
Red Panda C++ Version 1.1.0
- enhancement: when ctrl+mouse cursor hovered an identifier or header name, use underline to highlight it

View File

@ -108,8 +108,6 @@ private:
QMap<QString,PCompilerInfo> mInfos;
};
extern PCompilerInfoManager pCompilerInfoManager;
class ClangCompilerInfo: public CompilerInfo{
public:
ClangCompilerInfo();

View File

@ -6266,19 +6266,24 @@ 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(
(Qt::DockWidgetArea::LeftDockWidgetArea |
Qt::DockWidgetArea::BottomDockWidgetArea |
Qt::DockWidgetArea::RightDockWidgetArea)
& ~area);
if (area==Qt::DockWidgetArea::NoDockWidgetArea)
return;
setDockTitlebarLocation(ui->dockExplorer,area);
setTabsInDockLocation(ui->tabExplorer,area);
}
void MainWindow::setDockMessagesToArea(const Qt::DockWidgetArea &area)
{
ui->dockExplorer->setAllowedAreas(
(Qt::DockWidgetArea::LeftDockWidgetArea |
Qt::DockWidgetArea::BottomDockWidgetArea |
Qt::DockWidgetArea::RightDockWidgetArea)
& ~area);
Qt::DockWidgetArea effectiveArea;
if (area==Qt::DockWidgetArea::NoDockWidgetArea) {
switch (mMessagesDockLocation) {
@ -6300,11 +6305,6 @@ void MainWindow::setDockMessagesToArea(const Qt::DockWidgetArea &area)
setTabsInDockLocation(ui->tabMessages,effectiveArea);
setSplitterInDockLocation(ui->splitterDebug,effectiveArea);
setSplitterInDockLocation(ui->splitterProblem,effectiveArea);
ui->dockExplorer->setAllowedAreas(
(Qt::DockWidgetArea::LeftDockWidgetArea |
Qt::DockWidgetArea::BottomDockWidgetArea |
Qt::DockWidgetArea::RightDockWidgetArea)
& ~effectiveArea);
QGridLayout* layout=(QGridLayout*)ui->panelProblemCase->layout();
layout->removeWidget(ui->widgetProblemCaseInputCaption);
layout->removeWidget(ui->widgetProblemCaseOutputCaption);

View File

@ -463,7 +463,7 @@
<enum>QTabWidget::West</enum>
</property>
<property name="currentIndex">
<number>4</number>
<number>1</number>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
@ -858,7 +858,7 @@
<enum>QTabWidget::South</enum>
</property>
<property name="currentIndex">
<number>6</number>
<number>2</number>
</property>
<property name="iconSize">
<size>
@ -1003,16 +1003,16 @@
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>11</number>
<number>7</number>
</property>
<property name="topMargin">
<number>11</number>
<number>7</number>
</property>
<property name="rightMargin">
<number>11</number>
<number>7</number>
</property>
<property name="bottomMargin">
<number>11</number>
<number>7</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="lblEvaluate">
@ -1054,7 +1054,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="tabDebugConsole">
<attribute name="title">

View File

@ -2682,7 +2682,7 @@ void Settings::CompilerSets::saveSet(int index)
savePath("profiler", pSet->profiler());
mSettings->mSettings.remove("Options");
foreach(const PCompilerOption& option, pCompilerInfoManager->getCompilerOptions(pSet->compilerType())) {
foreach(const PCompilerOption& option, CompilerInfoManager::getInstance()->getCompilerOptions(pSet->compilerType())) {
mSettings->mSettings.remove(option->key);
}
// Save option string

View File

@ -137,6 +137,8 @@ QSize ShrinkableTabWidget::minimumSizeHint() const
void ShrinkableTabWidget::resizeEvent(QResizeEvent *event)
{
QTabWidget::resizeEvent(event);
if (!isVisible())
return;
if (!isShrinked())
setBeforeShrinkSize(event->size());
}