2020-01-18 09:38:21 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
|
2020-02-06 12:07:05 +01:00
|
|
|
#include <LibGfx/Bitmap.h>
|
2020-08-12 19:54:17 +10:00
|
|
|
#include <LibGfx/ClassicStylePainter.h>
|
2020-02-06 12:04:00 +01:00
|
|
|
#include <LibGfx/Painter.h>
|
|
|
|
|
#include <LibGfx/Palette.h>
|
|
|
|
|
#include <LibGfx/StylePainter.h>
|
2019-02-10 07:11:01 +01:00
|
|
|
|
2020-02-06 11:56:38 +01:00
|
|
|
namespace Gfx {
|
|
|
|
|
|
2020-08-12 19:54:17 +10:00
|
|
|
BaseStylePainter& StylePainter::current()
|
2019-05-05 14:39:37 +02:00
|
|
|
{
|
2020-08-12 19:54:17 +10:00
|
|
|
static ClassicStylePainter style;
|
|
|
|
|
return style;
|
2019-05-05 14:39:37 +02:00
|
|
|
}
|
|
|
|
|
|
2023-10-27 14:24:15 -06:00
|
|
|
void StylePainter::paint_tab_button(Painter& painter, IntRect const& rect, Palette const& palette, bool active, bool hovered, bool enabled, TabPosition position, bool in_active_window, bool accented)
|
2019-03-27 20:48:23 +01:00
|
|
|
{
|
2022-08-07 20:08:16 -04:00
|
|
|
current().paint_tab_button(painter, rect, palette, active, hovered, enabled, position, in_active_window, accented);
|
2019-03-27 20:48:23 +01:00
|
|
|
}
|
|
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
void StylePainter::paint_button(Painter& painter, IntRect const& rect, Palette const& palette, ButtonStyle button_style, bool pressed, bool hovered, bool checked, bool enabled, bool focused, bool default_button)
|
2019-02-10 07:11:01 +01:00
|
|
|
{
|
2022-01-24 14:22:02 -05:00
|
|
|
current().paint_button(painter, rect, palette, button_style, pressed, hovered, checked, enabled, focused, default_button);
|
2019-02-10 07:11:01 +01:00
|
|
|
}
|
2019-03-04 10:47:54 +01:00
|
|
|
|
2023-04-29 16:47:52 -04:00
|
|
|
void StylePainter::paint_frame(Painter& painter, IntRect const& rect, Palette const& palette, FrameStyle style, bool skip_vertical_lines)
|
2019-04-10 03:43:46 +02:00
|
|
|
{
|
2023-04-29 16:47:52 -04:00
|
|
|
current().paint_frame(painter, rect, palette, style, skip_vertical_lines);
|
2019-04-10 03:43:46 +02:00
|
|
|
}
|
2019-04-16 17:02:26 +02:00
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
void StylePainter::paint_window_frame(Painter& painter, IntRect const& rect, Palette const& palette)
|
2019-04-16 17:02:26 +02:00
|
|
|
{
|
2020-08-12 19:54:17 +10:00
|
|
|
current().paint_window_frame(painter, rect, palette);
|
2019-04-16 17:02:26 +02:00
|
|
|
}
|
2019-08-14 20:31:46 +02:00
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
void StylePainter::paint_progressbar(Painter& painter, IntRect const& rect, Palette const& palette, int min, int max, int value, StringView text, Orientation orientation)
|
2019-08-14 20:31:46 +02:00
|
|
|
{
|
2021-04-13 16:18:20 +02:00
|
|
|
current().paint_progressbar(painter, rect, palette, min, max, value, text, orientation);
|
2020-01-08 20:29:12 +01:00
|
|
|
}
|
|
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
void StylePainter::paint_radio_button(Painter& painter, IntRect const& rect, Palette const& palette, bool is_checked, bool is_being_pressed)
|
2020-01-08 20:29:12 +01:00
|
|
|
{
|
2020-08-12 19:54:17 +10:00
|
|
|
current().paint_radio_button(painter, rect, palette, is_checked, is_being_pressed);
|
2020-01-08 20:29:12 +01:00
|
|
|
}
|
2020-02-06 11:56:38 +01:00
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
void StylePainter::paint_check_box(Painter& painter, IntRect const& rect, Palette const& palette, bool is_enabled, bool is_checked, bool is_being_pressed)
|
2020-09-11 17:21:53 +02:00
|
|
|
{
|
|
|
|
|
current().paint_check_box(painter, rect, palette, is_enabled, is_checked, is_being_pressed);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
void StylePainter::paint_transparency_grid(Painter& painter, IntRect const& rect, Palette const& palette)
|
2020-09-25 16:33:12 +02:00
|
|
|
{
|
|
|
|
|
current().paint_transparency_grid(painter, rect, palette);
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-27 11:59:58 +01:00
|
|
|
void StylePainter::paint_simple_rect_shadow(Painter& painter, IntRect const& rect, Bitmap const& shadow_bitmap, bool shadow_includes_frame, bool fill_content)
|
|
|
|
|
{
|
|
|
|
|
current().paint_simple_rect_shadow(painter, rect, shadow_bitmap, shadow_includes_frame, fill_content);
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-06 11:56:38 +01:00
|
|
|
}
|