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