diff --git a/NEWS.md b/NEWS.md index 49547360..4c547922 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ Red Panda C++ Version 0.13.1 - enhancement: suppoort localization info in project templates - change: template / project files use utf-8 encoding instead of ANSI - fix: .rc file shouldn't be syntax checked + - enhancement: auto save/restore size of the new project dialog Red Panda C++ Version 0.12.7 - change: make current build system follow FHS specifications diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index 3fc9d76a..96f8e104 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -13,7 +13,7 @@ isEmpty(PREFIX) { PREFIX = /usr/local } -APP_VERSION = beta.0.12.8 +APP_VERSION = beta.0.13.1 DEFINES += PREFIX=\\\"$${PREFIX}\\\" DEFINES += APP_NAME=\\\"$${APP_NAME}\\\" diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 769e6be2..8ab21ebb 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -5012,6 +5012,8 @@ void MainWindow::on_actionNew_Project_triggered() mProject->saveAll(); updateProjectView(); } + pSettings->ui().setNewProjectDialogWidth(dialog.width()); + pSettings->ui().setNewProjectDialogHeight(dialog.height()); } diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index d37e4d1f..f071be83 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -4605,6 +4605,26 @@ void Settings::UI::setSettingsDialogSplitterPos(int newSettingsDialogSplitterPos mSettingsDialogSplitterPos = newSettingsDialogSplitterPos; } +int Settings::UI::newProjectDialogWidth() const +{ + return mNewProjectDialogWidth; +} + +void Settings::UI::setNewProjectDialogWidth(int newNewProjectDialogWidth) +{ + mNewProjectDialogWidth = newNewProjectDialogWidth; +} + +int Settings::UI::newProjectDialogHeight() const +{ + return mNewProjectDialogHeight; +} + +void Settings::UI::setNewProjectDialogHeight(int newNewProjectDialogHeight) +{ + mNewProjectDialogHeight = newNewProjectDialogHeight; +} + int Settings::UI::settingsDialogHeight() const { return mSettingsDialogHeight; @@ -4865,6 +4885,8 @@ void Settings::UI::doSave() saveValue("settings_dialog_width", mSettingsDialogWidth); saveValue("settings_dialog_height", mSettingsDialogHeight); saveValue("settings_dialog_splitter", mSettingsDialogSplitterPos); + saveValue("new_project_dialog_width", mNewProjectDialogWidth); + saveValue("new_project_dialog_height", mNewProjectDialogHeight); } void Settings::UI::doLoad() @@ -4901,10 +4923,13 @@ void Settings::UI::doLoad() mShowProblem = boolValue("show_problem",true); //dialogs - mCPUDialogWidth = intValue("cpu_dialog_width",800*qApp->desktop()->width()/1920); - mCPUDialogHeight = intValue("cpu_dialog_height",600*qApp->desktop()->height()/1080); + mCPUDialogWidth = intValue("cpu_dialog_width",977*qApp->desktop()->width()/1920); + mCPUDialogHeight = intValue("cpu_dialog_height",622*qApp->desktop()->height()/1080); mCPUDialogSplitterPos = intValue("cpu_dialog_splitter",500*qApp->desktop()->width()/1920); - mSettingsDialogWidth = intValue("settings_dialog_width",800*qApp->desktop()->width()/1920); - mSettingsDialogHeight = intValue("settings_dialog_height",600*qApp->desktop()->height()/1080); + mSettingsDialogWidth = intValue("settings_dialog_width",977*qApp->desktop()->width()/1920); + mSettingsDialogHeight = intValue("settings_dialog_height",622*qApp->desktop()->height()/1080); mSettingsDialogSplitterPos = intValue("settings_dialog_splitter",300*qApp->desktop()->width()/1920); + + mNewProjectDialogWidth = intValue("new_project_dialog_width", 900*qApp->desktop()->width()/1920); + mNewProjectDialogHeight = intValue("new_project_dialog_height", 600*qApp->desktop()->height()/1080); } diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h index b38f2004..50d025f4 100644 --- a/RedPandaIDE/settings.h +++ b/RedPandaIDE/settings.h @@ -954,6 +954,12 @@ public: int settingsDialogSplitterPos() const; void setSettingsDialogSplitterPos(int newSettingsDialogSplitterPos); + int newProjectDialogWidth() const; + void setNewProjectDialogWidth(int newNewProjectDialogWidth); + + int newProjectDialogHeight() const; + void setNewProjectDialogHeight(int newNewProjectDialogHeight); + private: QByteArray mMainWindowState; QByteArray mMainWindowGeometry; @@ -993,6 +999,8 @@ public: int mSettingsDialogWidth; int mSettingsDialogHeight; int mSettingsDialogSplitterPos; + int mNewProjectDialogWidth; + int mNewProjectDialogHeight; protected: void doSave() override; diff --git a/RedPandaIDE/widgets/newprojectdialog.cpp b/RedPandaIDE/widgets/newprojectdialog.cpp index e63967cb..d6167b56 100644 --- a/RedPandaIDE/widgets/newprojectdialog.cpp +++ b/RedPandaIDE/widgets/newprojectdialog.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include NewProjectDialog::NewProjectDialog(QWidget *parent) : @@ -46,6 +47,7 @@ NewProjectDialog::NewProjectDialog(QWidget *parent) : } ui->txtProjectName->setText(projectName); ui->txtLocation->setText(location); + resize(pSettings->ui().newProjectDialogWidth(),pSettings->ui().newProjectDialogHeight()); connect(mTemplatesTabBar, &QTabBar::currentChanged, @@ -162,7 +164,7 @@ void NewProjectDialog::updateView() if (category == tabText) { QListWidgetItem * item; QString iconFilename = QDir(pSettings->dirs().templateDir()).absoluteFilePath(t->icon()); - QIcon icon(iconFilename); + QIcon icon=QIcon(iconFilename); if (icon.isNull()) { //todo : use an default icon item = new QListWidgetItem( @@ -173,6 +175,8 @@ void NewProjectDialog::updateView() icon, t->name()); } + item->setSizeHint(QSize(font().pixelSize()*6,font().pixelSize()*2+64)); + item->setTextAlignment(Qt::AlignHCenter | Qt::AlignTop); item->setData(Qt::ToolTipRole,t->name()); item->setData(Qt::UserRole,i); ui->lstTemplates->addItem(item); diff --git a/RedPandaIDE/widgets/newprojectdialog.ui b/RedPandaIDE/widgets/newprojectdialog.ui index cd6fef52..08ca286b 100644 --- a/RedPandaIDE/widgets/newprojectdialog.ui +++ b/RedPandaIDE/widgets/newprojectdialog.ui @@ -19,6 +19,12 @@ QListView::LeftToRight + + QListView::Adjust + + + 10 + QListView::IconMode @@ -36,6 +42,18 @@ + + 0 + + + 0 + + + 0 + + + 0 + @@ -47,6 +65,15 @@ + + Qt::AutoText + + + true + + + true + @@ -91,6 +118,18 @@ + + 0 + + + 0 + + + 0 + + + 0 + diff --git a/templates/1-WinApp.template b/templates/1-WinApp.template index 8b9dc2db..69b8b277 100644 --- a/templates/1-WinApp.template +++ b/templates/1-WinApp.template @@ -1,7 +1,7 @@ [Template] ver=2 Name=Windows Application -Name[zh_CN]=Windows应用程序 +Name[zh_CN]=Windows程序 Icon=Windows.ico Description=A standard Windows application Description[zh_CN]=基于Windows API开发的图形界面应用程序 diff --git a/templates/Single Dialog Application.template b/templates/Single Dialog Application.template index 5a622159..8e7ac030 100644 --- a/templates/Single Dialog Application.template +++ b/templates/Single Dialog Application.template @@ -1,7 +1,7 @@ [Template] ver=2 Name=Single Dialog Application -Name[zh_CN]=单对话框应用程序 +Name[zh_CN]=单对话框程序 Icon=Single Dialog Application.ico Description=An Appliction use a dialog as the main UI Description[zh_CN]=使用一个对话框作为主用户界面简单程序