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,
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),
fPreferredSize(-1, -1),
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,
uint32 flags)
: BControl(name, label, message,
:
BControl(name, label, message,
flags | B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE),
fPreferredSize(-1, -1),
fFlags(0),
@@ -69,7 +71,8 @@ BButton::BButton(const char* name, 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),
fPreferredSize(-1, -1),
fFlags(0),
@@ -86,7 +89,8 @@ BButton::~BButton()
BButton::BButton(BMessage* archive)
: BControl(archive),
:
BControl(archive),
fPreferredSize(-1, -1),
fFlags(0),
fBehavior(B_BUTTON_BEHAVIOR),
@@ -496,10 +500,10 @@ BButton::AllDetached()
BHandler*
BButton::ResolveSpecifier(BMessage* message, int32 index,
BMessage *specifier, int32 what,
const char *property)
BMessage* specifier, int32 what, 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
= BButton::MinSize();
return B_OK;
case PERFORM_CODE_MAX_SIZE:
((perform_data_max_size*)_data)->return_value
= BButton::MaxSize();
return B_OK;
case PERFORM_CODE_PREFERRED_SIZE:
((perform_data_preferred_size*)_data)->return_value
= BButton::PreferredSize();
return B_OK;
case PERFORM_CODE_LAYOUT_ALIGNMENT:
((perform_data_layout_alignment*)_data)->return_value
= BButton::LayoutAlignment();
return B_OK;
case PERFORM_CODE_HAS_HEIGHT_FOR_WIDTH:
((perform_data_has_height_for_width*)_data)->return_value
= BButton::HasHeightForWidth();
return B_OK;
case PERFORM_CODE_GET_HEIGHT_FOR_WIDTH:
{
perform_data_get_height_for_width* data
@@ -542,12 +551,14 @@ BButton::Perform(perform_code code, void* _data)
&data->preferred);
return B_OK;
}
case PERFORM_CODE_SET_LAYOUT:
{
perform_data_set_layout* data = (perform_data_set_layout*)_data;
BButton::SetLayout(data->layout);
return B_OK;
}
case PERFORM_CODE_LAYOUT_INVALIDATED:
{
perform_data_layout_invalidated* data
@@ -555,11 +566,13 @@ BButton::Perform(perform_code code, void* _data)
BButton::LayoutInvalidated(data->descendants);
return B_OK;
}
case PERFORM_CODE_DO_LAYOUT:
{
BButton::DoLayout();
return B_OK;
}
case PERFORM_CODE_SET_ICON:
{
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);
}