1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:37:45 +00:00

StylePainter: Remove some unused code.

This commit is contained in:
Andreas Kling 2019-05-25 03:29:37 +02:00
parent 957f8b84f2
commit be62b42352
2 changed files with 2 additions and 12 deletions

View file

@ -65,13 +65,6 @@ static void paint_button_new(Painter& painter, const Rect& rect, bool pressed, b
painter.draw_line({ 0, 0 }, { rect.width() - 2, 0 }, highlight_color2); painter.draw_line({ 0, 0 }, { rect.width() - 2, 0 }, highlight_color2);
painter.draw_line({ 0, 1 }, { 0, rect.height() - 2 }, highlight_color2); painter.draw_line({ 0, 1 }, { 0, rect.height() - 2 }, highlight_color2);
#if 0
// Inner highlight (this looks "too thick" to me right now..)
Color highlight_color1 = Color::from_rgb(0xffffff);
painter.draw_line({ 1, 1 }, { rect.width() - 3, 1 }, highlight_color1);
painter.draw_line({ 1, 2 }, { 1, rect.height() - 3 }, highlight_color1);
#endif
// Outer shadow // Outer shadow
painter.draw_line({ 0, rect.height() - 1 }, { rect.width() - 1, rect.height() - 1 }, shadow_color2); painter.draw_line({ 0, rect.height() - 1 }, { rect.width() - 1, rect.height() - 1 }, shadow_color2);
painter.draw_line({ rect.width() - 1, 0 }, { rect.width() - 1, rect.height() - 2 }, shadow_color2); painter.draw_line({ rect.width() - 1, 0 }, { rect.width() - 1, rect.height() - 2 }, shadow_color2);
@ -91,9 +84,6 @@ void StylePainter::paint_button(Painter& painter, const Rect& rect, ButtonStyle
Color highlight_color = Color::White; Color highlight_color = Color::White;
Color shadow_color = Color(96, 96, 96); Color shadow_color = Color(96, 96, 96);
if (button_style == ButtonStyle::OldNormal)
painter.draw_rect(rect, Color::Black);
if (button_style == ButtonStyle::CoolBar && !enabled) if (button_style == ButtonStyle::CoolBar && !enabled)
return; return;
@ -111,7 +101,7 @@ void StylePainter::paint_button(Painter& painter, const Rect& rect, ButtonStyle
// Bottom highlight // Bottom highlight
painter.draw_line({ rect.width() - 2, 1 }, { rect.width() - 2, rect.height() - 3 }, highlight_color); painter.draw_line({ rect.width() - 2, 1 }, { rect.width() - 2, rect.height() - 3 }, highlight_color);
painter.draw_line({ 1, rect.height() - 2 }, { rect.width() - 2, rect.height() - 2 }, highlight_color); painter.draw_line({ 1, rect.height() - 2 }, { rect.width() - 2, rect.height() - 2 }, highlight_color);
} else if (button_style == ButtonStyle::OldNormal || (button_style == ButtonStyle::CoolBar && hovered)) { } else if (button_style == ButtonStyle::CoolBar && hovered) {
// Base // Base
painter.fill_rect({ 1, 1, rect.width() - 2, rect.height() - 2 }, button_color); painter.fill_rect({ 1, 1, rect.width() - 2, rect.height() - 2 }, button_color);

View file

@ -3,7 +3,7 @@
class Painter; class Painter;
class Rect; class Rect;
enum class ButtonStyle { Normal, CoolBar, OldNormal }; enum class ButtonStyle { Normal, CoolBar };
enum class FrameShadow { Plain, Raised, Sunken }; enum class FrameShadow { Plain, Raised, Sunken };
enum class FrameShape { NoFrame, Box, Container, Panel, VerticalLine, HorizontalLine }; enum class FrameShape { NoFrame, Box, Container, Panel, VerticalLine, HorizontalLine };