[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
|
void
|
||||||
ExtPowerStatusView::Draw(BRect updateRect)
|
ExtPowerStatusView::Draw(BRect updateRect)
|
||||||
{
|
{
|
||||||
if (fSelected)
|
if (fSelected) {
|
||||||
|
rgb_color lowColor = LowColor();
|
||||||
SetLowColor(102, 152, 203);
|
SetLowColor(102, 152, 203);
|
||||||
else
|
FillRect(updateRect, B_SOLID_LOW);
|
||||||
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetLowColor(lowColor);
|
||||||
|
}
|
||||||
PowerStatusView::Draw(updateRect);
|
PowerStatusView::Draw(updateRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ PowerStatusView::MessageReceived(BMessage *message)
|
|||||||
void
|
void
|
||||||
PowerStatusView::_DrawBattery(BRect rect)
|
PowerStatusView::_DrawBattery(BRect rect)
|
||||||
{
|
{
|
||||||
|
BRect lightningRect = rect;
|
||||||
float quarter = floorf((rect.Height() + 1) / 4);
|
float quarter = floorf((rect.Height() + 1) / 4);
|
||||||
rect.top += quarter;
|
rect.top += quarter;
|
||||||
rect.bottom -= quarter;
|
rect.bottom -= quarter;
|
||||||
@@ -246,7 +247,7 @@ PowerStatusView::_DrawBattery(BRect rect)
|
|||||||
// When charging, draw a lightning symbol over the battery.
|
// When charging, draw a lightning symbol over the battery.
|
||||||
SetHighColor(255, 255, 0, 180);
|
SetHighColor(255, 255, 0, 180);
|
||||||
SetDrawingMode(B_OP_ALPHA);
|
SetDrawingMode(B_OP_ALPHA);
|
||||||
SetScale(std::min(Bounds().Width(), Bounds().Height()) / 16);
|
SetScale(std::min(lightningRect.Width(), lightningRect.Height()) / 16);
|
||||||
|
|
||||||
static const BPoint points[] = {
|
static const BPoint points[] = {
|
||||||
BPoint(3, 14),
|
BPoint(3, 14),
|
||||||
|
|||||||
Reference in New Issue
Block a user