Apply defaults before loading the theme

* This prevents uninitialized values from being used if the user's
    theme doesn't contain every item we need.
This commit is contained in:
Emmanuel BENOîT 2022-10-22 11:23:31 +02:00
parent 1145bd37e9
commit fb2715a43b

View file

@ -340,7 +340,11 @@ sub themed($)
{ {
my $k = shift; my $k = shift;
unless ( %THEME ) { unless ( %THEME ) {
%THEME = ( %{ &load_theme } , %{ $CONFIG{layout_theme_overrides} } ); %THEME = (
%{ &default_theme } ,
%{ &load_theme } ,
%{ $CONFIG{layout_theme_overrides} }
);
my @to_resolve = grep { ref( $THEME{$_} ) eq 'ThemeRef' } keys %THEME; my @to_resolve = grep { ref( $THEME{$_} ) eq 'ThemeRef' } keys %THEME;
foreach my $k ( @to_resolve ) { foreach my $k ( @to_resolve ) {
theme_resolve( $k ); theme_resolve( $k );