1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:47:46 +00:00

Theming: Add alignment section

This commit removes the IsTitleCenter property and replaces it with
the TitleAlignment property that supports "Left", "Right" & "Center".
This commit is contained in:
Filiph Sandström 2022-01-01 18:26:19 +01:00 committed by Andreas Kling
parent 2bb32a87f9
commit 35dac843b4
21 changed files with 181 additions and 32 deletions

View file

@ -1,6 +1,7 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2022, Filiph Sandström <filiph.sandstrom@filfatstudios.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -57,6 +58,14 @@ void Palette::set_color(ColorRole role, Color color)
theme.color[(int)role] = color.value();
}
void Palette::set_alignment(AlignmentRole role, Gfx::TextAlignment value)
{
if (m_impl->ref_count() != 1)
m_impl = m_impl->clone();
auto& theme = const_cast<SystemTheme&>(impl().theme());
theme.alignment[(int)role] = value;
}
void Palette::set_flag(FlagRole role, bool value)
{
if (m_impl->ref_count() != 1)