- enhancement: icons in all dialogs auto change size with fonts

- enhancement: save/restore sizes of CPU dialog and settings dialog
This commit is contained in:
Roy Qu 2021-12-23 09:11:58 +08:00
parent b5a450312a
commit 6c413fe8f9
37 changed files with 361 additions and 17 deletions

View File

@ -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

View File

@ -207,5 +207,6 @@
<file>images/dark-close.svg</file>
<file>images/newlook/00Misc-10Check.svg</file>
<file>images/newlook/00Misc-11Rename.svg</file>
<file>images/newlook/00Misc-12Help.svg</file>
</qresource>
</RCC>

View File

@ -5,6 +5,7 @@
#include <QDebug>
#include <QIcon>
#include <QToolButton>
#include <QPushButton>
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);

View File

@ -7,6 +7,7 @@
#include <memory>
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;

View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100"
height="100"
viewBox="0 0 26.458333 26.458333"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="00Misc-12Help.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="px"
showgrid="false"
inkscape:zoom="1.4467453"
inkscape:cx="-86.400837"
inkscape:cy="58.406966"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
units="px"
width="100px" />
<defs
id="defs2">
<linearGradient
id="linearGradient3056"
inkscape:swatch="gradient">
<stop
style="stop-color:#45c200;stop-opacity:1"
offset="0"
id="stop826" />
<stop
style="stop-color:#53e900;stop-opacity:1"
offset="1"
id="stop828" />
</linearGradient>
<linearGradient
id="linearGradient3056-2">
<stop
style="stop-color:#45c200;stop-opacity:1"
offset="0"
id="stop3052" />
<stop
style="stop-color:#5fff07;stop-opacity:1"
offset="1"
id="stop3054" />
</linearGradient>
</defs>
<g
inkscape:label="图层 1"
inkscape:groupmode="layer"
id="layer1">
<g
aria-label="?"
id="text8578"
style="font-size:28.2222px;line-height:1.25;letter-spacing:0px;fill:#fff87a;fill-opacity:1;stroke:#000000;stroke-width:0.64795135;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
transform="matrix(1.3819609,0,0,1.0858927,-5.2285669,-1.1202321)">
<path
d="m 10.863774,17.582863 q -0.330729,-0.895724 -0.330729,-1.84657 0,-2.328883 2.20486,-4.189233 1.364256,-1.157551 1.846569,-1.9292517 0.482313,-0.7717008 0.482313,-1.6674249 0,-0.9784063 -0.689018,-1.5985231 -0.689019,-0.633897 -1.777668,-0.633897 -2.549369,0 -4.7404478,1.9568127 V 3.4028609 q 2.3013218,-1.3780371 5.2365408,-1.3780371 2.976561,0 4.699107,1.3780371 1.722546,1.3780371 1.722546,3.9274058 0,1.5296212 -0.675238,2.7698543 -0.675238,1.240234 -2.480467,2.714733 -1.446939,1.212673 -1.791448,1.887911 -0.344509,0.675239 -0.344509,1.433159 0,0.74414 0.37207,1.446939 z m -0.564995,4.106551 q 0,-1.019748 0.771701,-1.681206 0.771701,-0.675238 1.87413,-0.675238 1.061089,0 1.819009,0.675238 0.771701,0.661458 0.771701,1.681206 0,1.005967 -0.716579,1.694985 -0.71658,0.675238 -1.722547,0.675238 -1.281574,0 -2.039495,-0.702798 -0.75792,-0.702799 -0.75792,-1.667425 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold';fill:#fff87a;fill-opacity:1;stroke:#000000;stroke-width:0.64795135;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path18112" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -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);
}

View File

@ -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;

View File

@ -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);

View File

@ -2,6 +2,7 @@
#include "ui_editorsnippetwidget.h"
#include "../mainwindow.h"
#include "../codesnippetsmanager.h"
#include "../iconsmanager.h"
#include <QItemSelectionModel>
@ -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()
{

View File

@ -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

View File

@ -2,6 +2,7 @@
#include "ui_environmentfolderswidget.h"
#include "../settings.h"
#include "../mainwindow.h"
#include "../iconsmanager.h"
#include <QDesktopServices>
#include <QDir>
@ -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);
}

View File

@ -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

View File

@ -59,6 +59,9 @@
</item>
<item>
<widget class="QToolButton" name="btnOpenConfigFolderInBrowser">
<property name="toolTip">
<string>Open in browser</string>
</property>
<property name="text">
<string>Open in browser</string>
</property>

View File

@ -1,6 +1,7 @@
#include "executorgeneralwidget.h"
#include "ui_executorgeneralwidget.h"
#include "../settings.h"
#include "../iconsmanager.h"
#include <QFileDialog>
@ -50,3 +51,8 @@ void ExecutorGeneralWidget::on_btnBrowse_clicked()
}
}
void ExecutorGeneralWidget::updateIcons(const QSize &size)
{
pIconsManager->setIcon(ui->btnBrowse,IconsManager::ACTION_FILE_OPEN_FOLDER);
}

View File

@ -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

View File

@ -89,8 +89,11 @@
</item>
<item row="0" column="2">
<widget class="QToolButton" name="btnBrowse">
<property name="toolTip">
<string>Browse</string>
</property>
<property name="text">
<string/>
<string>Browse</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">

