try loading resources from share, fallback to cwd

This commit is contained in:
ouwou
2021-06-30 18:15:03 -04:00
parent 220aa6d13a
commit 698ec52d5c
12 changed files with 80 additions and 15 deletions

View File

@@ -21,8 +21,9 @@ ChatInputIndicator::ChatInputIndicator()
m_label.show();
// try loading gif
if (!std::filesystem::exists("./res/typing_indicator.gif")) return;
auto gif_data = ReadWholeFile("./res/typing_indicator.gif");
const static auto path = Abaddon::GetResPath("/typing_indicator.gif");
if (!std::filesystem::exists(path)) return;
auto gif_data = ReadWholeFile(path);
auto loader = Gdk::PixbufLoader::create();
loader->signal_size_prepared().connect([&](int inw, int inh) {
int w, h;