BButton style fixes

This commit is contained in:
John Scipione
2014-04-24 15:31:12 -04:00
parent c161ea9ac2
commit a631719fb4
+20 -8
View File
@@ -40,7 +40,8 @@ static const float kLabelMargin = 3;
BButton::BButton(BRect frame, const char* name, const char* label, BButton::BButton(BRect frame, const char* name, const char* label,
BMessage* message, uint32 resizingMode, uint32 flags) BMessage* message, uint32 resizingMode, uint32 flags)
: BControl(frame, name, label, message, resizingMode, :
BControl(frame, name, label, message, resizingMode,
flags | B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE), flags | B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE),
fPreferredSize(-1, -1), fPreferredSize(-1, -1),
fFlags(0), fFlags(0),
@@ -58,7 +59,8 @@ BButton::BButton(BRect frame, const char* name, const char* label,
BButton::BButton(const char* name, const char* label, BMessage* message, BButton::BButton(const char* name, const char* label, BMessage* message,
uint32 flags) uint32 flags)
: BControl(name, label, message, :
BControl(name, label, message,
flags | B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE), flags | B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE),
fPreferredSize(-1, -1), fPreferredSize(-1, -1),
fFlags(0), fFlags(0),
@@ -69,7 +71,8 @@ BButton::BButton(const char* name, const char* label, BMessage* message,
BButton::BButton(const char* label, BMessage* message) BButton::BButton(const char* label, BMessage* message)
: BControl(NULL, label, message, :
BControl(NULL, label, message,
B_WILL_DRAW | B_NAVIGABLE | B_FULL_UPDATE_ON_RESIZE), B_WILL_DRAW | B_NAVIGABLE | B_FULL_UPDATE_ON_RESIZE),
fPreferredSize(-1, -1), fPreferredSize(-1, -1),
fFlags(0), fFlags(0),
@@ -86,7 +89,8 @@ BButton::~BButton()
BButton::BButton(BMessage* archive) BButton::BButton(BMessage* archive)
: BControl(archive), :
BControl(archive),
fPreferredSize(-1, -1), fPreferredSize(-1, -1),
fFlags(0), fFlags(0),
fBehavior(B_BUTTON_BEHAVIOR), fBehavior(B_BUTTON_BEHAVIOR),
@@ -496,10 +500,10 @@ BButton::AllDetached()
BHandler* BHandler*
BButton::ResolveSpecifier(BMessage* message, int32 index, BButton::ResolveSpecifier(BMessage* message, int32 index,
BMessage *specifier, int32 what, BMessage* specifier, int32 what, const char* property)
const char *property)
{ {
return BControl::ResolveSpecifier(message, index, specifier, what, property); return BControl::ResolveSpecifier(message, index, specifier, what,
property);
} }
@@ -518,22 +522,27 @@ BButton::Perform(perform_code code, void* _data)
((perform_data_min_size*)_data)->return_value ((perform_data_min_size*)_data)->return_value
= BButton::MinSize(); = BButton::MinSize();
return B_OK; return B_OK;
case PERFORM_CODE_MAX_SIZE: case PERFORM_CODE_MAX_SIZE:
((perform_data_max_size*)_data)->return_value ((perform_data_max_size*)_data)->return_value
= BButton::MaxSize(); = BButton::MaxSize();
return B_OK; return B_OK;
case PERFORM_CODE_PREFERRED_SIZE: case PERFORM_CODE_PREFERRED_SIZE:
((perform_data_preferred_size*)_data)->return_value ((perform_data_preferred_size*)_data)->return_value
= BButton::PreferredSize(); = BButton::PreferredSize();
return B_OK; return B_OK;
case PERFORM_CODE_LAYOUT_ALIGNMENT: case PERFORM_CODE_LAYOUT_ALIGNMENT:
((perform_data_layout_alignment*)_data)->return_value ((perform_data_layout_alignment*)_data)->return_value
= BButton::LayoutAlignment(); = BButton::LayoutAlignment();
return B_OK; return B_OK;
case PERFORM_CODE_HAS_HEIGHT_FOR_WIDTH: case PERFORM_CODE_HAS_HEIGHT_FOR_WIDTH:
((perform_data_has_height_for_width*)_data)->return_value ((perform_data_has_height_for_width*)_data)->return_value
= BButton::HasHeightForWidth(); = BButton::HasHeightForWidth();
return B_OK; return B_OK;
case PERFORM_CODE_GET_HEIGHT_FOR_WIDTH: case PERFORM_CODE_GET_HEIGHT_FOR_WIDTH:
{ {
perform_data_get_height_for_width* data perform_data_get_height_for_width* data
@@ -542,12 +551,14 @@ BButton::Perform(perform_code code, void* _data)
&data->preferred); &data->preferred);
return B_OK; return B_OK;
} }
case PERFORM_CODE_SET_LAYOUT: case PERFORM_CODE_SET_LAYOUT:
{ {
perform_data_set_layout* data = (perform_data_set_layout*)_data; perform_data_set_layout* data = (perform_data_set_layout*)_data;
BButton::SetLayout(data->layout); BButton::SetLayout(data->layout);
return B_OK; return B_OK;
} }
case PERFORM_CODE_LAYOUT_INVALIDATED: case PERFORM_CODE_LAYOUT_INVALIDATED:
{ {
perform_data_layout_invalidated* data perform_data_layout_invalidated* data
@@ -555,11 +566,13 @@ BButton::Perform(perform_code code, void* _data)
BButton::LayoutInvalidated(data->descendants); BButton::LayoutInvalidated(data->descendants);
return B_OK; return B_OK;
} }
case PERFORM_CODE_DO_LAYOUT: case PERFORM_CODE_DO_LAYOUT:
{ {
BButton::DoLayout(); BButton::DoLayout();
return B_OK; return B_OK;
} }
case PERFORM_CODE_SET_ICON: case PERFORM_CODE_SET_ICON:
{ {
perform_data_set_icon* data = (perform_data_set_icon*)_data; perform_data_set_icon* data = (perform_data_set_icon*)_data;
@@ -733,4 +746,3 @@ B_IF_GCC_2(InvalidateLayout__7BButtonb, _ZN7BButton16InvalidateLayoutEb)(
view->Perform(PERFORM_CODE_LAYOUT_INVALIDATED, &data); view->Perform(PERFORM_CODE_LAYOUT_INVALIDATED, &data);
} }