mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:27:43 +00:00
StylePainter: Don't paint hover frame around disabled CoolBar buttons.
This commit is contained in:
parent
269886fc4e
commit
09339fa912
2 changed files with 5 additions and 2 deletions
|
@ -53,7 +53,7 @@ static void paint_button_new(Painter& painter, const Rect& rect, bool pressed, b
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StylePainter::paint_button(Painter& painter, const Rect& rect, ButtonStyle button_style, bool pressed, bool hovered, bool checked)
|
void StylePainter::paint_button(Painter& painter, const Rect& rect, ButtonStyle button_style, bool pressed, bool hovered, bool checked, bool enabled)
|
||||||
{
|
{
|
||||||
if (button_style == ButtonStyle::Normal)
|
if (button_style == ButtonStyle::Normal)
|
||||||
return paint_button_new(painter, rect, pressed, checked, hovered);
|
return paint_button_new(painter, rect, pressed, checked, hovered);
|
||||||
|
@ -65,6 +65,9 @@ void StylePainter::paint_button(Painter& painter, const Rect& rect, ButtonStyle
|
||||||
if (button_style == ButtonStyle::OldNormal)
|
if (button_style == ButtonStyle::OldNormal)
|
||||||
painter.draw_rect(rect, Color::Black);
|
painter.draw_rect(rect, Color::Black);
|
||||||
|
|
||||||
|
if (button_style == ButtonStyle::CoolBar && !enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
PainterStateSaver saver(painter);
|
PainterStateSaver saver(painter);
|
||||||
painter.translate(rect.location());
|
painter.translate(rect.location());
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ enum class FrameShape { NoFrame, Box, Container, Panel, VerticalLine, Horizontal
|
||||||
|
|
||||||
class StylePainter {
|
class StylePainter {
|
||||||
public:
|
public:
|
||||||
static void paint_button(Painter&, const Rect&, ButtonStyle, bool pressed, bool hovered = false, bool checked = false);
|
static void paint_button(Painter&, const Rect&, ButtonStyle, bool pressed, bool hovered = false, bool checked = false, bool enabled = true);
|
||||||
static void paint_surface(Painter&, const Rect&, bool paint_vertical_lines = true);
|
static void paint_surface(Painter&, const Rect&, bool paint_vertical_lines = true);
|
||||||
static void paint_frame(Painter&, const Rect&, FrameShape, FrameShadow, int thickness, bool skip_vertical_lines = false);
|
static void paint_frame(Painter&, const Rect&, FrameShape, FrameShadow, int thickness, bool skip_vertical_lines = false);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue