Tracker: OverrideAlert style fixes
This commit is contained in:
@@ -46,8 +46,9 @@ OverrideAlert::OverrideAlert(const char* title, const char* text,
|
||||
const char* button2, uint32 modifiers2,
|
||||
const char* button3, uint32 modifiers3,
|
||||
button_width width, alert_type type)
|
||||
: BAlert(title, text, button1, button2, button3, width, type),
|
||||
fCurModifiers(0)
|
||||
:
|
||||
BAlert(title, text, button1, button2, button3, width, type),
|
||||
fCurModifiers(0)
|
||||
{
|
||||
fButtonModifiers[0] = modifiers1;
|
||||
fButtonModifiers[1] = modifiers2;
|
||||
@@ -64,8 +65,9 @@ OverrideAlert::OverrideAlert(const char* title, const char* text,
|
||||
const char* button2, uint32 modifiers2,
|
||||
const char* button3, uint32 modifiers3,
|
||||
button_width width, button_spacing spacing, alert_type type)
|
||||
: BAlert(title, text, button1, button2, button3, width, spacing, type),
|
||||
fCurModifiers(0)
|
||||
:
|
||||
BAlert(title, text, button1, button2, button3, width, spacing, type),
|
||||
fCurModifiers(0)
|
||||
{
|
||||
fButtonModifiers[0] = modifiers1;
|
||||
fButtonModifiers[1] = modifiers2;
|
||||
@@ -108,7 +110,7 @@ OverrideAlert::OverPosition(float width, float height)
|
||||
BRect desirableRect;
|
||||
screenFrame = BScreen(window).Frame();
|
||||
|
||||
if (window) {
|
||||
if (window != NULL) {
|
||||
// If we found a window associated with this calling thread,
|
||||
// place alert over that window so that the first button is
|
||||
// on top of it. This allows name editing confirmations to
|
||||
@@ -123,7 +125,6 @@ OverrideAlert::OverPosition(float width, float height)
|
||||
desirableRect.right = desirableRect.left+width;
|
||||
desirableRect.top = midY - ceilf(height / 3.0f);
|
||||
desirableRect.bottom = desirableRect.top + height;
|
||||
|
||||
} else {
|
||||
// Otherwise, just place alert in center of screen.
|
||||
|
||||
@@ -150,7 +151,7 @@ OverrideAlert::UpdateButtons(uint32 modifiers, bool force)
|
||||
fCurModifiers = modifiers;
|
||||
for (int32 i = 0; i < 3; i++) {
|
||||
BButton* button = ButtonAt(i);
|
||||
if (button) {
|
||||
if (button != NULL) {
|
||||
button->SetEnabled(((fButtonModifiers[i] & fCurModifiers)
|
||||
== fButtonModifiers[i]));
|
||||
}
|
||||
|
||||
@@ -31,8 +31,6 @@ of Be Incorporated in the United States and other countries. Other brand product
|
||||
names are registered trademarks or trademarks of their respective holders.
|
||||
All rights reserved.
|
||||
*/
|
||||
#ifndef _OVERRIDE_ALERT_H
|
||||
#define _OVERRIDE_ALERT_H
|
||||
|
||||
// This is a special BAlert for which you can specify modifier
|
||||
// keys that must be down for various buttons to be enabled. It
|
||||
@@ -43,6 +41,8 @@ All rights reserved.
|
||||
// normal BAlert, attempting to be on top of the calling window.
|
||||
// This allows it to work when confirming rename operations with
|
||||
// Focus Follows Mouse turned on.
|
||||
#ifndef _OVERRIDE_ALERT_H
|
||||
#define _OVERRIDE_ALERT_H
|
||||
|
||||
|
||||
#include <Alert.h>
|
||||
@@ -81,4 +81,5 @@ private:
|
||||
|
||||
using namespace BPrivate;
|
||||
|
||||
|
||||
#endif // _OVERRIDE_ALERT_H
|
||||
|
||||
Reference in New Issue
Block a user