mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 15:35:23 +00:00
Use mouse pressed event for pin button instead of mouse click
This commit is contained in:
parent
c093e284d9
commit
54e79c8c98
@ -12,7 +12,7 @@ namespace MWGui
|
||||
ExposedWindow* window = mMainWidget->castType<ExposedWindow>();
|
||||
mPinButton = window->getSkinWidget ("Button");
|
||||
|
||||
mPinButton->eventMouseButtonClick += MyGUI::newDelegate(this, &WindowPinnableBase::onPinButtonClicked);
|
||||
mPinButton->eventMouseButtonPressed += MyGUI::newDelegate(this, &WindowPinnableBase::onPinButtonPressed);
|
||||
|
||||
MyGUI::Button* button = NULL;
|
||||
MyGUI::VectorWidgetPtr widgets = window->getSkinWidgetsByName("Action");
|
||||
@ -26,8 +26,11 @@ namespace MWGui
|
||||
button->eventMouseButtonDoubleClick += MyGUI::newDelegate(this, &WindowPinnableBase::onDoubleClick);
|
||||
}
|
||||
|
||||
void WindowPinnableBase::onPinButtonClicked(MyGUI::Widget* _sender)
|
||||
void WindowPinnableBase::onPinButtonPressed(MyGUI::Widget* _sender, int left, int top, MyGUI::MouseButton id)
|
||||
{
|
||||
if (id != MyGUI::MouseButton::Left)
|
||||
return;
|
||||
|
||||
mPinned = !mPinned;
|
||||
|
||||
if (mPinned)
|
||||
@ -46,7 +49,7 @@ namespace MWGui
|
||||
void WindowPinnableBase::setPinned(bool pinned)
|
||||
{
|
||||
if (pinned != mPinned)
|
||||
onPinButtonClicked(mPinButton);
|
||||
onPinButtonPressed(mPinButton, 0, 0, MyGUI::MouseButton::Left);
|
||||
}
|
||||
|
||||
void WindowPinnableBase::setPinButtonVisible(bool visible)
|
||||
|
@ -16,7 +16,7 @@ namespace MWGui
|
||||
void setPinButtonVisible(bool visible);
|
||||
|
||||
private:
|
||||
void onPinButtonClicked(MyGUI::Widget* _sender);
|
||||
void onPinButtonPressed(MyGUI::Widget* _sender, int left, int top, MyGUI::MouseButton id);
|
||||
void onDoubleClick(MyGUI::Widget* _sender);
|
||||
|
||||
protected:
|
||||
|
Loading…
x
Reference in New Issue
Block a user