diff --git a/src/Abstract/Entity/Button.php b/src/Abstract/Entity/Button.php index 3c0b4901..4d7911bc 100644 --- a/src/Abstract/Entity/Button.php +++ b/src/Abstract/Entity/Button.php @@ -65,15 +65,39 @@ abstract class Button int $size = \GtkIconSize::BUTTON ): void { - if (\GtkIconTheme::get_default()->has_icon($image)) + switch (true) { - $this->gtk->set_image( - \GtkImage::new_from_icon_name( - $image, - $size - ) - ); + case file_exists( + $image + ) && is_readable( + $image + ): - } else throw new \Exception; + $this->gtk->set_image( + \GtkImage::new_from_file( + $image, + $size + ) + ); + + break; + + case \GtkIconTheme::get_default()->has_icon( + $image + ): + + $this->gtk->set_image( + \GtkImage::new_from_icon_name( + $image, + $size + ) + ); + + break; + + default: + + throw new \Exception; + } } } \ No newline at end of file