mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 15:31:26 +12:00
install icons to /usr/share and load them from there
This commit is contained in:
parent
6828fbf658
commit
49e64b9e82
2 changed files with 20 additions and 1 deletions
|
@ -468,4 +468,9 @@ if(UNIX AND NOT APPLE)
|
||||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps)
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps)
|
||||||
install(FILES rpcs3.desktop
|
install(FILES rpcs3.desktop
|
||||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
|
||||||
|
# Install other files
|
||||||
|
install(DIRECTORY ../bin/Icons
|
||||||
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/rpcs3)
|
||||||
|
install(DIRECTORY ../bin/GuiConfigs
|
||||||
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/rpcs3)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#include <libgen.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// STB_IMAGE_IMPLEMENTATION and STB_TRUETYPE_IMPLEMENTATION defined externally
|
// STB_IMAGE_IMPLEMENTATION and STB_TRUETYPE_IMPLEMENTATION defined externally
|
||||||
|
@ -470,7 +471,20 @@ namespace rsx
|
||||||
{
|
{
|
||||||
//Resource was not found in config dir, try and grab from relative path (linux)
|
//Resource was not found in config dir, try and grab from relative path (linux)
|
||||||
info = std::make_unique<image_info>(("Icons/ui/" + res).c_str());
|
info = std::make_unique<image_info>(("Icons/ui/" + res).c_str());
|
||||||
|
#ifndef _WIN32
|
||||||
|
if (info->data == nullptr)
|
||||||
|
{
|
||||||
|
char result[ PATH_MAX ];
|
||||||
|
#ifdef __linux__
|
||||||
|
ssize_t count = readlink( "/proc/self/exe", result, PATH_MAX );
|
||||||
|
#else
|
||||||
|
ssize_t count = readlink( "/proc/curproc/file", result, PATH_MAX );
|
||||||
|
#endif
|
||||||
|
std::string executablePath = dirname(result);
|
||||||
|
info = std::make_unique<image_info>((executablePath + "/../share/rpcs3/Icons/ui/" + res).c_str());
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (info->data != nullptr)
|
if (info->data != nullptr)
|
||||||
{
|
{
|
||||||
//Install the image to config dir
|
//Install the image to config dir
|
||||||
|
@ -1308,7 +1322,7 @@ namespace rsx
|
||||||
u16 m_elements_height = 0;
|
u16 m_elements_height = 0;
|
||||||
s16 m_selected_entry = -1;
|
s16 m_selected_entry = -1;
|
||||||
u16 m_elements_count = 0;
|
u16 m_elements_count = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
list_view(u16 width, u16 height)
|
list_view(u16 width, u16 height)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue