mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-30 16:20:20 +00:00
install icons to /usr/share and load them from there
This commit is contained in:
parent
6828fbf658
commit
49e64b9e82
@ -468,4 +468,9 @@ if(UNIX AND NOT APPLE)
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps)
|
||||
install(FILES rpcs3.desktop
|
||||
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()
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
|
||||
// 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)
|
||||
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)
|
||||
{
|
||||
//Install the image to config dir
|
||||
@ -1308,7 +1322,7 @@ namespace rsx
|
||||
u16 m_elements_height = 0;
|
||||
s16 m_selected_entry = -1;
|
||||
u16 m_elements_count = 0;
|
||||
|
||||
|
||||
public:
|
||||
list_view(u16 width, u16 height)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user