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:
parent
f47e132921
commit
bceca3e699
4 changed files with 670 additions and 108 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue