From 0d2eb533f18dbd2330f5bd48b6a154a3c87b84d2 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 3 Apr 2018 09:11:25 +0200 Subject: Add a menu with global actions to SmGlobals Use it in the toolbar for FSWidge and hide the menuBar. Change Helper::icon to accept different foreground colors and wether to draw the ellipse. --- fswidget.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'fswidget.cpp') diff --git a/fswidget.cpp b/fswidget.cpp index 117193e..a6073cc 100644 --- a/fswidget.cpp +++ b/fswidget.cpp @@ -21,6 +21,7 @@ #include "fswidget.h" #include "helper.h" +#include "smglobals.h" #include "newmoviewizard.h" #include "newpicsdialog.h" #include "fsproxy.h" @@ -75,10 +76,8 @@ void FSWidget::setupWidget(){ QAction *previewA = new QAction(QIcon(":/snapshot.png"), tr("Preview..."), this); connect(previewA, &QAction::triggered, this, &FSWidget::preview); toolbar->addAction(previewA); - QAction *configA = new QAction(QIcon(":/chastity_belt.png"), tr("Configure"), this); - connect(configA, &QAction::triggered, this, &FSWidget::needConfig); toolbar->addSeparator(); - toolbar->addAction(configA); + toolbar->addAction(SmGlobals::instance()->globalAction()); QAction *playSelectedA = new QAction(QIcon(":/spreadingpants.png"), tr("Play selected"), this); connect(playSelectedA, &QAction::triggered, [=] { playSelected(1, QString()); }); playSelectedA->setShortcut(Qt::Key_Return); @@ -103,8 +102,8 @@ void FSWidget::setupWidget(){ unselectAllA->setShortcut(tr("CTRL+k")); unselectAllA->setData(FSView::InvisibleAction); - QIcon plusIcon = Helper::icon(QColor(255,85,255), '+'); - QIcon minusIcon = Helper::icon(QColor(255,85,255), '-'); + QIcon plusIcon = Helper::icon(QColor(255,85,255), Qt::white, '+', true, true); + QIcon minusIcon = Helper::icon(QColor(255,85,255), Qt::white, '-', true, true); QLabel *dirL = new QLabel(tr("Dir")); mDirCB = new QComboBox; mDirCB->setSizeAdjustPolicy(QComboBox::AdjustToContents); @@ -269,9 +268,9 @@ void FSWidget::gatherData(const QString &curDir){ QStandardItem *root = mModel->invisibleRootItem(); QMimeDatabase mimedb; mModel->setHorizontalHeaderLabels(QStringList() << tr("Name") << tr("MIME") << tr("Size") << tr("Duration") << tr("MD5") << tr("Presence")); - QIcon videoIcon = Helper::icon(QColor(255,85,255), 'M'); - QIcon imageIcon = Helper::icon(QColor(255,85,255), 'P'); - QIcon otherIcon = Helper::icon(QColor(255,85,255), 'O'); + QIcon videoIcon = Helper::icon(QColor(255,85,255), Qt::white, true, true, 'M'); + QIcon imageIcon = Helper::icon(QColor(255,85,255), Qt::white, true, true, 'P'); + QIcon otherIcon = Helper::icon(QColor(255,85,255), Qt::white, true, true, 'O'); QBrush blackBrush(Qt::black); QBrush greenBrush(Qt::darkGreen); QBrush blueBrush(Qt::darkBlue); -- cgit v1.2.3-70-g09d2