From 6c413fe8f99bb367e45fcfd3f23ba13310fd43a0 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 23 Dec 2021 09:11:58 +0800 Subject: [PATCH] - enhancement: icons in all dialogs auto change size with fonts - enhancement: save/restore sizes of CPU dialog and settings dialog --- NEWS.md | 3 +- RedPandaIDE/icons.qrc | 1 + RedPandaIDE/iconsmanager.cpp | 8 ++ RedPandaIDE/iconsmanager.h | 3 + RedPandaIDE/images/newlook/00Misc-12Help.svg | 78 +++++++++++++++++++ RedPandaIDE/settings.cpp | 76 ++++++++++++++++++ RedPandaIDE/settings.h | 26 +++++++ .../compilersetoptionwidget.cpp | 2 +- .../settingsdialog/editorsnippetwidget.cpp | 7 ++ .../settingsdialog/editorsnippetwidget.h | 4 + .../environmentfolderswidget.cpp | 6 ++ .../settingsdialog/environmentfolderswidget.h | 4 + .../environmentfolderswidget.ui | 3 + .../settingsdialog/executorgeneralwidget.cpp | 6 ++ .../settingsdialog/executorgeneralwidget.h | 4 + .../settingsdialog/executorgeneralwidget.ui | 5 +- .../settingsdialog/projectdllhostwidget.cpp | 6 ++ .../settingsdialog/projectdllhostwidget.h | 4 + .../settingsdialog/projectdllhostwidget.ui | 5 +- .../settingsdialog/projectgeneralwidget.cpp | 7 ++ .../settingsdialog/projectgeneralwidget.h | 4 + .../settingsdialog/projectmakefilewidget.cpp | 10 ++- .../settingsdialog/projectmakefilewidget.h | 5 +- .../settingsdialog/projectmakefilewidget.ui | 5 +- .../settingsdialog/projectoutputwidget.cpp | 8 ++ .../settingsdialog/projectoutputwidget.h | 4 + .../projectprecompilewidget.cpp | 6 ++ .../settingsdialog/projectprecompilewidget.h | 4 + .../settingsdialog/projectprecompilewidget.ui | 3 + RedPandaIDE/settingsdialog/settingsdialog.cpp | 23 +++++- RedPandaIDE/settingsdialog/settingsdialog.h | 5 ++ .../settingsdialog/toolsgeneralwidget.cpp | 9 +++ .../settingsdialog/toolsgeneralwidget.h | 4 + RedPandaIDE/version.h | 2 +- RedPandaIDE/widgets/cpudialog.cpp | 19 ++++- RedPandaIDE/widgets/newprojectdialog.cpp | 7 +- RedPandaIDE/widgets/newprojectdialog.h | 2 + 37 files changed, 361 insertions(+), 17 deletions(-) create mode 100644 RedPandaIDE/images/newlook/00Misc-12Help.svg diff --git a/NEWS.md b/NEWS.md index da70f436..8e98064e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ Version 0.11.5 For Dev-C++ 7 Beta - fix: step into instruction and step over instruction not correctly disabled when cpu dialog is created - - enhancement: icons in cpu dialog auto change size with fonts + - enhancement: icons in all dialogs auto change size with fonts + - enhancement: save/restore sizes of CPU dialog and settings dialog Version 0.11.4 For Dev-C++ 7 Beta - fix: compiler set's custom link parameters not used when compiling diff --git a/RedPandaIDE/icons.qrc b/RedPandaIDE/icons.qrc index b77d9cfc..05598c4d 100644 --- a/RedPandaIDE/icons.qrc +++ b/RedPandaIDE/icons.qrc @@ -207,5 +207,6 @@ images/dark-close.svg images/newlook/00Misc-10Check.svg images/newlook/00Misc-11Rename.svg + images/newlook/00Misc-12Help.svg diff --git a/RedPandaIDE/iconsmanager.cpp b/RedPandaIDE/iconsmanager.cpp index cfb08516..8442aea9 100644 --- a/RedPandaIDE/iconsmanager.cpp +++ b/RedPandaIDE/iconsmanager.cpp @@ -5,6 +5,7 @@ #include #include #include +#include IconsManager* pIconsManager; @@ -61,6 +62,7 @@ void IconsManager::updateActionIcons(const QString iconSet, int size) mIconPixmaps.insert(ACTION_MISC_CLEAN, createSVGIcon(iconFolder+"00Misc-09Clean.svg",size,size)); mIconPixmaps.insert(ACTION_MISC_VALIDATE, createSVGIcon(iconFolder+"00Misc-10Check.svg",size,size)); mIconPixmaps.insert(ACTION_MISC_RENAME, createSVGIcon(iconFolder+"00Misc-11Rename.svg",size,size)); + mIconPixmaps.insert(ACTION_MISC_HELP, createSVGIcon(iconFolder+"00Misc-12Help.svg",size,size)); mIconPixmaps.insert(ACTION_FILE_NEW, createSVGIcon(iconFolder+"01File-01New.svg",size,size)); mIconPixmaps.insert(ACTION_FILE_OPEN, createSVGIcon(iconFolder+"01File-02Open.svg",size,size)); @@ -154,6 +156,12 @@ void IconsManager::setIcon(QToolButton *btn, IconName iconName) const btn->setIcon(getIcon(iconName)); } +void IconsManager::setIcon(QPushButton *btn, IconName iconName) const +{ + btn->setIconSize(mActionIconSize); + btn->setIcon(getIcon(iconName)); +} + IconsManager::PPixmap IconsManager::createSVGIcon(const QString &filename, int width, int height) { QSvgRenderer renderer(filename); diff --git a/RedPandaIDE/iconsmanager.h b/RedPandaIDE/iconsmanager.h index 5bef23e0..f534fbdb 100644 --- a/RedPandaIDE/iconsmanager.h +++ b/RedPandaIDE/iconsmanager.h @@ -7,6 +7,7 @@ #include class QToolButton; +class QPushButton; class IconsManager : public QObject { Q_OBJECT @@ -48,6 +49,7 @@ public: ACTION_MISC_CLEAN, ACTION_MISC_VALIDATE, ACTION_MISC_RENAME, + ACTION_MISC_HELP, ACTION_FILE_NEW, ACTION_FILE_OPEN, @@ -132,6 +134,7 @@ public: QIcon getIcon(IconName iconName) const; void setIcon(QToolButton* btn, IconName iconName) const; + void setIcon(QPushButton* btn, IconName iconName) const; PPixmap createSVGIcon(const QString& filename, int width, int height); const QSize &actionIconSize() const; diff --git a/RedPandaIDE/images/newlook/00Misc-12Help.svg b/RedPandaIDE/images/newlook/00Misc-12Help.svg new file mode 100644 index 00000000..a517be7a --- /dev/null +++ b/RedPandaIDE/images/newlook/00Misc-12Help.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 69d7c533..e541b160 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -4427,6 +4427,66 @@ void Settings::UI::setShowProblem(bool newShowProblem) mShowProblem = newShowProblem; } +int Settings::UI::settingsDialogSplitterPos() const +{ + return mSettingsDialogSplitterPos; +} + +void Settings::UI::setSettingsDialogSplitterPos(int newSettingsDialogSplitterPos) +{ + mSettingsDialogSplitterPos = newSettingsDialogSplitterPos; +} + +int Settings::UI::settingsDialogHeight() const +{ + return mSettingsDialogHeight; +} + +void Settings::UI::setSettingsDialogHeight(int newSettingsDialogHeight) +{ + mSettingsDialogHeight = newSettingsDialogHeight; +} + +int Settings::UI::settingsDialogWidth() const +{ + return mSettingsDialogWidth; +} + +void Settings::UI::setSettingsDialogWidth(int newSettingsDialogWidth) +{ + mSettingsDialogWidth = newSettingsDialogWidth; +} + +int Settings::UI::CPUDialogSplitterPos() const +{ + return mCPUDialogSplitterPos; +} + +void Settings::UI::setCPUDialogSplitterPos(int newCPUDialogSplitterPos) +{ + mCPUDialogSplitterPos = newCPUDialogSplitterPos; +} + +int Settings::UI::CPUDialogHeight() const +{ + return mCPUDialogHeight; +} + +void Settings::UI::setCPUDialogHeight(int newCPUDialogHeight) +{ + mCPUDialogHeight = newCPUDialogHeight; +} + +int Settings::UI::CPUDialogWidth() const +{ + return mCPUDialogWidth; +} + +void Settings::UI::setCPUDialogWidth(int newCPUDialogWidth) +{ + mCPUDialogWidth = newCPUDialogWidth; +} + bool Settings::UI::showBookmark() const { return mShowBookmark; @@ -4629,6 +4689,14 @@ void Settings::UI::doSave() saveValue("show_todo", mShowTODO); saveValue("show_bookmark", mShowBookmark); saveValue("show_problem", mShowProblem); + + //dialogs + saveValue("cpu_dialog_width", mCPUDialogWidth); + saveValue("cpu_dialog_height", mCPUDialogHeight); + saveValue("cpu_dialog_splitter", mCPUDialogSplitterPos); + saveValue("settings_dialog_width", mSettingsDialogWidth); + saveValue("settings_dialog_height", mSettingsDialogHeight); + saveValue("settings_dialog_splitter", mSettingsDialogSplitterPos); } void Settings::UI::doLoad() @@ -4663,4 +4731,12 @@ void Settings::UI::doLoad() mShowTODO = boolValue("show_todo",true); mShowBookmark = boolValue("show_bookmark",true); 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); + 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); + mSettingsDialogSplitterPos = intValue("settings_dialog_splitter",300*qApp->desktop()->width()/1920); } diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h index 6046e595..274f9d95 100644 --- a/RedPandaIDE/settings.h +++ b/RedPandaIDE/settings.h @@ -906,6 +906,24 @@ public: bool showProblem() const; void setShowProblem(bool newShowProblem); + int CPUDialogWidth() const; + void setCPUDialogWidth(int newCPUDialogWidth); + + int CPUDialogHeight() const; + void setCPUDialogHeight(int newCPUDialogHeight); + + int CPUDialogSplitterPos() const; + void setCPUDialogSplitterPos(int newCPUDialogSplitterPos); + + int settingsDialogWidth() const; + void setSettingsDialogWidth(int newSettingsDialogWidth); + + int settingsDialogHeight() const; + void setSettingsDialogHeight(int newSettingsDialogHeight); + + int settingsDialogSplitterPos() const; + void setSettingsDialogSplitterPos(int newSettingsDialogSplitterPos); + private: QByteArray mMainWindowState; QByteArray mMainWindowGeometry; @@ -938,6 +956,14 @@ public: bool mShowBookmark; bool mShowProblem; + //dialogs + int mCPUDialogWidth; + int mCPUDialogHeight; + int mCPUDialogSplitterPos; + int mSettingsDialogWidth; + int mSettingsDialogHeight; + int mSettingsDialogSplitterPos; + protected: void doSave() override; void doLoad() override; diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp index 690eb274..5e1b96be 100644 --- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp +++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp @@ -272,7 +272,7 @@ void CompilerSetOptionWidget::on_btnRemoveCompilerSet_pressed() void CompilerSetOptionWidget::updateIcons() { pIconsManager->setIcon(ui->btnFindCompilers, IconsManager::ACTION_EDIT_SEARCH); - pIconsManager->setIcon(ui->btnAddCompilerSetByFolder, IconsManager::ACTION_MISC_FOLDER); + pIconsManager->setIcon(ui->btnAddCompilerSetByFolder, IconsManager::ACTION_FILE_OPEN_FOLDER); pIconsManager->setIcon(ui->btnAddBlankCompilerSet, IconsManager::ACTION_MISC_ADD); pIconsManager->setIcon(ui->btnRemoveCompilerSet, IconsManager::ACTION_MISC_REMOVE); pIconsManager->setIcon(ui->btnRenameCompilerSet, IconsManager::ACTION_MISC_RENAME); diff --git a/RedPandaIDE/settingsdialog/editorsnippetwidget.cpp b/RedPandaIDE/settingsdialog/editorsnippetwidget.cpp index 49979374..4718c26c 100644 --- a/RedPandaIDE/settingsdialog/editorsnippetwidget.cpp +++ b/RedPandaIDE/settingsdialog/editorsnippetwidget.cpp @@ -2,6 +2,7 @@ #include "ui_editorsnippetwidget.h" #include "../mainwindow.h" #include "../codesnippetsmanager.h" +#include "../iconsmanager.h" #include @@ -71,6 +72,12 @@ void EditorSnippetWidget::on_btnAdd_clicked() ui->tblSnippets->edit(mModel.lastSnippetCaption()); } +void EditorSnippetWidget::updateIcons(const QSize &size) +{ + pIconsManager->setIcon(ui->btnAdd,IconsManager::ACTION_MISC_ADD); + pIconsManager->setIcon(ui->btnRemove,IconsManager::ACTION_MISC_REMOVE); +} + void EditorSnippetWidget::on_btnRemove_clicked() { diff --git a/RedPandaIDE/settingsdialog/editorsnippetwidget.h b/RedPandaIDE/settingsdialog/editorsnippetwidget.h index a2e4c9c9..7403a8ad 100644 --- a/RedPandaIDE/settingsdialog/editorsnippetwidget.h +++ b/RedPandaIDE/settingsdialog/editorsnippetwidget.h @@ -29,6 +29,10 @@ protected: private slots: void on_btnRemove_clicked(); void on_btnAdd_clicked(); + + // SettingsWidget interface +protected: + void updateIcons(const QSize &size) override; }; #endif // EDITORSNIPPETWIDGET_H diff --git a/RedPandaIDE/settingsdialog/environmentfolderswidget.cpp b/RedPandaIDE/settingsdialog/environmentfolderswidget.cpp index 7a27b712..152b5b53 100644 --- a/RedPandaIDE/settingsdialog/environmentfolderswidget.cpp +++ b/RedPandaIDE/settingsdialog/environmentfolderswidget.cpp @@ -2,6 +2,7 @@ #include "ui_environmentfolderswidget.h" #include "../settings.h" #include "../mainwindow.h" +#include "../iconsmanager.h" #include #include @@ -55,3 +56,8 @@ void EnvironmentFoldersWidget::on_btnResetDefault_clicked() emit shouldQuitApp(); } +void EnvironmentFoldersWidget::updateIcons(const QSize &size) +{ + pIconsManager->setIcon(ui->btnOpenConfigFolderInBrowser,IconsManager::ACTION_FILE_OPEN_FOLDER); +} + diff --git a/RedPandaIDE/settingsdialog/environmentfolderswidget.h b/RedPandaIDE/settingsdialog/environmentfolderswidget.h index 0902e4e3..324ce47d 100644 --- a/RedPandaIDE/settingsdialog/environmentfolderswidget.h +++ b/RedPandaIDE/settingsdialog/environmentfolderswidget.h @@ -27,6 +27,10 @@ protected: private slots: void on_btnOpenConfigFolderInBrowser_clicked(); void on_btnResetDefault_clicked(); + + // SettingsWidget interface +protected: + void updateIcons(const QSize &size) override; }; #endif // ENVIRONMENTFOLDERSWIDGET_H diff --git a/RedPandaIDE/settingsdialog/environmentfolderswidget.ui b/RedPandaIDE/settingsdialog/environmentfolderswidget.ui index b105490a..d4cadf0a 100644 --- a/RedPandaIDE/settingsdialog/environmentfolderswidget.ui +++ b/RedPandaIDE/settingsdialog/environmentfolderswidget.ui @@ -59,6 +59,9 @@ + + Open in browser + Open in browser diff --git a/RedPandaIDE/settingsdialog/executorgeneralwidget.cpp b/RedPandaIDE/settingsdialog/executorgeneralwidget.cpp index 50c0d9a5..4c37a34b 100644 --- a/RedPandaIDE/settingsdialog/executorgeneralwidget.cpp +++ b/RedPandaIDE/settingsdialog/executorgeneralwidget.cpp @@ -1,6 +1,7 @@ #include "executorgeneralwidget.h" #include "ui_executorgeneralwidget.h" #include "../settings.h" +#include "../iconsmanager.h" #include @@ -50,3 +51,8 @@ void ExecutorGeneralWidget::on_btnBrowse_clicked() } } +void ExecutorGeneralWidget::updateIcons(const QSize &size) +{ + pIconsManager->setIcon(ui->btnBrowse,IconsManager::ACTION_FILE_OPEN_FOLDER); +} + diff --git a/RedPandaIDE/settingsdialog/executorgeneralwidget.h b/RedPandaIDE/settingsdialog/executorgeneralwidget.h index 7303b8d3..32211306 100644 --- a/RedPandaIDE/settingsdialog/executorgeneralwidget.h +++ b/RedPandaIDE/settingsdialog/executorgeneralwidget.h @@ -25,6 +25,10 @@ protected: void doSave() override; private slots: void on_btnBrowse_clicked(); + + // SettingsWidget interface +protected: + void updateIcons(const QSize &size) override; }; #endif // EXECUTORGENERALWIDGET_H diff --git a/RedPandaIDE/settingsdialog/executorgeneralwidget.ui b/RedPandaIDE/settingsdialog/executorgeneralwidget.ui index c9f8fccc..f8798a0f 100644 --- a/RedPandaIDE/settingsdialog/executorgeneralwidget.ui +++ b/RedPandaIDE/settingsdialog/executorgeneralwidget.ui @@ -89,8 +89,11 @@ + + Browse + - + Browse diff --git a/RedPandaIDE/settingsdialog/projectdllhostwidget.cpp b/RedPandaIDE/settingsdialog/projectdllhostwidget.cpp index dcb0a565..0bcf15c6 100644 --- a/RedPandaIDE/settingsdialog/projectdllhostwidget.cpp +++ b/RedPandaIDE/settingsdialog/projectdllhostwidget.cpp @@ -2,6 +2,7 @@ #include "ui_projectdllhostwidget.h" #include "../project.h" #include "../mainwindow.h" +#include "../iconsmanager.h" #include @@ -39,3 +40,8 @@ void ProjectDLLHostWidget::on_btnBrowse_clicked() } } +void ProjectDLLHostWidget::updateIcons(const QSize &size) +{ + pIconsManager->setIcon(ui->btnBrowse, IconsManager::ACTION_FILE_OPEN_FOLDER); +} + diff --git a/RedPandaIDE/settingsdialog/projectdllhostwidget.h b/RedPandaIDE/settingsdialog/projectdllhostwidget.h index 75e2a49a..88b3f386 100644 --- a/RedPandaIDE/settingsdialog/projectdllhostwidget.h +++ b/RedPandaIDE/settingsdialog/projectdllhostwidget.h @@ -25,6 +25,10 @@ protected: void doSave() override; private slots: void on_btnBrowse_clicked(); + + // SettingsWidget interface +protected: + void updateIcons(const QSize &size) override; }; #endif // PROJECTDLLHOSTWIDGET_H diff --git a/RedPandaIDE/settingsdialog/projectdllhostwidget.ui b/RedPandaIDE/settingsdialog/projectdllhostwidget.ui index e88f8e21..781e432b 100644 --- a/RedPandaIDE/settingsdialog/projectdllhostwidget.ui +++ b/RedPandaIDE/settingsdialog/projectdllhostwidget.ui @@ -16,8 +16,11 @@ + + Browse + - + Browse diff --git a/RedPandaIDE/settingsdialog/projectgeneralwidget.cpp b/RedPandaIDE/settingsdialog/projectgeneralwidget.cpp index bf00c32c..fd538adc 100644 --- a/RedPandaIDE/settingsdialog/projectgeneralwidget.cpp +++ b/RedPandaIDE/settingsdialog/projectgeneralwidget.cpp @@ -4,6 +4,7 @@ #include "../mainwindow.h" #include "settings.h" #include "../systemconsts.h" +#include "../iconsmanager.h" #include #include @@ -139,3 +140,9 @@ void ProjectGeneralWidget::init() SettingsWidget::init(); } +void ProjectGeneralWidget::updateIcons(const QSize &) +{ + pIconsManager->setIcon(ui->btnBrowse,IconsManager::ACTION_FILE_OPEN_FOLDER); + pIconsManager->setIcon(ui->btnRemove, IconsManager::ACTION_MISC_CROSS); +} + diff --git a/RedPandaIDE/settingsdialog/projectgeneralwidget.h b/RedPandaIDE/settingsdialog/projectgeneralwidget.h index f4d6812f..ea9c28fb 100644 --- a/RedPandaIDE/settingsdialog/projectgeneralwidget.h +++ b/RedPandaIDE/settingsdialog/projectgeneralwidget.h @@ -32,6 +32,10 @@ private slots: // SettingsWidget interface public: void init() override; + + // SettingsWidget interface +protected: + void updateIcons(const QSize &size) override; }; #endif // PROJECTGENERALWIDGET_H diff --git a/RedPandaIDE/settingsdialog/projectmakefilewidget.cpp b/RedPandaIDE/settingsdialog/projectmakefilewidget.cpp index aabb3591..f152679c 100644 --- a/RedPandaIDE/settingsdialog/projectmakefilewidget.cpp +++ b/RedPandaIDE/settingsdialog/projectmakefilewidget.cpp @@ -4,6 +4,7 @@ #include "../mainwindow.h" #include "../project.h" #include "../widgets/custommakefileinfodialog.h" +#include "../iconsmanager.h" #include @@ -51,7 +52,14 @@ void ProjectMakefileWidget::on_btnBrowse_clicked() } -void ProjectMakefileWidget::on_pushButton_clicked() +void ProjectMakefileWidget::updateIcons(const QSize &) +{ + pIconsManager->setIcon(ui->btnBrowse, IconsManager::ACTION_FILE_OPEN_FOLDER); + pIconsManager->setIcon(ui->btnInfo, IconsManager::ACTION_MISC_HELP); +} + + +void ProjectMakefileWidget::on_btnInfo_clicked() { CustomMakefileInfoDialog dialog(this); dialog.exec(); diff --git a/RedPandaIDE/settingsdialog/projectmakefilewidget.h b/RedPandaIDE/settingsdialog/projectmakefilewidget.h index 1f348427..cdba20d7 100644 --- a/RedPandaIDE/settingsdialog/projectmakefilewidget.h +++ b/RedPandaIDE/settingsdialog/projectmakefilewidget.h @@ -27,7 +27,10 @@ protected: void doSave() override; private slots: void on_btnBrowse_clicked(); - void on_pushButton_clicked(); + void on_btnInfo_clicked(); + +protected: + void updateIcons(const QSize &size) override; }; #endif // PROJECTMAKEFILEWIDGET_H diff --git a/RedPandaIDE/settingsdialog/projectmakefilewidget.ui b/RedPandaIDE/settingsdialog/projectmakefilewidget.ui index fd524576..a741846f 100644 --- a/RedPandaIDE/settingsdialog/projectmakefilewidget.ui +++ b/RedPandaIDE/settingsdialog/projectmakefilewidget.ui @@ -28,6 +28,9 @@ + + Browse + Browse @@ -41,7 +44,7 @@ - + Information about using a custom make file diff --git a/RedPandaIDE/settingsdialog/projectoutputwidget.cpp b/RedPandaIDE/settingsdialog/projectoutputwidget.cpp index 53b19960..6446e131 100644 --- a/RedPandaIDE/settingsdialog/projectoutputwidget.cpp +++ b/RedPandaIDE/settingsdialog/projectoutputwidget.cpp @@ -2,6 +2,7 @@ #include "ui_projectoutputwidget.h" #include "../mainwindow.h" #include "../project.h" +#include "../iconsmanager.h" #include @@ -73,3 +74,10 @@ void ProjectOutputWidget::on_btnCompileLog_triggered(QAction *) } } +void ProjectOutputWidget::updateIcons(const QSize &size) +{ + pIconsManager->setIcon(ui->btnCompileLog, IconsManager::ACTION_FILE_OPEN_FOLDER); + pIconsManager->setIcon(ui->btnObjOutputDir, IconsManager::ACTION_FILE_OPEN_FOLDER); + pIconsManager->setIcon(ui->btnOutputDir, IconsManager::ACTION_FILE_OPEN_FOLDER); +} + diff --git a/RedPandaIDE/settingsdialog/projectoutputwidget.h b/RedPandaIDE/settingsdialog/projectoutputwidget.h index 10ccb2a3..7d42e890 100644 --- a/RedPandaIDE/settingsdialog/projectoutputwidget.h +++ b/RedPandaIDE/settingsdialog/projectoutputwidget.h @@ -27,6 +27,10 @@ private slots: void on_btnOutputDir_triggered(QAction *arg1); void on_btnObjOutputDir_triggered(QAction *arg1); void on_btnCompileLog_triggered(QAction *arg1); + + // SettingsWidget interface +protected: + void updateIcons(const QSize &size) override; }; #endif // PROJECTOUTPUTWIDGET_H diff --git a/RedPandaIDE/settingsdialog/projectprecompilewidget.cpp b/RedPandaIDE/settingsdialog/projectprecompilewidget.cpp index 4677072b..ca0e6313 100644 --- a/RedPandaIDE/settingsdialog/projectprecompilewidget.cpp +++ b/RedPandaIDE/settingsdialog/projectprecompilewidget.cpp @@ -2,6 +2,7 @@ #include "ui_projectprecompilewidget.h" #include "../mainwindow.h" #include "../project.h" +#include "../iconsmanager.h" #include @@ -42,3 +43,8 @@ void ProjectPreCompileWidget::on_btnBrowse_clicked() } } +void ProjectPreCompileWidget::updateIcons(const QSize &size) +{ + pIconsManager->setIcon(ui->btnBrowse, IconsManager::ACTION_FILE_OPEN_FOLDER); +} + diff --git a/RedPandaIDE/settingsdialog/projectprecompilewidget.h b/RedPandaIDE/settingsdialog/projectprecompilewidget.h index 60cb720e..d705a55b 100644 --- a/RedPandaIDE/settingsdialog/projectprecompilewidget.h +++ b/RedPandaIDE/settingsdialog/projectprecompilewidget.h @@ -25,6 +25,10 @@ protected: void doSave() override; private slots: void on_btnBrowse_clicked(); + + // SettingsWidget interface +protected: + void updateIcons(const QSize &size) override; }; #endif // PROJECTPRECOMPILEWIDGET_H diff --git a/RedPandaIDE/settingsdialog/projectprecompilewidget.ui b/RedPandaIDE/settingsdialog/projectprecompilewidget.ui index b8700d23..8a2421f0 100644 --- a/RedPandaIDE/settingsdialog/projectprecompilewidget.ui +++ b/RedPandaIDE/settingsdialog/projectprecompilewidget.ui @@ -43,6 +43,9 @@ + + Browse + Browse diff --git a/RedPandaIDE/settingsdialog/settingsdialog.cpp b/RedPandaIDE/settingsdialog/settingsdialog.cpp index a3f55a48..a4cb8c22 100644 --- a/RedPandaIDE/settingsdialog/settingsdialog.cpp +++ b/RedPandaIDE/settingsdialog/settingsdialog.cpp @@ -52,10 +52,14 @@ SettingsDialog::SettingsDialog(QWidget *parent) : ui->btnApply->setEnabled(false); mAppShouldQuit = false; - QSize size; - size.setWidth(width()*qApp->desktop()->width()/1920); - size.setHeight(height()*qApp->desktop()->height()/1080); - setBaseSize(size); + resize(pSettings->ui().settingsDialogWidth(),pSettings->ui().settingsDialogHeight()); + + QList sizes = ui->splitter->sizes(); + int tabWidth = pSettings->ui().settingsDialogSplitterPos(); + int totalSize = sizes[0] + sizes[1]; + sizes[0] = tabWidth; + sizes[1] = std::max(1,totalSize - sizes[0]); + ui->splitter->setSizes(sizes); } SettingsDialog::~SettingsDialog() @@ -338,6 +342,17 @@ void SettingsDialog::saveCurrentPageSettings(bool confirm) pWidget->save(); } +void SettingsDialog::closeEvent(QCloseEvent *event) +{ + pSettings->ui().setSettingsDialogWidth(width()); + pSettings->ui().setSettingsDialogHeight(height()); + + QList sizes = ui->splitter->sizes(); + pSettings->ui().setSettingsDialogSplitterPos(sizes[0]); + + QDialog::closeEvent(event); +} + bool SettingsDialog::appShouldQuit() const { return mAppShouldQuit; diff --git a/RedPandaIDE/settingsdialog/settingsdialog.h b/RedPandaIDE/settingsdialog/settingsdialog.h index d7197981..70be8db6 100644 --- a/RedPandaIDE/settingsdialog/settingsdialog.h +++ b/RedPandaIDE/settingsdialog/settingsdialog.h @@ -67,6 +67,11 @@ private: // ExecutorGeneralWidget *pExecutorGeneralWidget; // DebugGeneralWidget *pDebugGeneralWidget; // FormatterGeneralWidget *pFormatterGeneralWidget; + + + // QWidget interface +protected: + void closeEvent(QCloseEvent *event) override; }; #endif // SETTINGSDIALOG_H diff --git a/RedPandaIDE/settingsdialog/toolsgeneralwidget.cpp b/RedPandaIDE/settingsdialog/toolsgeneralwidget.cpp index 64035570..6bc7f92a 100644 --- a/RedPandaIDE/settingsdialog/toolsgeneralwidget.cpp +++ b/RedPandaIDE/settingsdialog/toolsgeneralwidget.cpp @@ -2,6 +2,7 @@ #include "ui_toolsgeneralwidget.h" #include "../mainwindow.h" #include "../settings.h" +#include "../iconsmanager.h" #include #include @@ -186,6 +187,14 @@ void ToolsGeneralWidget::doSave() pMainWindow->updateTools(); } +void ToolsGeneralWidget::updateIcons(const QSize &) +{ + pIconsManager->setIcon(ui->btnAdd,IconsManager::ACTION_MISC_ADD); + pIconsManager->setIcon(ui->btnRemove,IconsManager::ACTION_MISC_REMOVE); + pIconsManager->setIcon(ui->btnBrowseProgram,IconsManager::ACTION_FILE_OPEN_FOLDER); + pIconsManager->setIcon(ui->btnBrowseWorkingDirectory,IconsManager::ACTION_FILE_OPEN_FOLDER); +} + void ToolsGeneralWidget::on_btnRemove_clicked() { diff --git a/RedPandaIDE/settingsdialog/toolsgeneralwidget.h b/RedPandaIDE/settingsdialog/toolsgeneralwidget.h index d807d924..30bb5471 100644 --- a/RedPandaIDE/settingsdialog/toolsgeneralwidget.h +++ b/RedPandaIDE/settingsdialog/toolsgeneralwidget.h @@ -73,6 +73,10 @@ private: protected: void doLoad() override; void doSave() override; + + // SettingsWidget interface +protected: + void updateIcons(const QSize &size) override; }; #endif // TOOLSGENERALWIDGET_H diff --git a/RedPandaIDE/version.h b/RedPandaIDE/version.h index 61ec7267..ca064557 100644 --- a/RedPandaIDE/version.h +++ b/RedPandaIDE/version.h @@ -2,6 +2,6 @@ #define VERSION_H #include -#define DEVCPP_VERSION "beta.0.11.4" +#define DEVCPP_VERSION "beta.0.11.5" #endif // VERSION_H diff --git a/RedPandaIDE/widgets/cpudialog.cpp b/RedPandaIDE/widgets/cpudialog.cpp index 39c0dad6..d9e8aa4e 100644 --- a/RedPandaIDE/widgets/cpudialog.cpp +++ b/RedPandaIDE/widgets/cpudialog.cpp @@ -41,10 +41,15 @@ CPUDialog::CPUDialog(QWidget *parent) : ui->rdIntel->setChecked(pSettings->debugger().useIntelStyle()); ui->chkBlendMode->setChecked(pSettings->debugger().blendMode()); - QSize size; - size.setWidth(width()*qApp->desktop()->width()/1920); - size.setHeight(height()*qApp->desktop()->height()/1080); - setBaseSize(size); + resize(pSettings->ui().CPUDialogWidth(),pSettings->ui().CPUDialogHeight()); + + QList sizes = ui->splitter->sizes(); + int tabWidth = pSettings->ui().CPUDialogSplitterPos(); + int totalSize = sizes[0] + sizes[1]; + sizes[0] = tabWidth; + sizes[1] = std::max(1,totalSize - sizes[0]); + ui->splitter->setSizes(sizes); + updateIcons(); connect(pIconsManager,&IconsManager::actionIconsUpdated, this, &CPUDialog::updateIcons); @@ -103,6 +108,12 @@ void CPUDialog::sendSyntaxCommand() void CPUDialog::closeEvent(QCloseEvent *event) { + pSettings->ui().setCPUDialogWidth(width()); + pSettings->ui().setCPUDialogHeight(height()); + + QList sizes = ui->splitter->sizes(); + pSettings->ui().setCPUDialogSplitterPos(sizes[0]); + QDialog::closeEvent(event); emit closed(); } diff --git a/RedPandaIDE/widgets/newprojectdialog.cpp b/RedPandaIDE/widgets/newprojectdialog.cpp index cbc2635e..579eb0f9 100644 --- a/RedPandaIDE/widgets/newprojectdialog.cpp +++ b/RedPandaIDE/widgets/newprojectdialog.cpp @@ -2,7 +2,7 @@ #include "ui_newprojectdialog.h" #include "settings.h" #include "systemconsts.h" - +#include "../iconsmanager.h" #include #include #include @@ -229,3 +229,8 @@ void NewProjectDialog::on_btnBrowse_clicked() } } +void NewProjectDialog::updateIcons() +{ + pIconsManager->setIcon(ui->btnBrowse, IconsManager::ACTION_FILE_OPEN_FOLDER); +} + diff --git a/RedPandaIDE/widgets/newprojectdialog.h b/RedPandaIDE/widgets/newprojectdialog.h index f345d750..04ab2a82 100644 --- a/RedPandaIDE/widgets/newprojectdialog.h +++ b/RedPandaIDE/widgets/newprojectdialog.h @@ -31,11 +31,13 @@ private slots: void on_lstTemplates_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous); void on_btnBrowse_clicked(); + void updateIcons(); private: void addTemplate(const QString& filename); void readTemplateDir(); void rebuildTabs(); + private: Ui::NewProjectDialog *ui; QList mTemplates;