Skip to content

Commit

Permalink
Added settings and folder icons (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
VocalFan authored Oct 2, 2023
1 parent 3e331cc commit 39ef3b0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ MainWindow::MainWindow() :
// File menu.
auto fileMenu = menuBar()->addMenu("&File");
auto installPkg = new QAction(QIcon(svgPath + "archive-arrow-down-outline.svg"), "&Install PKG", this);
auto openSystemFolder = new QAction("Open System &Folder", this);
auto openSystemFolder = new QAction(QIcon(svgPath + "folder-open-outline.svg"), "Open System &Folder", this);
auto quit = new QAction("&Quit", this);

connect(installPkg, &QAction::triggered, this, &MainWindow::installPkg);
Expand Down Expand Up @@ -355,12 +355,21 @@ void MainWindow::requestGamesContextMenu(const QPoint &pos)
auto model = reinterpret_cast<GameListModel *>(m_games->model());
auto game = model->get(index.row());

// Determine current theme.
QString svgPath;

if (QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark) {
svgPath = ":/resources/darkmode/";
} else {
svgPath = ":/resources/lightmode/";
}

// Setup menu.
QMenu menu(this);
QAction openFolder("Open Game &Folder", this); // Opens game folder.
QAction settings("&Settings", this); // TODO LATER: Blank Settings
QAction openGameFolder(QIcon(svgPath + "folder-open-outline.svg"), "Open Game &Folder", this); // Opens game folder.
QAction settings(QIcon(svgPath + "cog-outline.svg"), "&Settings", this); // TODO LATER: Blank Settings

menu.addAction(&openFolder);
menu.addAction(&openGameFolder);
menu.addAction(&settings);

// Show menu.
Expand All @@ -370,7 +379,7 @@ void MainWindow::requestGamesContextMenu(const QPoint &pos)
return;
}

if (selected == &openFolder) {
if (selected == &openGameFolder) {
QString folderPath = game->directory();
QDesktopServices::openUrl(QUrl::fromLocalFile(folderPath));
} else if (selected == &settings) {
Expand Down
4 changes: 4 additions & 0 deletions src/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
<qresource>
<file>resources/darkmode/archive-arrow-down-outline.svg</file>
<file>resources/darkmode/card-text-outline.svg</file>
<file>resources/darkmode/cog-outline.svg</file>
<file>resources/darkmode/folder-open-outline.svg</file>
<file>resources/darkmode/view-comfy.svg</file>
<file>resources/lightmode/archive-arrow-down-outline.svg</file>
<file>resources/lightmode/card-text-outline.svg</file>
<file>resources/lightmode/cog-outline.svg</file>
<file>resources/lightmode/folder-open-outline.svg</file>
<file>resources/lightmode/view-comfy.svg</file>
<file>resources/obliteration-icon.png</file>
</qresource>
Expand Down
1 change: 1 addition & 0 deletions src/resources/darkmode/cog-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/resources/darkmode/folder-open-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/resources/lightmode/cog-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/resources/lightmode/folder-open-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 39ef3b0

Please sign in to comment.