mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
add icon images support
This commit is contained in:
parent
27332b2828
commit
30a8f2617e
1 changed files with 11 additions and 0 deletions
|
|
@ -10,11 +10,22 @@ abstract class Button
|
|||
|
||||
public const SENSITIVE = false;
|
||||
public const LABEL = 'Button';
|
||||
public const IMAGE = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->gtk = new \GtkButton;
|
||||
|
||||
if ($this::IMAGE && \GtkIconTheme::get_default()->has_icon($this::IMAGE))
|
||||
{
|
||||
$this->gtk->set_image(
|
||||
\GtkImage::new_from_icon_name(
|
||||
$this::IMAGE,
|
||||
\GtkIconSize::BUTTON
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$this->gtk->set_sensitive(
|
||||
$this::SENSITIVE
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue