mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-22 08:31:14 +01:00
Distinguish TrackPanelMouseState from TrackPanelMouseEvent...
... Let cell hit tests, and handle preview, know states only, not transitions. Cell hit tests are passed a mouse state that does not always match the current, but anticipates the button click to come; usually left, but if the Control [sic] key on Mac is down, then right. Thus, pressing and releasing Mac Control in multi-tool switches in and out of the magnifier cursor.
This commit is contained in:
@@ -55,12 +55,12 @@ UIHandle::Result MinimizeButtonHandle::CommitChanges
|
||||
}
|
||||
|
||||
HitTestResult MinimizeButtonHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect)
|
||||
(const wxMouseState &state, const wxRect &rect)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
TrackInfo::GetMinimizeRect(rect, buttonRect);
|
||||
|
||||
if (buttonRect.Contains(event.m_x, event.m_y)) {
|
||||
if (buttonRect.Contains(state.m_x, state.m_y)) {
|
||||
Instance().mRect = buttonRect;
|
||||
return {
|
||||
HitPreview(),
|
||||
@@ -112,12 +112,12 @@ UIHandle::Result CloseButtonHandle::CommitChanges
|
||||
}
|
||||
|
||||
HitTestResult CloseButtonHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect)
|
||||
(const wxMouseState &state, const wxRect &rect)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
TrackInfo::GetCloseBoxRect(rect, buttonRect);
|
||||
|
||||
if (buttonRect.Contains(event.m_x, event.m_y)) {
|
||||
if (buttonRect.Contains(state.m_x, state.m_y)) {
|
||||
Instance().mRect = buttonRect;
|
||||
return {
|
||||
HitPreview(),
|
||||
@@ -155,13 +155,13 @@ UIHandle::Result MenuButtonHandle::CommitChanges
|
||||
}
|
||||
|
||||
HitTestResult MenuButtonHandle::HitTest
|
||||
(const wxMouseEvent &event, const wxRect &rect,
|
||||
(const wxMouseState &state, const wxRect &rect,
|
||||
const std::shared_ptr<TrackPanelCell> &pCell)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
TrackInfo::GetTitleBarRect(rect, buttonRect);
|
||||
|
||||
if (buttonRect.Contains(event.m_x, event.m_y)) {
|
||||
if (buttonRect.Contains(state.m_x, state.m_y)) {
|
||||
Instance().mpCell = pCell;
|
||||
Instance().mRect = buttonRect;
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user