1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-21 01:18:02 +02:00

Improvements to Find in Watch

This commit is contained in:
Brian Fiete 2024-03-26 07:30:54 -04:00
parent f47e132921
commit bceca3e699
4 changed files with 670 additions and 108 deletions

View file

@ -1,11 +1,20 @@
using Beefy.theme.dark;
using Beefy.gfx;
using System;
using Beefy.geom;
namespace IDE.ui;
class ToggleButton : DarkButton
{
public bool mToggled;
public String mHoverText ~ delete _;
public StringView HoverText
{
get => mHoverText;
set => String.NewOrSet!(mHoverText, value);
}
public override void Draw(Graphics g)
{
@ -18,6 +27,20 @@ class ToggleButton : DarkButton
}
}
public override void Update()
{
base.Update();
if ((DarkTooltipManager.sLastMouseWidget == this) && (mHoverText != null))
{
Point mousePoint;
if (DarkTooltipManager.CheckMouseover(this, 20, out mousePoint))
{
DarkTooltipManager.ShowTooltip(mHoverText, this, 0, mHeight);
}
}
}
public override void MouseDown(float x, float y, int32 btn, int32 btnCount)
{
mToggled = !mToggled;