complete bundling and assigning icons to actions

This commit is contained in:
Axel Kohlmeyer
2023-08-14 04:01:33 -04:00
parent 619623f0f6
commit a10b1de511
6 changed files with 12 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -32,10 +32,14 @@ ChartWindow::ChartWindow(const QString &_filename, QWidget *parent) :
top->addWidget(menu);
top->addWidget(columns);
saveAsAct = file->addAction("&Save Graph As...", this, &ChartWindow::saveAs);
saveAsAct->setIcon(QIcon(":/document-save-as.png"));
exportCsvAct = file->addAction("&Export data to CSV...", this, &ChartWindow::exportCsv);
exportCsvAct->setIcon(QIcon(":/application-calc.png"));
exportDatAct = file->addAction("Export data to &Gnuplot...", this, &ChartWindow::exportDat);
exportDatAct->setIcon(QIcon(":/application-plot.png"));
file->addSeparator();
closeAct = file->addAction("&Close", this, &QWidget::close);
closeAct->setIcon(QIcon(":/window-close.png"));
auto *layout = new QVBoxLayout;
layout->addLayout(top);
setLayout(layout);

View File

@ -266,13 +266,16 @@ void ImageViewer::createActions()
QMenu *fileMenu = menuBar->addMenu(tr("&File"));
saveAsAct = fileMenu->addAction(tr("&Save As..."), this, &ImageViewer::saveAs);
saveAsAct->setIcon(QIcon(":/document-save-as.png"));
saveAsAct->setEnabled(false);
fileMenu->addSeparator();
copyAct = fileMenu->addAction(tr("&Copy"), this, &ImageViewer::copy);
copyAct->setIcon(QIcon(":/edit-copy.png"));
copyAct->setShortcut(QKeySequence::Copy);
copyAct->setEnabled(false);
fileMenu->addSeparator();
QAction *exitAct = fileMenu->addAction(tr("&Close"), this, &QWidget::close);
exitAct->setIcon(QIcon(":/window-close.png"));
exitAct->setShortcut(tr("Ctrl+W"));
QMenu *viewMenu = menuBar->addMenu(tr("&View"));
@ -284,12 +287,12 @@ void ImageViewer::createActions()
zoomOutAct = viewMenu->addAction(tr("Image Zoom &Out (25%)"), this, &ImageViewer::zoomOut);
zoomOutAct->setShortcut(QKeySequence::ZoomOut);
zoomInAct->setIcon(QIcon(":/gtk-zoom-out.png"));
zoomOutAct->setIcon(QIcon(":/gtk-zoom-out.png"));
zoomOutAct->setEnabled(false);
normalSizeAct = viewMenu->addAction(tr("&Reset Image Size"), this, &ImageViewer::normalSize);
normalSizeAct->setShortcut(tr("Ctrl+0"));
zoomInAct->setIcon(QIcon(":/gtk-zoom-fit.png"));
normalSizeAct->setIcon(QIcon(":/gtk-zoom-fit.png"));
normalSizeAct->setEnabled(false);
viewMenu->addSeparator();

View File

@ -34,5 +34,8 @@
<file>emblem-photos.png</file>
<file>process-stop.png</file>
<file>emblem-default.png</file>
<file>window-close.png</file>
<file>application-plot.png</file>
<file>application-calc.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB