mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:27:46 +00:00
Everywhere: Deduplicate day/month name constants
Day and month name constants are defined in numerous places. This pulls them together into a single place and eliminates the duplication. It also ensures they are `constexpr`.
This commit is contained in:
parent
759857b597
commit
4c5e9f5633
7 changed files with 79 additions and 134 deletions
|
@ -5,7 +5,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/Array.h>
|
||||
#include <AK/DateConstants.h>
|
||||
#include <LibCore/DateTime.h>
|
||||
#include <LibGUI/Calendar.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
|
@ -17,25 +17,6 @@ REGISTER_WIDGET(GUI, Calendar);
|
|||
|
||||
namespace GUI {
|
||||
|
||||
static constexpr Array<StringView, 7> long_day_names = {
|
||||
"Sunday", "Monday", "Tuesday", "Wednesday",
|
||||
"Thursday", "Friday", "Saturday"
|
||||
};
|
||||
|
||||
static constexpr Array<StringView, 7> short_day_names = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
||||
static constexpr Array<StringView, 7> mini_day_names = { "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" };
|
||||
static constexpr Array<StringView, 7> micro_day_names = { "S", "M", "T", "W", "T", "F", "S" };
|
||||
|
||||
static constexpr Array<StringView, 12> long_month_names = {
|
||||
"January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December"
|
||||
};
|
||||
|
||||
static constexpr Array<StringView, 12> short_month_names = {
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
};
|
||||
|
||||
static const auto extra_large_font = Gfx::BitmapFont::load_from_file("/res/fonts/MarietaRegular36.font");
|
||||
static const auto large_font = Gfx::BitmapFont::load_from_file("/res/fonts/MarietaRegular24.font");
|
||||
static const auto medium_font = Gfx::BitmapFont::load_from_file("/res/fonts/PebbletonRegular14.font");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue