[PowerStatus] Fixes some drawing glitches
* Fixes the position of the lightning over the battery * Fixes the selection in the info Window (Why is the selected color hardcoded?) * Fixes #13784
This commit is contained in:
@@ -279,11 +279,12 @@ ExtPowerStatusView::ExtPowerStatusView(PowerStatusDriverInterface* interface,
|
||||
void
|
||||
ExtPowerStatusView::Draw(BRect updateRect)
|
||||
{
|
||||
if (fSelected)
|
||||
if (fSelected) {
|
||||
rgb_color lowColor = LowColor();
|
||||
SetLowColor(102, 152, 203);
|
||||
else
|
||||
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
|
||||
FillRect(updateRect, B_SOLID_LOW);
|
||||
SetLowColor(lowColor);
|
||||
}
|
||||
PowerStatusView::Draw(updateRect);
|
||||
}
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ PowerStatusView::MessageReceived(BMessage *message)
|
||||
void
|
||||
PowerStatusView::_DrawBattery(BRect rect)
|
||||
{
|
||||
BRect lightningRect = rect;
|
||||
float quarter = floorf((rect.Height() + 1) / 4);
|
||||
rect.top += quarter;
|
||||
rect.bottom -= quarter;
|
||||
@@ -246,7 +247,7 @@ PowerStatusView::_DrawBattery(BRect rect)
|
||||
// When charging, draw a lightning symbol over the battery.
|
||||
SetHighColor(255, 255, 0, 180);
|
||||
SetDrawingMode(B_OP_ALPHA);
|
||||
SetScale(std::min(Bounds().Width(), Bounds().Height()) / 16);
|
||||
SetScale(std::min(lightningRect.Width(), lightningRect.Height()) / 16);
|
||||
|
||||
static const BPoint points[] = {
|
||||
BPoint(3, 14),
|
||||
|
||||
Reference in New Issue
Block a user