View File

@ -2,6 +2,7 @@
#include "ui_projectdllhostwidget.h"
#include "../project.h"
#include "../mainwindow.h"
#include "../iconsmanager.h"
#include <QFileDialog>
@ -39,3 +40,8 @@ void ProjectDLLHostWidget::on_btnBrowse_clicked()
}
}
void ProjectDLLHostWidget::updateIcons(const QSize &size)
{
pIconsManager->setIcon(ui->btnBrowse, IconsManager::ACTION_FILE_OPEN_FOLDER);
}

View File

@ -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

View File

@ -16,8 +16,11 @@
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="2">
<widget class="QToolButton" name="btnBrowse">
<property name="toolTip">
<string>Browse</string>
</property>
<property name="text">
<string/>
<string>Browse</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">

View File

@ -4,6 +4,7 @@
#include "../mainwindow.h"
#include "settings.h"
#include "../systemconsts.h"
#include "../iconsmanager.h"
#include <QFileDialog>
#include <QIcon>
@ -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);
}

View File

@ -32,6 +32,10 @@ private slots:
// SettingsWidget interface
public:
void init() override;
// SettingsWidget interface
protected:
void updateIcons(const QSize &size) override;
};
#endif // PROJECTGENERALWIDGET_H

View File

@ -4,6 +4,7 @@
#include "../mainwindow.h"
#include "../project.h"
#include "../widgets/custommakefileinfodialog.h"
#include "../iconsmanager.h"
#include <QFileDialog>
@ -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();

View File

@ -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

View File

@ -28,6 +28,9 @@
</item>
<item row="0" column="1">
<widget class="QToolButton" name="btnBrowse">
<property name="toolTip">
<string>Browse</string>
</property>
<property name="text">
<string>Browse</string>
</property>
@ -41,7 +44,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<widget class="QPushButton" name="btnInfo">
<property name="text">
<string>Information about using a custom make file </string>
</property>

View File

@ -2,6 +2,7 @@
#include "ui_projectoutputwidget.h"
#include "../mainwindow.h"
#include "../project.h"
#include "../iconsmanager.h"
#include <QFileDialog>
@ -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);
}

View File

@ -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

View File

@ -2,6 +2,7 @@
#include "ui_projectprecompilewidget.h"
#include "../mainwindow.h"
#include "../project.h"
#include "../iconsmanager.h"
#include <QFileDialog>
@ -42,3 +43,8 @@ void ProjectPreCompileWidget::on_btnBrowse_clicked()
}
}
void ProjectPreCompileWidget::updateIcons(const QSize &size)
{
pIconsManager->setIcon(ui->btnBrowse, IconsManager::ACTION_FILE_OPEN_FOLDER);
}

View File

@ -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

View File

@ -43,6 +43,9 @@
</item>
<item>
<widget class="QToolButton" name="btnBrowse">
<property name="toolTip">
<string>Browse</string>
</property>
<property name="text">
<string>Browse</string>
</property>

View File

@ -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<int> 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<int> sizes = ui->splitter->sizes();
pSettings->ui().setSettingsDialogSplitterPos(sizes[0]);
QDialog::closeEvent(event);
}
bool SettingsDialog::appShouldQuit() const
{
return mAppShouldQuit;

View File

@ -67,6 +67,11 @@ private:
// ExecutorGeneralWidget *pExecutorGeneralWidget;
// DebugGeneralWidget *pDebugGeneralWidget;
// FormatterGeneralWidget *pFormatterGeneralWidget;
// QWidget interface
protected:
void closeEvent(QCloseEvent *event) override;
};
#endif // SETTINGSDIALOG_H

View File

@ -2,6 +2,7 @@
#include "ui_toolsgeneralwidget.h"
#include "../mainwindow.h"
#include "../settings.h"
#include "../iconsmanager.h"
#include <QFileDialog>
#include <QMessageBox>
@ -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()
{

View File

@ -73,6 +73,10 @@ private:
protected:
void doLoad() override;
void doSave() override;
// SettingsWidget interface
protected:
void updateIcons(const QSize &size) override;
};
#endif // TOOLSGENERALWIDGET_H

View File

@ -2,6 +2,6 @@
#define VERSION_H
#include <QObject>
#define DEVCPP_VERSION "beta.0.11.4"
#define DEVCPP_VERSION "beta.0.11.5"
#endif // VERSION_H

View File

@ -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<int> 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<int> sizes = ui->splitter->sizes();
pSettings->ui().setCPUDialogSplitterPos(sizes[0]);
QDialog::closeEvent(event);
emit closed();
}

View File

@ -2,7 +2,7 @@
#include "ui_newprojectdialog.h"
#include "settings.h"
#include "systemconsts.h"
#include "../iconsmanager.h"
#include <QDir>
#include <QFile>
#include <QFileDialog>
@ -229,3 +229,8 @@ void NewProjectDialog::on_btnBrowse_clicked()
}
}
void NewProjectDialog::updateIcons()
{
pIconsManager->setIcon(ui->btnBrowse, IconsManager::ACTION_FILE_OPEN_FOLDER);
}

View File

@ -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<PProjectTemplate> mTemplates;