mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
added 'tooltip-delay' property
This commit is contained in:
parent
4400efae33
commit
e3989cb178
7 changed files with 28 additions and 3 deletions
|
|
@ -62,8 +62,8 @@ void GUI::onAssetsLoad(Assets* assets) {
|
|||
void GUI::updateTooltip(float delta) {
|
||||
float mouseDelta = glm::length(Events::delta);
|
||||
if ((hover && mouseDelta < 1.0f) ||
|
||||
(hover && hover->isInside(Events::cursor) && tooltipTimer >= tooltipDelay)) {
|
||||
if (tooltipTimer + delta >= tooltipDelay) {
|
||||
(hover && hover->isInside(Events::cursor) && tooltipTimer >= hover->getTooltipDelay())) {
|
||||
if (tooltipTimer + delta >= hover->getTooltipDelay()) {
|
||||
auto label = std::dynamic_pointer_cast<gui::Label>(get("tooltip.label"));
|
||||
const auto& text = hover->getTooltip();
|
||||
if (label && !text.empty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue