From 883d06c610d86f871ea0ade28d55996952c40e47 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Thu, 10 Jun 2021 16:28:39 -0500 Subject: [PATCH] Remove custom draw method for AccountListItem --- application/preferences/AccountListItem.cpp | 43 --------------------- application/preferences/AccountListItem.h | 5 --- 2 files changed, 48 deletions(-) diff --git a/application/preferences/AccountListItem.cpp b/application/preferences/AccountListItem.cpp index ace9b0e..cf99b2c 100644 --- a/application/preferences/AccountListItem.cpp +++ b/application/preferences/AccountListItem.cpp @@ -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); -} diff --git a/application/preferences/AccountListItem.h b/application/preferences/AccountListItem.h index a904ce0..809e9ce 100644 --- a/application/preferences/AccountListItem.h +++ b/application/preferences/AccountListItem.h @@ -21,11 +21,6 @@ public: const char* Account() const; void SetAccount(const char* name); - void DrawItem(BView* owner, BRect frame, - bool complete = false); - - void Update(BView* owner, const BFont* font); - private: ProtocolSettings* fSettings; BString fAccount;