Vol,PosView: Ignore scroll-wheel when inactive
This commit is contained in:
parent
59044460e5
commit
55d9708259
|
@ -76,7 +76,7 @@ PositionView::Archive(BMessage* data, bool deep) const
|
||||||
|
|
||||||
data->AddString("class", "PositionView");
|
data->AddString("class", "PositionView");
|
||||||
data->AddString("add_on", APP_SIGNATURE);
|
data->AddString("add_on", APP_SIGNATURE);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,6 +106,9 @@ PositionView::MessageReceived(BMessage* msg)
|
||||||
break;
|
break;
|
||||||
case B_MOUSE_WHEEL_CHANGED:
|
case B_MOUSE_WHEEL_CHANGED:
|
||||||
{
|
{
|
||||||
|
if (fInactive)
|
||||||
|
break;
|
||||||
|
|
||||||
float scroll = 0.0f;
|
float scroll = 0.0f;
|
||||||
if ((msg->FindFloat("be:wheel_delta_x", &scroll) == B_OK && scroll != 0.0f)
|
if ((msg->FindFloat("be:wheel_delta_x", &scroll) == B_OK && scroll != 0.0f)
|
||||||
|| (msg->FindFloat("be:wheel_delta_y", &scroll) == B_OK && scroll != 0.0f))
|
|| (msg->FindFloat("be:wheel_delta_y", &scroll) == B_OK && scroll != 0.0f))
|
||||||
|
|
|
@ -54,7 +54,7 @@ VolumeView::Archive(BMessage* data, bool deep) const
|
||||||
|
|
||||||
data->AddString("class", "VolumeView");
|
data->AddString("class", "VolumeView");
|
||||||
data->AddString("add_on", APP_SIGNATURE);
|
data->AddString("add_on", APP_SIGNATURE);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,6 +83,9 @@ VolumeView::MessageReceived(BMessage* msg)
|
||||||
break;
|
break;
|
||||||
case B_MOUSE_WHEEL_CHANGED:
|
case B_MOUSE_WHEEL_CHANGED:
|
||||||
{
|
{
|
||||||
|
if (fInactive)
|
||||||
|
break;
|
||||||
|
|
||||||
float scroll = 0.0f;
|
float scroll = 0.0f;
|
||||||
if ((msg->FindFloat("be:wheel_delta_x", &scroll) == B_OK && scroll != 0.0f)
|
if ((msg->FindFloat("be:wheel_delta_x", &scroll) == B_OK && scroll != 0.0f)
|
||||||
|| (msg->FindFloat("be:wheel_delta_y", &scroll) == B_OK && scroll != 0.0f))
|
|| (msg->FindFloat("be:wheel_delta_y", &scroll) == B_OK && scroll != 0.0f))
|
||||||
|
@ -100,7 +103,7 @@ void
|
||||||
VolumeView::Pulse()
|
VolumeView::Pulse()
|
||||||
{
|
{
|
||||||
float volume = fMediaPlayer->Volume();
|
float volume = fMediaPlayer->Volume();
|
||||||
if (volume > 0) {
|
if (volume >= 0) {
|
||||||
SetInactive(false);
|
SetInactive(false);
|
||||||
fSlider->SetPosition(_VolumeToPosition(volume));
|
fSlider->SetPosition(_VolumeToPosition(volume));
|
||||||
} else
|
} else
|
||||||
|
|
Ŝarĝante…
Reference in New Issue