From dec31a0f03dda635b43c447e779ca7ce1a5fd0c0 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Tue, 17 Nov 2020 08:34:39 +0100 Subject: [PATCH] fixed bug which removed highlighting for most widgets --- src/debugger/gui/ToggleWidget.cxx | 2 +- src/gui/ToolTip.cxx | 3 ++- src/gui/ToolTip.hxx | 2 +- src/gui/Widget.cxx | 14 ++++++++++++++ src/gui/Widget.hxx | 2 ++ 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/debugger/gui/ToggleWidget.cxx b/src/debugger/gui/ToggleWidget.cxx index 346c51121..a73bc25dc 100644 --- a/src/debugger/gui/ToggleWidget.cxx +++ b/src/debugger/gui/ToggleWidget.cxx @@ -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 pos = row * _cols;// +col; diff --git a/src/gui/ToolTip.cxx b/src/gui/ToolTip.cxx index 9531ee5ef..ece2f1ccc 100644 --- a/src/gui/ToolTip.cxx +++ b/src/gui/ToolTip.cxx @@ -30,7 +30,8 @@ // - multi line tips // - nicer formating of DataDridWidget tip // - allow reversing ToogleWidget (TooglePixelWidget) - +// - shift checkbox bits +// - RomListWidget (hex codes, maybe disassembly operands) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ToolTip::ToolTip(Dialog& dialog, const GUI::Font& font) diff --git a/src/gui/ToolTip.hxx b/src/gui/ToolTip.hxx index 125343294..efcf3bafe 100644 --- a/src/gui/ToolTip.hxx +++ b/src/gui/ToolTip.hxx @@ -19,7 +19,7 @@ #define TOOL_TIP_HXX /** - * Class for providing tool tip functionality + * Class for providing tooltip functionality * * @author Thomas Jentzsch */ diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 991207655..a7fb55561 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -475,6 +475,20 @@ ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font, _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) { diff --git a/src/gui/Widget.hxx b/src/gui/Widget.hxx index 42612cc99..33c6a3e20 100644 --- a/src/gui/Widget.hxx +++ b/src/gui/Widget.hxx @@ -236,6 +236,8 @@ class ButtonWidget : public StaticTextWidget, public CommandSender bool handleMouseClicks(int x, int y, MouseButton b) override; void handleMouseDown(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; void drawWidget(bool hilite) override;