fixed bug which removed highlighting for most widgets

This commit is contained in:
thrust26 2020-11-17 08:34:39 +01:00
parent cce4e0f5d5
commit dec31a0f03
5 changed files with 20 additions and 3 deletions

View File

@ -212,7 +212,7 @@ void ToggleWidget::handleCommand(CommandSender* sender, int cmd,
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string ToggleWidget::getToolTip(int x, int y) const string ToggleWidget::getToolTip(int, int y) const
{ {
const int row = (y - getAbsY()) / _rowHeight; const int row = (y - getAbsY()) / _rowHeight;
const int pos = row * _cols;// +col; const int pos = row * _cols;// +col;

View File

@ -30,7 +30,8 @@
// - multi line tips // - multi line tips
// - nicer formating of DataDridWidget tip // - nicer formating of DataDridWidget tip
// - allow reversing ToogleWidget (TooglePixelWidget) // - allow reversing ToogleWidget (TooglePixelWidget)
// - shift checkbox bits
// - RomListWidget (hex codes, maybe disassembly operands)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ToolTip::ToolTip(Dialog& dialog, const GUI::Font& font) ToolTip::ToolTip(Dialog& dialog, const GUI::Font& font)

View File

@ -19,7 +19,7 @@
#define TOOL_TIP_HXX #define TOOL_TIP_HXX
/** /**
* Class for providing tool tip functionality * Class for providing tooltip functionality
* *
* @author Thomas Jentzsch * @author Thomas Jentzsch
*/ */

View File

@ -475,6 +475,20 @@ ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font,
_bmh = bmh; _bmh = bmh;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void ButtonWidget::handleMouseEntered()
{
if(isEnabled())
setFlags(Widget::FLAG_HILITED | Widget::FLAG_MOUSE_FOCUS);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void ButtonWidget::handleMouseLeft()
{
if(isEnabled())
clearFlags(Widget::FLAG_HILITED | Widget::FLAG_MOUSE_FOCUS);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool ButtonWidget::handleEvent(Event::Type e) bool ButtonWidget::handleEvent(Event::Type e)
{ {

View File

@ -236,6 +236,8 @@ class ButtonWidget : public StaticTextWidget, public CommandSender
bool handleMouseClicks(int x, int y, MouseButton b) override; bool handleMouseClicks(int x, int y, MouseButton b) override;
void handleMouseDown(int x, int y, MouseButton b, int clickCount) override; void handleMouseDown(int x, int y, MouseButton b, int clickCount) override;
void handleMouseUp(int x, int y, MouseButton b, int clickCount) override; void handleMouseUp(int x, int y, MouseButton b, int clickCount) override;
void handleMouseEntered() override;
void handleMouseLeft() override;
bool handleEvent(Event::Type event) override; bool handleEvent(Event::Type event) override;
void drawWidget(bool hilite) override; void drawWidget(bool hilite) override;