Remove custom draw method for AccountListItem
This commit is contained in:
parent
5b5840a79e
commit
883d06c610
|
@ -50,46 +50,3 @@ AccountListItem::SetAccount(const char* name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AccountListItem::DrawItem(BView* owner, BRect frame, bool complete)
|
|
||||||
{
|
|
||||||
rgb_color highColor = owner->HighColor();
|
|
||||||
rgb_color lowColor = owner->LowColor();
|
|
||||||
|
|
||||||
// Draw selection
|
|
||||||
if (IsSelected()) {
|
|
||||||
rgb_color highlightColor = ui_color(B_CONTROL_HIGHLIGHT_COLOR);
|
|
||||||
|
|
||||||
owner->SetLowColor(highlightColor);
|
|
||||||
owner->SetHighColor(highlightColor);
|
|
||||||
owner->FillRect(frame);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw account name
|
|
||||||
rgb_color textColor = ui_color(B_CONTROL_TEXT_COLOR);
|
|
||||||
owner->MovePenTo(frame.left, frame.top + fBaselineOffset);
|
|
||||||
if (!IsEnabled())
|
|
||||||
owner->SetHighColor(tint_color(textColor, B_LIGHTEN_2_TINT));
|
|
||||||
else
|
|
||||||
owner->SetHighColor(textColor);
|
|
||||||
owner->DrawString(Text());
|
|
||||||
|
|
||||||
owner->SetHighColor(highColor);
|
|
||||||
owner->SetLowColor(lowColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AccountListItem::Update(BView* owner, const BFont* font)
|
|
||||||
{
|
|
||||||
if (Text())
|
|
||||||
SetWidth(font->StringWidth(Text()));
|
|
||||||
|
|
||||||
font_height height;
|
|
||||||
font->GetHeight(&height);
|
|
||||||
|
|
||||||
fBaselineOffset = 2 + ceilf(height.ascent + height.leading / 2);
|
|
||||||
|
|
||||||
SetHeight(ceilf(height.ascent) + ceilf(height.descent)
|
|
||||||
+ ceilf(height.leading) + 4);
|
|
||||||
}
|
|
||||||
|
|
|
@ -21,11 +21,6 @@ public:
|
||||||
const char* Account() const;
|
const char* Account() const;
|
||||||
void SetAccount(const char* name);
|
void SetAccount(const char* name);
|
||||||
|
|
||||||
void DrawItem(BView* owner, BRect frame,
|
|
||||||
bool complete = false);
|
|
||||||
|
|
||||||
void Update(BView* owner, const BFont* font);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProtocolSettings* fSettings;
|
ProtocolSettings* fSettings;
|
||||||
BString fAccount;
|
BString fAccount;
|
||||||
|
|
Ŝarĝante…
Reference in New Issue