Grid Mode + Tool Bar (#2857)
* Grid layout * Add Tiny Mode fix scrolling fix maxGamesPerRow calculation * prime empty toolbar * Add Search Bar, Icon Size and List Mode to ToolBar Fix some minor glitches * fix toolbar save and adjust default margin * fix toolbar regression minor simplification in Refresh * Implement search and rename PopulateUI to PopulateGameList * minor refactoring hehehehehehe * Fix crash * refresh speedboost optimizations * Small refactoring of refresh to have default argument of false. * add icons to toolbar * fix scrambed order * search for serial as well
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 17 KiB |
|
@ -5,5 +5,21 @@
|
|||
<file>Icons/restart.png</file>
|
||||
<file>Icons/stop.png</file>
|
||||
<file>rpcs3.ico</file>
|
||||
<file>Icons/copy_blue.png</file>
|
||||
<file>Icons/disc_blue.png</file>
|
||||
<file>Icons/grid_blue.png</file>
|
||||
<file>Icons/harddisk_blue.png</file>
|
||||
<file>Icons/home_blue.png</file>
|
||||
<file>Icons/info_blue.png</file>
|
||||
<file>Icons/list_blue.png</file>
|
||||
<file>Icons/media_blue.png</file>
|
||||
<file>Icons/copy_gray.png</file>
|
||||
<file>Icons/disc_gray.png</file>
|
||||
<file>Icons/grid_gray.png</file>
|
||||
<file>Icons/harddisk_gray.png</file>
|
||||
<file>Icons/home_gray.png</file>
|
||||
<file>Icons/info_gray.png</file>
|
||||
<file>Icons/list_gray.png</file>
|
||||
<file>Icons/media_gray.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -392,6 +392,11 @@
|
|||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QTGeneratedFiles\Debug - LLVM\moc_game_list_grid.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QTGeneratedFiles\Debug - LLVM\moc_graphics_tab.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
|
@ -532,6 +537,11 @@
|
|||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QTGeneratedFiles\Debug\moc_game_list_grid.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QTGeneratedFiles\Debug\moc_graphics_tab.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
|
@ -682,6 +692,11 @@
|
|||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QTGeneratedFiles\Release - LLVM\moc_game_list_grid.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QTGeneratedFiles\Release - LLVM\moc_graphics_tab.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
|
@ -822,6 +837,11 @@
|
|||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QTGeneratedFiles\Release\moc_game_list_grid.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QTGeneratedFiles\Release\moc_graphics_tab.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
|
@ -917,6 +937,8 @@
|
|||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="rpcs3qt\game_list_grid.cpp" />
|
||||
<ClCompile Include="rpcs3qt\game_list_grid_delegate.cpp" />
|
||||
<ClCompile Include="rpcs3qt\welcome_dialog.cpp" />
|
||||
<ClCompile Include="rpcs3_app.cpp" />
|
||||
<ClCompile Include="rpcs3qt\audio_tab.cpp" />
|
||||
|
@ -1387,6 +1409,25 @@
|
|||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">$(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="rpcs3qt\game_list_grid.h">
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">Moc%27ing game_list_grid.h...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">.\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DNDEBUG -DQT_WINEXTRAS_LIB -DLLVM_AVAILABLE -D_UNICODE "-I.\..\Vulkan\Vulkan-LoaderAndValidationLayers\include" "-I.\..\3rdparty\minidx12\Include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtQuick" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtQml" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2015" "-I.\QTGeneratedFiles\$(ConfigurationName)\." "-I.\QTGeneratedFiles" "-I$(QTDIR)\include\QtWinExtras" "-I$(NOINHERIT)\."</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Moc%27ing game_list_grid.h...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_WINEXTRAS_LIB -D_SCL_SECURE_NO_WARNINGS -D_UNICODE "-I.\..\Vulkan\Vulkan-LoaderAndValidationLayers\include" "-I.\.." "-I.\..\3rdparty\minidx12\Include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtQuick" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtQml" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2015" "-I.\QTGeneratedFiles\$(ConfigurationName)\." "-I.\QTGeneratedFiles" "-I$(QTDIR)\include\QtWinExtras" "-I$(NOINHERIT)\."</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Moc%27ing game_list_grid.h...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DNDEBUG -DQT_WINEXTRAS_LIB -D_UNICODE "-I.\..\Vulkan\Vulkan-LoaderAndValidationLayers\include" "-I.\..\3rdparty\minidx12\Include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtQuick" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtQml" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2015" "-I.\QTGeneratedFiles\$(ConfigurationName)\." "-I.\QTGeneratedFiles" "-I$(QTDIR)\include\QtWinExtras" "-I$(NOINHERIT)\."</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">Moc%27ing game_list_grid.h...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">.\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_WINEXTRAS_LIB -DLLVM_AVAILABLE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE "-I.\..\Vulkan\Vulkan-LoaderAndValidationLayers\include" "-I.\.." "-I.\..\3rdparty\minidx12\Include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtOpenGL" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtQuick" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtQml" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtCore" "-I.\debug" "-I$(QTDIR)\mkspecs\win32-msvc2015" "-I.\QTGeneratedFiles\$(ConfigurationName)\." "-I.\QTGeneratedFiles" "-I$(QTDIR)\include\QtWinExtras" "-I$(NOINHERIT)\."</Command>
|
||||
</CustomBuild>
|
||||
<ClInclude Include="rpcs3qt\game_list_grid_delegate.h" />
|
||||
<ClInclude Include="rpcs3qt\gl_gs_frame.h" />
|
||||
<ClInclude Include="rpcs3qt\instruction_editor_dialog.h" />
|
||||
<ClInclude Include="rpcs3qt\memory_viewer_panel.h" />
|
||||
|
|
|
@ -513,6 +513,24 @@
|
|||
<ClCompile Include="QTGeneratedFiles\Debug - LLVM\moc_welcome_dialog.cpp">
|
||||
<Filter>Generated Files\Debug - LLVM</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="rpcs3qt\game_list_grid.cpp">
|
||||
<Filter>Gui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QTGeneratedFiles\Release - LLVM\moc_game_list_grid.cpp">
|
||||
<Filter>Generated Files\Release - LLVM</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QTGeneratedFiles\Debug\moc_game_list_grid.cpp">
|
||||
<Filter>Generated Files\Debug</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QTGeneratedFiles\Release\moc_game_list_grid.cpp">
|
||||
<Filter>Generated Files\Release</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QTGeneratedFiles\Debug - LLVM\moc_game_list_grid.cpp">
|
||||
<Filter>Generated Files\Debug - LLVM</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="rpcs3qt\game_list_grid_delegate.cpp">
|
||||
<Filter>Gui</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="\Gui\*.h">
|
||||
|
@ -549,6 +567,9 @@
|
|||
<ClInclude Include="rpcs3qt\register_editor_dialog.h">
|
||||
<Filter>Gui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="rpcs3qt\game_list_grid_delegate.h">
|
||||
<Filter>Gui</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="debug\moc_predefs.h.cbt">
|
||||
|
@ -644,5 +665,8 @@
|
|||
<CustomBuild Include="rpcs3qt\welcome_dialog.h">
|
||||
<Filter>Gui</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="rpcs3qt\game_list_grid.h">
|
||||
<Filter>Gui</Filter>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -4,63 +4,19 @@
|
|||
#include "stdafx.h"
|
||||
#include "Emu/GameInfo.h"
|
||||
|
||||
#include "game_list_grid.h"
|
||||
#include "gui_settings.h"
|
||||
#include "emu_settings.h"
|
||||
|
||||
#include <QDockWidget>
|
||||
#include <QList>
|
||||
#include <QTableWidget>
|
||||
#include <QMainWindow>
|
||||
#include <QToolBar>
|
||||
#include <QLineEdit>
|
||||
#include <QStackedWidget>
|
||||
|
||||
struct Column
|
||||
{
|
||||
u32 pos;
|
||||
u32 width;
|
||||
bool shown;
|
||||
std::vector<std::string> data;
|
||||
|
||||
const std::string name;
|
||||
const u32 def_pos;
|
||||
const u32 def_width;
|
||||
|
||||
Column(const u32 _def_pos, const u32 _def_width, const std::string& _name)
|
||||
: def_pos(_def_pos)
|
||||
, def_width(_def_width)
|
||||
, pos(_def_pos)
|
||||
, width(_def_width)
|
||||
, shown(true)
|
||||
, name(_name)
|
||||
{
|
||||
data.clear();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct columns_arr
|
||||
{
|
||||
std::vector<Column> m_columns;
|
||||
|
||||
columns_arr(){};
|
||||
columns_arr(QSize icon_Size);
|
||||
|
||||
Column* GetColumnByPos(u32 pos);
|
||||
|
||||
public:
|
||||
Column* m_col_icon;
|
||||
Column* m_col_name;
|
||||
Column* m_col_serial;
|
||||
Column* m_col_fw;
|
||||
Column* m_col_app_ver;
|
||||
Column* m_col_category;
|
||||
Column* m_col_path;
|
||||
|
||||
QSize m_Icon_Size;
|
||||
QList<QImage*>* m_img_list;
|
||||
std::vector<int> m_icon_indexes;
|
||||
|
||||
void Update(const std::vector<GameInfo>& game_data);
|
||||
|
||||
void ShowData(QTableWidget* list);
|
||||
};
|
||||
#include <memory>
|
||||
|
||||
namespace category
|
||||
{
|
||||
|
@ -72,23 +28,28 @@ namespace category
|
|||
const QString unknown = QObject::tr("Unknown");
|
||||
}
|
||||
|
||||
/* Having the icons associated with the game info simplifies logic internally */
|
||||
typedef struct GUI_GameInfo
|
||||
{
|
||||
GameInfo info;
|
||||
QImage icon;
|
||||
QPixmap pxmap;
|
||||
};
|
||||
|
||||
typedef struct Tool_Bar_Button
|
||||
{
|
||||
QAction* action;
|
||||
QIcon colored;
|
||||
QIcon gray;
|
||||
};
|
||||
|
||||
class game_list_frame : public QDockWidget {
|
||||
Q_OBJECT
|
||||
|
||||
int m_sortColumn;
|
||||
bool m_sortAscending;
|
||||
std::vector<std::string> m_games;
|
||||
std::vector<GameInfo> m_game_data;
|
||||
gui_settings* m_gui_settings = new gui_settings(this);
|
||||
QSize m_Icon_Size;
|
||||
columns_arr m_columns;
|
||||
QStringList m_categoryFilters;
|
||||
Render_Creator m_Render_Creator;
|
||||
|
||||
public:
|
||||
explicit game_list_frame(std::shared_ptr<gui_settings> settings, Render_Creator r_Creator, QWidget *parent = nullptr);
|
||||
~game_list_frame();
|
||||
void Refresh();
|
||||
void Refresh(const bool fromDrive = false);
|
||||
void ToggleCategoryFilter(QString category, bool show);
|
||||
|
||||
/** Loads from settings. Public so that main frame can easily reset these settings if needed. */
|
||||
|
@ -99,31 +60,46 @@ public:
|
|||
|
||||
public slots:
|
||||
/** Resize Gamelist Icons to size */
|
||||
void ResizeIcons(QSize size);
|
||||
void ResizeIcons(const QSize& size, const int& idx);
|
||||
void SetListMode(const bool& isList);
|
||||
void SetToolBarVisible(const bool& showToolBar);
|
||||
void SetCategoryActIcon(const int& id, const bool& active);
|
||||
|
||||
private slots:
|
||||
void Boot(int row);
|
||||
void RemoveCustomConfiguration(int row);
|
||||
|
||||
void OnColClicked(int col);
|
||||
|
||||
void ShowContextMenu(const QPoint &pos);
|
||||
void ShowSpecifiedContextMenu(const QPoint &pos, int index); // Different name because the notation for overloaded connects is messy
|
||||
void doubleClickedSlot(const QModelIndex& index);
|
||||
signals:
|
||||
void game_list_frameClosed();
|
||||
void RequestIconPathSet(const std::string path);
|
||||
void RequestAddRecentGame(const q_string_pair& entry);
|
||||
void RequestIconSizeActSet(const int& idx);
|
||||
void RequestListModeActSet(const bool& isList);
|
||||
void RequestCategoryActSet(const int& id);
|
||||
protected:
|
||||
/** Override inherited method from Qt to allow signalling when close happened.*/
|
||||
void closeEvent(QCloseEvent* event);
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
private:
|
||||
QTableWidget *gameList;
|
||||
|
||||
void ShowContextMenu(const QPoint &pos);
|
||||
void doubleClickedSlot(const QModelIndex& index);
|
||||
|
||||
void LoadGames();
|
||||
void LoadPSF();
|
||||
void ShowData();
|
||||
game_list_grid* MakeGrid(uint maxCols, const QSize& image_size);
|
||||
void FilterData();
|
||||
|
||||
void PopulateGameList();
|
||||
bool SearchMatchesApp(const std::string& name, const std::string& serial);
|
||||
|
||||
// Which widget we are displaying depends on if we are in grid or list mode.
|
||||
QMainWindow* m_Game_Dock;
|
||||
QStackedWidget* m_Central_Widget;
|
||||
QToolBar* m_Tool_Bar;
|
||||
QLineEdit* m_Search_Bar;
|
||||
QSlider* m_Slider_Size;
|
||||
QTableWidget *gameList;
|
||||
std::unique_ptr<game_list_grid> m_xgrid;
|
||||
|
||||
// Actions regarding showing/hiding columns
|
||||
QAction* showIconColAct;
|
||||
QAction* showNameColAct;
|
||||
|
@ -134,7 +110,41 @@ private:
|
|||
QAction* showPathColAct;
|
||||
|
||||
QList<QAction*> columnActs;
|
||||
|
||||
// Actions regarding showing/hiding categories
|
||||
Tool_Bar_Button m_catActHDD;
|
||||
Tool_Bar_Button m_catActDisc;
|
||||
Tool_Bar_Button m_catActHome;
|
||||
Tool_Bar_Button m_catActGameData;
|
||||
Tool_Bar_Button m_catActAudioVideo;
|
||||
Tool_Bar_Button m_catActUnknown;
|
||||
|
||||
QList<Tool_Bar_Button> m_categoryButtons;
|
||||
|
||||
QActionGroup* m_categoryActs;
|
||||
|
||||
// Actions regarding switching list modes
|
||||
Tool_Bar_Button m_modeActList;
|
||||
Tool_Bar_Button m_modeActGrid;
|
||||
|
||||
QActionGroup* m_modeActs;
|
||||
|
||||
// TODO: Reorganize this into a sensible order for private variables.
|
||||
std::shared_ptr<gui_settings> xgui_settings;
|
||||
|
||||
int m_sortColumn;
|
||||
Qt::SortOrder m_colSortOrder;
|
||||
bool m_isListLayout = true;
|
||||
bool m_showToolBar = true;
|
||||
std::vector<GUI_GameInfo> m_game_data;
|
||||
QSize m_Icon_Size;
|
||||
QString m_Icon_Size_Str;
|
||||
qreal m_Margin_Factor;
|
||||
qreal m_Text_Factor;
|
||||
QStringList m_categoryFilters;
|
||||
Render_Creator m_Render_Creator;
|
||||
|
||||
uint m_games_per_row = 0;
|
||||
};
|
||||
|
||||
#endif // GAMELISTFRAME_H
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
#include "game_list_grid.h"
|
||||
#include "game_list_grid_delegate.h"
|
||||
|
||||
#include <QHeaderView>
|
||||
|
||||
game_list_grid::game_list_grid(const QSize& icon_size, const qreal& margin_factor, const qreal& text_factor, const bool& showText)
|
||||
: QTableWidget(), m_icon_size(icon_size), m_margin_factor(margin_factor), m_text_factor(text_factor), m_text_enabled(showText)
|
||||
{
|
||||
QSize item_size;
|
||||
if (m_text_enabled)
|
||||
{
|
||||
item_size = m_icon_size + QSize(m_icon_size.width() * m_margin_factor * 2, m_icon_size.height() * m_margin_factor * (m_text_factor + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
item_size = m_icon_size + m_icon_size * m_margin_factor * 2;
|
||||
}
|
||||
|
||||
grid_item_delegate = new game_list_grid_delegate(item_size, m_margin_factor, m_text_factor, this);
|
||||
setItemDelegate(grid_item_delegate);
|
||||
setSelectionBehavior(QAbstractItemView::SelectItems);
|
||||
setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
verticalHeader()->setVisible(false);
|
||||
horizontalHeader()->setVisible(false);
|
||||
setShowGrid(false);
|
||||
}
|
||||
|
||||
game_list_grid::~game_list_grid()
|
||||
{
|
||||
}
|
||||
|
||||
void game_list_grid::enableText(const bool& enabled)
|
||||
{
|
||||
m_text_enabled = enabled;
|
||||
}
|
||||
|
||||
void game_list_grid::setIconSize(const QSize& size)
|
||||
{
|
||||
if (m_text_enabled)
|
||||
{
|
||||
grid_item_delegate->setItemSize(size + QSize(size.width() * m_margin_factor * 2, size.height() * m_margin_factor * (m_text_factor + 1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
grid_item_delegate->setItemSize(size + size * m_margin_factor * 2);
|
||||
}
|
||||
}
|
||||
|
||||
void game_list_grid::addItem(const QPixmap& img, const QString& name, const int& idx, const int& row, const int& col)
|
||||
{
|
||||
// define size of expanded image, which is raw image size + margins
|
||||
QSize exp_size;
|
||||
if (m_text_enabled)
|
||||
{
|
||||
exp_size = m_icon_size + QSize(m_icon_size.width() * m_margin_factor * 2, m_icon_size.height() * m_margin_factor * (m_text_factor + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
exp_size = m_icon_size + m_icon_size * m_margin_factor * 2;
|
||||
}
|
||||
|
||||
// define offset for raw image placement
|
||||
QPoint offset = QPoint(m_icon_size.width() * m_margin_factor, m_icon_size.height() * m_margin_factor);
|
||||
|
||||
// create empty canvas for expanded image
|
||||
QImage exp_img = QImage(exp_size, QImage::Format_ARGB32);
|
||||
exp_img.fill(Qt::transparent);
|
||||
|
||||
// place raw image inside expanded image
|
||||
QPainter painter(&exp_img);
|
||||
painter.drawPixmap(offset, img);
|
||||
painter.end();
|
||||
|
||||
// create item with expanded image, title and position
|
||||
QTableWidgetItem* item = new QTableWidgetItem();
|
||||
item->setData(Qt::ItemDataRole::DecorationRole, QPixmap::fromImage(exp_img));
|
||||
item->setData(Qt::ItemDataRole::UserRole, idx);
|
||||
item->setData(Qt::ItemDataRole::ToolTipRole, name);
|
||||
if (m_text_enabled) { item->setData(Qt::ItemDataRole::DisplayRole, name); }
|
||||
setItem(row, col, item);
|
||||
}
|
||||
|
||||
qreal game_list_grid::getMarginFactor()
|
||||
{
|
||||
return m_margin_factor;
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
#ifndef GAME_LIST_GRID_H
|
||||
#define GAME_LIST_GRID_H
|
||||
|
||||
#include "game_list_grid_delegate.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
#include <QScrollArea>
|
||||
#include <QString>
|
||||
#include <QTableWidget>
|
||||
|
||||
class game_list_grid : public QTableWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QSize m_icon_size;
|
||||
qreal m_margin_factor;
|
||||
qreal m_text_factor;
|
||||
bool m_text_enabled = true;
|
||||
|
||||
public:
|
||||
explicit game_list_grid(const QSize& icon_size, const qreal& margin_factor, const qreal& text_factor, const bool& showText);
|
||||
~game_list_grid();
|
||||
|
||||
void enableText(const bool& enabled);
|
||||
void setIconSize(const QSize& size);
|
||||
void addItem(const QPixmap& img, const QString& name, const int& idx, const int& row, const int& col);
|
||||
|
||||
qreal getMarginFactor();
|
||||
|
||||
private:
|
||||
game_list_grid_delegate* grid_item_delegate;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,54 @@
|
|||
#include "game_list_grid_delegate.h"
|
||||
|
||||
game_list_grid_delegate::game_list_grid_delegate(const QSize& size, const qreal& margin_factor, const qreal& text_factor, QObject *parent)
|
||||
: QAbstractItemDelegate(parent), m_size(size), m_margin_factor(margin_factor), m_text_factor(text_factor)
|
||||
{
|
||||
}
|
||||
|
||||
game_list_grid_delegate::~game_list_grid_delegate()
|
||||
{
|
||||
}
|
||||
|
||||
void game_list_grid_delegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
|
||||
{
|
||||
QRect r = option.rect;
|
||||
|
||||
painter->eraseRect(r);
|
||||
|
||||
//Color: #333
|
||||
QPen fontPen(QColor::fromRgb(51, 51, 51), 1, Qt::SolidLine);
|
||||
|
||||
//Get title and image
|
||||
QPixmap image = (qvariant_cast<QPixmap>(index.data(Qt::DecorationRole)));
|
||||
QString title = index.data(Qt::DisplayRole).toString();
|
||||
|
||||
// image
|
||||
if (image.isNull() == false)
|
||||
{
|
||||
painter->drawPixmap(r, image);
|
||||
}
|
||||
|
||||
// Add selection overlay
|
||||
if (option.state & QStyle::State_Selected)
|
||||
{
|
||||
QLinearGradient gradientSelected(r.left(), r.top(), r.left(), r.height() + r.top());
|
||||
gradientSelected.setColorAt(0.0, QColor::fromRgba(qRgba(119, 213, 247, 128)));
|
||||
gradientSelected.setColorAt(0.9, QColor::fromRgba(qRgba(27, 134, 183, 128)));
|
||||
gradientSelected.setColorAt(1.0, QColor::fromRgba(qRgba(0, 120, 174, 128)));
|
||||
painter->fillRect(r, gradientSelected);
|
||||
}
|
||||
|
||||
int h = r.height() / (1 + m_margin_factor + m_margin_factor*m_text_factor);
|
||||
int height = r.height() - h - h * m_margin_factor;
|
||||
int top = r.bottom() - height;
|
||||
|
||||
// title
|
||||
painter->setPen(fontPen);
|
||||
painter->setFont(QFont("Lucida Grande", 8, QFont::DemiBold));
|
||||
painter->drawText(QRect(r.left(), top, r.width(), height), Qt::TextWordWrap | Qt::AlignCenter, title);
|
||||
}
|
||||
|
||||
QSize game_list_grid_delegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
|
||||
{
|
||||
return m_size;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef GAME_LIST_GRID_DELEGATE
|
||||
#define GAME_LIST_GRID_DELEGATE
|
||||
|
||||
#include <QPainter>
|
||||
#include <QAbstractItemDelegate>
|
||||
|
||||
class game_list_grid_delegate : public QAbstractItemDelegate
|
||||
{
|
||||
public:
|
||||
game_list_grid_delegate(const QSize& imageSize, const qreal& margin_factor, const qreal& margin_ratio, QObject *parent = 0);
|
||||
|
||||
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
|
||||
QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
|
||||
void setItemSize(const QSize& size) { m_size = size; };
|
||||
virtual ~game_list_grid_delegate();
|
||||
private:
|
||||
QSize m_size;
|
||||
qreal m_margin_factor;
|
||||
qreal m_text_factor;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -28,15 +28,19 @@ typedef struct GUI_SAVE
|
|||
|
||||
typedef std::map<const QString, const QSize> icon_size;
|
||||
typedef QPair<QString, QString> q_string_pair;
|
||||
typedef QPair<QString, QSize> q_size_pair;
|
||||
typedef QList<q_string_pair> q_pair_list;
|
||||
typedef QList<q_size_pair> q_size_list;
|
||||
|
||||
namespace GUI
|
||||
{
|
||||
const QString gl_icon_key_tiny = "tiny";
|
||||
const QString gl_icon_key_small = "small";
|
||||
const QString gl_icon_key_medium = "medium";
|
||||
const QString gl_icon_key_large = "large";
|
||||
|
||||
const icon_size gl_icon_size = {
|
||||
const q_size_list gl_icon_size = {
|
||||
{ gl_icon_key_tiny, QSize(40, 22) },
|
||||
{ gl_icon_key_small, QSize(80, 44) },
|
||||
{ gl_icon_key_medium, QSize(160, 88) },
|
||||
{ gl_icon_key_large, QSize(320, 176) }
|
||||
|
@ -50,9 +54,9 @@ namespace GUI
|
|||
const GUI_SAVE rg_freeze = GUI_SAVE(main_window, "recentGamesFrozen", false);
|
||||
const GUI_SAVE rg_entries = GUI_SAVE(main_window, "recentGamesNames", QVariant::fromValue(q_pair_list()));
|
||||
|
||||
const GUI_SAVE ib_pkg_success = GUI_SAVE( main_window, "infoBoxEnabledInstallPKG", true );
|
||||
const GUI_SAVE ib_pup_success = GUI_SAVE( main_window, "infoBoxEnabledInstallPUP", true );
|
||||
const GUI_SAVE ib_show_welcome = GUI_SAVE(main_window, "infoBoxEnabledWelcome", true);
|
||||
const GUI_SAVE ib_pkg_success = GUI_SAVE( main_window, "infoBoxEnabledInstallPKG", true );
|
||||
const GUI_SAVE ib_pup_success = GUI_SAVE( main_window, "infoBoxEnabledInstallPUP", true );
|
||||
const GUI_SAVE ib_show_welcome = GUI_SAVE( main_window, "infoBoxEnabledWelcome", true );
|
||||
|
||||
const GUI_SAVE fd_install_pkg = GUI_SAVE( main_window, "lastExplorePathPKG", "" );
|
||||
const GUI_SAVE fd_install_pup = GUI_SAVE( main_window, "lastExplorePathPUP", "" );
|
||||
|
@ -75,10 +79,14 @@ namespace GUI
|
|||
const GUI_SAVE cat_unknown = GUI_SAVE( game_list, "categoryVisibleUnknown", true );
|
||||
const GUI_SAVE cat_other = GUI_SAVE( game_list, "categoryVisibleOther", true );
|
||||
|
||||
const GUI_SAVE gl_sortAsc = GUI_SAVE( game_list, "sortAsc", true );
|
||||
const GUI_SAVE gl_sortCol = GUI_SAVE( game_list, "sortCol", 1 );
|
||||
const GUI_SAVE gl_state = GUI_SAVE( game_list, "state", QByteArray() );
|
||||
const GUI_SAVE gl_iconSize = GUI_SAVE( game_list, "iconSize", gl_icon_key_small);
|
||||
const GUI_SAVE gl_sortAsc = GUI_SAVE( game_list, "sortAsc", true );
|
||||
const GUI_SAVE gl_sortCol = GUI_SAVE( game_list, "sortCol", 1 );
|
||||
const GUI_SAVE gl_state = GUI_SAVE( game_list, "state", QByteArray() );
|
||||
const GUI_SAVE gl_iconSize = GUI_SAVE( game_list, "iconSize", gl_icon_key_small );
|
||||
const GUI_SAVE gl_listMode = GUI_SAVE( game_list, "listMode", true );
|
||||
const GUI_SAVE gl_textFactor = GUI_SAVE( game_list, "textFactor", (qreal) 2.0 );
|
||||
const GUI_SAVE gl_marginFactor = GUI_SAVE( game_list, "marginFactor", (qreal) 0.09 );
|
||||
const GUI_SAVE gl_toolBarVisible = GUI_SAVE( game_list, "toolBarVisible", true );
|
||||
|
||||
const GUI_SAVE l_tty = GUI_SAVE( logger, "TTY", true );
|
||||
const GUI_SAVE l_level = GUI_SAVE( logger, "level", (uint)(logs::level::success) );
|
||||
|
|
|
@ -351,7 +351,7 @@ void main_window::InstallPkg()
|
|||
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
|
||||
{
|
||||
fs::remove_all(local_path);
|
||||
gameListFrame->Refresh();
|
||||
gameListFrame->Refresh(true);
|
||||
LOG_SUCCESS(LOADER, "PKG: removed incomplete installation in %s", local_path);
|
||||
return;
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ void main_window::InstallPkg()
|
|||
|
||||
if (progress >= 1.)
|
||||
{
|
||||
gameListFrame->Refresh();
|
||||
gameListFrame->Refresh(true);
|
||||
LOG_SUCCESS(GENERAL, "Successfully installed %s.", fileName);
|
||||
guiSettings->ShowInfoBox(GUI::ib_pkg_success, tr("Success!"), tr("Successfully installed software from package!"), this);
|
||||
|
||||
|
@ -1027,6 +1027,9 @@ void main_window::CreateActions()
|
|||
showControlsAct = new QAction(tr("Show Controls"), this);
|
||||
showControlsAct->setCheckable(true);
|
||||
|
||||
showGameListToolBarAct = new QAction(tr("Show Tool Bar"), this);
|
||||
showGameListToolBarAct->setCheckable(true);
|
||||
|
||||
refreshGameListAct = new QAction(tr("&Refresh Game List"), this);
|
||||
|
||||
showCatHDDGameAct = new QAction(category::hdd_Game, this);
|
||||
|
@ -1047,6 +1050,18 @@ void main_window::CreateActions()
|
|||
showCatUnknownAct = new QAction(category::unknown, this);
|
||||
showCatUnknownAct->setCheckable(true);
|
||||
|
||||
categoryVisibleActGroup = new QActionGroup(this);
|
||||
categoryVisibleActGroup->addAction(showCatHDDGameAct);
|
||||
categoryVisibleActGroup->addAction(showCatDiscGameAct);
|
||||
categoryVisibleActGroup->addAction(showCatHomeAct);
|
||||
categoryVisibleActGroup->addAction(showCatAudioVideoAct);
|
||||
categoryVisibleActGroup->addAction(showCatGameDataAct);
|
||||
categoryVisibleActGroup->addAction(showCatUnknownAct);
|
||||
categoryVisibleActGroup->setExclusive(false);
|
||||
|
||||
setIconSizeTinyAct = new QAction(tr("Tiny"), this);
|
||||
setIconSizeTinyAct->setCheckable(true);
|
||||
|
||||
setIconSizeSmallAct = new QAction(tr("Small"), this);
|
||||
setIconSizeSmallAct->setCheckable(true);
|
||||
|
||||
|
@ -1057,11 +1072,23 @@ void main_window::CreateActions()
|
|||
setIconSizeLargeAct->setCheckable(true);
|
||||
|
||||
iconSizeActGroup = new QActionGroup(this);
|
||||
iconSizeActGroup->addAction(setIconSizeTinyAct);
|
||||
iconSizeActGroup->addAction(setIconSizeSmallAct);
|
||||
iconSizeActGroup->addAction(setIconSizeMediumAct);
|
||||
iconSizeActGroup->addAction(setIconSizeLargeAct);
|
||||
setIconSizeSmallAct->setChecked(true);
|
||||
|
||||
setlistModeListAct = new QAction(tr("List"), this);
|
||||
setlistModeListAct->setCheckable(true);
|
||||
|
||||
setlistModeGridAct = new QAction(tr("Grid"), this);
|
||||
setlistModeGridAct->setCheckable(true);
|
||||
|
||||
listModeActGroup = new QActionGroup(this);
|
||||
listModeActGroup->addAction(setlistModeListAct);
|
||||
listModeActGroup->addAction(setlistModeGridAct);
|
||||
setlistModeListAct->setChecked(true);
|
||||
|
||||
aboutAct = new QAction(tr("&About"), this);
|
||||
aboutAct->setStatusTip(tr("Show the application's About box"));
|
||||
|
||||
|
@ -1166,32 +1193,27 @@ void main_window::CreateConnects()
|
|||
checked ? controls->show() : controls->hide();
|
||||
guiSettings->SetValue(GUI::mw_controls, checked);
|
||||
});
|
||||
connect(showGameListToolBarAct, &QAction::triggered, this, [=](bool checked){
|
||||
gameListFrame->SetToolBarVisible(checked);
|
||||
});
|
||||
connect(refreshGameListAct, &QAction::triggered, [=](){
|
||||
gameListFrame->Refresh();
|
||||
gameListFrame->Refresh(true);
|
||||
});
|
||||
connect(showCatHDDGameAct, &QAction::triggered, [=](bool checked){
|
||||
gameListFrame->ToggleCategoryFilter(category::hdd_Game, checked);
|
||||
guiSettings->SetCategoryVisibility(category::hdd_Game, checked);
|
||||
});
|
||||
connect(showCatDiscGameAct, &QAction::triggered, [=](bool checked){
|
||||
gameListFrame->ToggleCategoryFilter(category::disc_Game, checked);
|
||||
guiSettings->SetCategoryVisibility(category::disc_Game, checked);
|
||||
});
|
||||
connect(showCatHomeAct, &QAction::triggered, [=](bool checked){
|
||||
gameListFrame->ToggleCategoryFilter(category::home, checked);
|
||||
guiSettings->SetCategoryVisibility(category::home, checked);
|
||||
});
|
||||
connect(showCatAudioVideoAct, &QAction::triggered, [=](bool checked){
|
||||
gameListFrame->ToggleCategoryFilter(category::audio_Video, checked);
|
||||
guiSettings->SetCategoryVisibility(category::audio_Video, checked);
|
||||
});
|
||||
connect(showCatGameDataAct, &QAction::triggered, [=](bool checked){
|
||||
gameListFrame->ToggleCategoryFilter(category::game_Data, checked);
|
||||
guiSettings->SetCategoryVisibility(category::game_Data, checked);
|
||||
});
|
||||
connect(showCatUnknownAct, &QAction::triggered, [=](bool checked) {
|
||||
gameListFrame->ToggleCategoryFilter(category::unknown, checked);
|
||||
guiSettings->SetCategoryVisibility(category::unknown, checked);
|
||||
connect(categoryVisibleActGroup, &QActionGroup::triggered, [=](QAction* act)
|
||||
{
|
||||
QString cat;
|
||||
const bool& checked = act->isChecked();
|
||||
|
||||
if (act == showCatHDDGameAct) cat = category::hdd_Game;
|
||||
else if (act == showCatDiscGameAct) cat = category::disc_Game;
|
||||
else if (act == showCatHomeAct) cat = category::home;
|
||||
else if (act == showCatAudioVideoAct) cat = category::audio_Video;
|
||||
else if (act == showCatGameDataAct) cat = category::game_Data;
|
||||
else if (act == showCatUnknownAct) cat = category::unknown;
|
||||
|
||||
gameListFrame->SetCategoryActIcon(categoryVisibleActGroup->actions().indexOf(act), checked);
|
||||
gameListFrame->ToggleCategoryFilter(cat, checked);
|
||||
guiSettings->SetCategoryVisibility(cat, checked);
|
||||
});
|
||||
connect(aboutAct, &QAction::triggered, this, &main_window::About);
|
||||
connect(aboutQtAct, &QAction::triggered, qApp, &QApplication::aboutQt);
|
||||
|
@ -1207,10 +1229,37 @@ void main_window::CreateConnects()
|
|||
|
||||
if (act == setIconSizeLargeAct) key = GUI::gl_icon_key_large;
|
||||
else if (act == setIconSizeMediumAct) key = GUI::gl_icon_key_medium;
|
||||
else key = GUI::gl_icon_key_small;
|
||||
else if (act == setIconSizeSmallAct) key = GUI::gl_icon_key_small;
|
||||
else key = GUI::gl_icon_key_tiny;
|
||||
|
||||
guiSettings->SetValue(GUI::gl_iconSize, key);
|
||||
gameListFrame->ResizeIcons(GUI::gl_icon_size.at(key));
|
||||
|
||||
for (int i = 0; i < GUI::gl_icon_size.count(); i++)
|
||||
{
|
||||
if (GUI::gl_icon_size.at(i).first == key)
|
||||
{
|
||||
gameListFrame->ResizeIcons(GUI::gl_icon_size.at(i).second, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
connect (gameListFrame, &game_list_frame::RequestIconSizeActSet, [=](const int& idx)
|
||||
{
|
||||
iconSizeActGroup->actions().at(idx)->trigger();
|
||||
});
|
||||
connect(gameListFrame, &game_list_frame::RequestListModeActSet, [=](const bool& isList)
|
||||
{
|
||||
isList ? setlistModeListAct->trigger() : setlistModeGridAct->trigger();
|
||||
});
|
||||
connect(gameListFrame, &game_list_frame::RequestCategoryActSet, [=](const int& id)
|
||||
{
|
||||
categoryVisibleActGroup->actions().at(id)->trigger();
|
||||
});
|
||||
connect(listModeActGroup, &QActionGroup::triggered, [=](QAction* act)
|
||||
{
|
||||
bool isList = act == setlistModeListAct;
|
||||
gameListFrame->SetListMode(isList);
|
||||
categoryVisibleActGroup->setEnabled(isList);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1261,20 +1310,17 @@ void main_window::CreateMenus()
|
|||
viewMenu->addAction(showControlsAct);
|
||||
viewMenu->addSeparator();
|
||||
viewMenu->addAction(showGameListAct);
|
||||
viewMenu->addAction(showGameListToolBarAct);
|
||||
viewMenu->addAction(refreshGameListAct);
|
||||
|
||||
QMenu *categoryMenu = viewMenu->addMenu(tr("Show Categories"));
|
||||
categoryMenu->addAction(showCatHDDGameAct);
|
||||
categoryMenu->addAction(showCatDiscGameAct);
|
||||
categoryMenu->addAction(showCatHomeAct);
|
||||
categoryMenu->addAction(showCatAudioVideoAct);
|
||||
categoryMenu->addAction(showCatGameDataAct);
|
||||
categoryMenu->addAction(showCatUnknownAct);
|
||||
categoryMenu->addActions(categoryVisibleActGroup->actions());
|
||||
|
||||
QMenu *iconSizeMenu = viewMenu->addMenu(tr("Icon Size"));
|
||||
iconSizeMenu->addAction(setIconSizeSmallAct);
|
||||
iconSizeMenu->addAction(setIconSizeMediumAct);
|
||||
iconSizeMenu->addAction(setIconSizeLargeAct);
|
||||
iconSizeMenu->addActions(iconSizeActGroup->actions());
|
||||
|
||||
QMenu *listModeMenu = viewMenu->addMenu(tr("Game List Mode"));
|
||||
listModeMenu->addActions(listModeActGroup->actions());
|
||||
|
||||
QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
|
||||
helpMenu->addAction(aboutAct);
|
||||
|
@ -1385,6 +1431,7 @@ void main_window::ConfigureGuiFromSettings(bool configureAll)
|
|||
showGameListAct->setChecked(guiSettings->GetValue(GUI::mw_gamelist).toBool());
|
||||
showDebuggerAct->setChecked(guiSettings->GetValue(GUI::mw_debugger).toBool());
|
||||
showControlsAct->setChecked(guiSettings->GetValue(GUI::mw_controls).toBool());
|
||||
showGameListToolBarAct->setChecked(guiSettings->GetValue(GUI::gl_toolBarVisible).toBool());
|
||||
guiSettings->GetValue(GUI::mw_controls).toBool() ? controls->show() : controls->hide();
|
||||
|
||||
showCatHDDGameAct->setChecked(guiSettings->GetCategoryVisibility(category::hdd_Game));
|
||||
|
@ -1397,7 +1444,15 @@ void main_window::ConfigureGuiFromSettings(bool configureAll)
|
|||
QString key = guiSettings->GetValue(GUI::gl_iconSize).toString();
|
||||
if (key == GUI::gl_icon_key_large) setIconSizeLargeAct->setChecked(true);
|
||||
else if (key == GUI::gl_icon_key_medium) setIconSizeMediumAct->setChecked(true);
|
||||
else setIconSizeSmallAct->setChecked(true);
|
||||
else if (key == GUI::gl_icon_key_small) setIconSizeSmallAct->setChecked(true);
|
||||
else setIconSizeTinyAct->setChecked(true);
|
||||
|
||||
|
||||
bool isListMode = guiSettings->GetValue(GUI::gl_listMode).toBool();
|
||||
if (isListMode) setlistModeListAct->setChecked(true);
|
||||
else setlistModeGridAct->setChecked(true);
|
||||
categoryVisibleActGroup->setEnabled(isListMode);
|
||||
|
||||
|
||||
if (configureAll)
|
||||
{
|
||||
|
|
|
@ -98,6 +98,8 @@ private:
|
|||
QList<QAction*> m_recentGameActs;
|
||||
|
||||
QActionGroup* iconSizeActGroup;
|
||||
QActionGroup* listModeActGroup;
|
||||
QActionGroup* categoryVisibleActGroup;
|
||||
|
||||
QAction *bootElfAct;
|
||||
QAction *bootGameAct;
|
||||
|
@ -125,15 +127,19 @@ private:
|
|||
QAction *showGameListAct;
|
||||
QAction *showControlsAct;
|
||||
QAction *refreshGameListAct;
|
||||
QAction *showGameListToolBarAct;
|
||||
QAction* showCatHDDGameAct;
|
||||
QAction* showCatDiscGameAct;
|
||||
QAction* showCatHomeAct;
|
||||
QAction* showCatAudioVideoAct;
|
||||
QAction* showCatGameDataAct;
|
||||
QAction* showCatUnknownAct;
|
||||
QAction* setIconSizeTinyAct;
|
||||
QAction* setIconSizeSmallAct;
|
||||
QAction* setIconSizeMediumAct;
|
||||
QAction* setIconSizeLargeAct;
|
||||
QAction* setlistModeListAct;
|
||||
QAction* setlistModeGridAct;
|
||||
QAction *aboutAct;
|
||||
QAction *aboutQtAct;
|
||||
|
||||
|
|