Skip to content

Commit ae997ad

Browse files
authored
Merge pull request Alexays#3613 from ThatOneCalculator/fix/3612
2 parents 0d02f68 + 085a1ed commit ae997ad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/AAppIconLabel.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ void AAppIconLabel::updateAppIcon() {
154154
update_app_icon_ = false;
155155
if (app_icon_name_.empty()) {
156156
image_.set_visible(false);
157+
}
158+
else if (app_icon_name_.front() == '/') {
159+
auto pixbuf = Gdk::Pixbuf::create_from_file(app_icon_name_);
160+
int scaled_icon_size = app_icon_size_ * image_.get_scale_factor();
161+
pixbuf = Gdk::Pixbuf::create_from_file(app_icon_name_, scaled_icon_size, scaled_icon_size);
162+
163+
auto surface = Gdk::Cairo::create_surface_from_pixbuf(pixbuf, image_.get_scale_factor(),
164+
image_.get_window());
165+
image_.set(surface);
166+
image_.set_visible(true);
157167
} else {
158168
image_.set_from_icon_name(app_icon_name_, Gtk::ICON_SIZE_INVALID);
159169
image_.set_visible(true);

0 commit comments

Comments
 (0)