[UI] Let clickable link name boxes and name editors have hand cursors instead of I-beams.
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llnamebox.h"
|
||||
#include "llwindow.h"
|
||||
|
||||
static LLRegisterWidget<LLNameBox> r("name_box");
|
||||
|
||||
@@ -66,6 +67,17 @@ BOOL LLNameBox::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
||||
return handled;
|
||||
}
|
||||
|
||||
// virtual
|
||||
BOOL LLNameBox::handleHover(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if (mAllowInteract)
|
||||
{
|
||||
getWindow()->setCursor(UI_CURSOR_HAND);
|
||||
return true;
|
||||
}
|
||||
return LLTextBox::handleHover(x, y, mask);
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLNameBox::initFromXML(LLXMLNodePtr node, LLView* parent)
|
||||
{
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
LLSD getValue() const override final { return LLNameUI::getValue(); }
|
||||
|
||||
BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override final;
|
||||
BOOL handleHover(S32 x, S32 y, MASK mask) override final;
|
||||
|
||||
protected:
|
||||
LLNameBox(const std::string& name);
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "llmenugl.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llwindow.h"
|
||||
|
||||
static LLRegisterWidget<LLNameEditor> r("name_editor");
|
||||
|
||||
@@ -90,6 +91,17 @@ BOOL LLNameEditor::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
||||
return LLLineEditor::handleRightMouseDown(x, y, mask);
|
||||
}
|
||||
|
||||
// virtual
|
||||
BOOL LLNameEditor::handleHover(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if (mAllowInteract)
|
||||
{
|
||||
getWindow()->setCursor(UI_CURSOR_HAND);
|
||||
return true;
|
||||
}
|
||||
return LLLineEditor::handleHover(x, y, mask);
|
||||
}
|
||||
|
||||
void LLNameEditor::displayAsLink(bool link)
|
||||
{
|
||||
static const LLUICachedControl<LLColor4> color("HTMLAgentColor");
|
||||
|
||||
@@ -53,6 +53,7 @@ public:
|
||||
|
||||
BOOL handleMouseDown(S32 x, S32 y, MASK mask) override final;
|
||||
BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override final;
|
||||
BOOL handleHover(S32 x, S32 y, MASK mask) override final;
|
||||
|
||||
LLXMLNodePtr getXML(bool save_children = true) const override final;
|
||||
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
|
||||
|
||||
Reference in New Issue
Block a user