summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-06-30 18:15:03 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2021-06-30 18:15:03 -0400
commit698ec52d5c056f3584c46e67b199adcfba9f8d2e (patch)
tree3b48df8eed852c2f4ecbdbcaaff9bf29d16f7b50 /windows
parent220aa6d13a9cb12687139305c6f68eb9cf6f73a1 (diff)
downloadabaddon-portaudio-698ec52d5c056f3584c46e67b199adcfba9f8d2e.tar.gz
abaddon-portaudio-698ec52d5c056f3584c46e67b199adcfba9f8d2e.zip
try loading resources from share, fallback to cwd
Diffstat (limited to 'windows')
-rw-r--r--windows/guildsettings/memberspane.cpp3
-rw-r--r--windows/profile/userinfopane.cpp5
-rw-r--r--windows/profilewindow.cpp4
3 files changed, 7 insertions, 5 deletions
diff --git a/windows/guildsettings/memberspane.cpp b/windows/guildsettings/memberspane.cpp
index 12655ca..8e5c29c 100644
--- a/windows/guildsettings/memberspane.cpp
+++ b/windows/guildsettings/memberspane.cpp
@@ -116,7 +116,8 @@ GuildSettingsMembersListItem::GuildSettingsMembersListItem(const GuildData &guil
static bool crown = Abaddon::Get().GetSettings().GetShowOwnerCrown();
if (crown && guild.OwnerID == member.User->ID) {
try {
- auto pixbuf = Gdk::Pixbuf::create_from_file("./res/crown.png", 12, 12);
+ const static auto crown_path = Abaddon::GetResPath("/crown.png");
+ auto pixbuf = Gdk::Pixbuf::create_from_file(crown_path, 12, 12);
m_crown = Gtk::manage(new Gtk::Image(pixbuf));
m_crown->set_valign(Gtk::ALIGN_CENTER);
m_crown->set_margin_start(10);
diff --git a/windows/profile/userinfopane.cpp b/windows/profile/userinfopane.cpp
index f510f4a..33e04ef 100644
--- a/windows/profile/userinfopane.cpp
+++ b/windows/profile/userinfopane.cpp
@@ -7,7 +7,7 @@ ConnectionItem::ConnectionItem(const ConnectionData &conn)
, m_box(Gtk::ORIENTATION_HORIZONTAL) {
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
try {
- pixbuf = Gdk::Pixbuf::create_from_file("./res/" + conn.Type + ".png", 32, 32);
+ pixbuf = Gdk::Pixbuf::create_from_file(Abaddon::GetResPath("/" + conn.Type + ".png"), 32, 32);
} catch (const Glib::Exception &e) {}
std::string url;
if (conn.Type == "github")
@@ -53,7 +53,8 @@ ConnectionItem::ConnectionItem(const ConnectionData &conn)
m_overlay.add(m_box);
if (conn.IsVerified) {
try {
- static auto pb = Gdk::Pixbuf::create_from_file("./res/checkmark.png", 24, 24);
+ const static auto checkmarks_path = Abaddon::GetResPath("/checkmark.png");
+ static auto pb = Gdk::Pixbuf::create_from_file(checkmarks_path, 24, 24);
m_check = Gtk::manage(new Gtk::Image(pb));
m_check->get_style_context()->add_class("profile-connection-check");
m_check->set_margin_end(25);
diff --git a/windows/profilewindow.cpp b/windows/profilewindow.cpp
index 90e98f1..f4bc3c9 100644
--- a/windows/profilewindow.cpp
+++ b/windows/profilewindow.cpp
@@ -111,9 +111,9 @@ void ProfileWindow::OnFetchProfile(const UserProfileData &data) {
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
try {
if (name == "verifiedbot")
- pixbuf = Gdk::Pixbuf::create_from_file("./res/checkmark.png", 24, 24);
+ pixbuf = Gdk::Pixbuf::create_from_file(Abaddon::GetResPath("/checkmark.png"), 24, 24);
else
- pixbuf = Gdk::Pixbuf::create_from_file("./res/" + name + ".png", 24, 24);
+ pixbuf = Gdk::Pixbuf::create_from_file(Abaddon::GetResPath("/" + name + ".png"), 24, 24);
} catch (const Glib::Exception &e) {
pixbuf = Abaddon::Get().GetImageManager().GetPlaceholder(24);
}