mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
add markup support in statusbar value
This commit is contained in:
parent
a48e4d87ed
commit
19dab748ae
@ -93,7 +93,7 @@ class Address
|
||||
$this->navbar->address->tab->refresh();
|
||||
|
||||
// Update statusbar indicator
|
||||
$this->statusbar->setText(
|
||||
$this->statusbar->setValue(
|
||||
'Loading...'
|
||||
);
|
||||
|
||||
@ -130,7 +130,7 @@ class Address
|
||||
);
|
||||
}
|
||||
|
||||
$this->statusbar->setText(
|
||||
$this->statusbar->setValue(
|
||||
null
|
||||
);
|
||||
|
||||
@ -146,7 +146,7 @@ class Address
|
||||
'File extension not supported'
|
||||
);
|
||||
|
||||
$this->statusbar->setText(
|
||||
$this->statusbar->setValue(
|
||||
null
|
||||
);
|
||||
}
|
||||
@ -162,7 +162,7 @@ class Address
|
||||
'Could not open file'
|
||||
);
|
||||
|
||||
$this->statusbar->setText(
|
||||
$this->statusbar->setValue(
|
||||
'Resource not found or not readable'
|
||||
);
|
||||
}
|
||||
@ -214,7 +214,7 @@ class Address
|
||||
);
|
||||
}
|
||||
|
||||
$this->statusbar->setText(
|
||||
$this->statusbar->setValue(
|
||||
$response->getMeta()
|
||||
);
|
||||
}
|
||||
@ -234,7 +234,7 @@ class Address
|
||||
)
|
||||
);
|
||||
|
||||
$this->statusbar->setText(
|
||||
$this->statusbar->setValue(
|
||||
'Request failed'
|
||||
);
|
||||
}
|
||||
@ -295,7 +295,7 @@ class Address
|
||||
)
|
||||
);
|
||||
|
||||
$this->statusbar->setText(
|
||||
$this->statusbar->setValue(
|
||||
null
|
||||
);
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ class Statusbar
|
||||
|
||||
// Defaults
|
||||
private int $_margin = 8;
|
||||
private string $_text = '';
|
||||
private string $_value = '';
|
||||
|
||||
public function __construct(
|
||||
\Yggverse\Yoda\Entity\Window\Tab\Address $address
|
||||
@ -21,6 +21,14 @@ class Statusbar
|
||||
|
||||
$this->gtk = new \GtkLabel;
|
||||
|
||||
$this->gtk->set_use_markup(
|
||||
true
|
||||
);
|
||||
|
||||
$this->gtk->set_selectable(
|
||||
true
|
||||
);
|
||||
|
||||
$this->gtk->set_line_wrap(
|
||||
true
|
||||
);
|
||||
@ -48,15 +56,19 @@ class Statusbar
|
||||
$this->gtk->set_margin_end(
|
||||
$this->_margin
|
||||
);
|
||||
|
||||
$this->gtk->set_markup(
|
||||
$this->_value
|
||||
);
|
||||
}
|
||||
|
||||
public function setText(
|
||||
?string $text = null
|
||||
public function setValue(
|
||||
?string $value = null
|
||||
): void
|
||||
{
|
||||
$this->gtk->set_text(
|
||||
is_null($text) ? $this->_text : trim(
|
||||
$text
|
||||
$this->gtk->set_markup(
|
||||
is_null($value) ? $this->_value : trim(
|
||||
$value
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user