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:
parent
2bb32a87f9
commit
35dac843b4
21 changed files with 181 additions and 32 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue