mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 16:58:52 +00:00
can now tile background and made sure the IRC choose server popup still works
This commit is contained in:
parent
50154a23cb
commit
c23882dde1
Notes:
sideshowbarker
2024-07-19 13:53:58 +09:00
Author: https://github.com/alexispurslane
Commit: c23882dde1
Pull-request: https://github.com/SerenityOS/serenity/pull/118
Reviewed-by: https://github.com/awesomekling
15 changed files with 127 additions and 44 deletions
|
@ -112,19 +112,25 @@ Color CConfigFile::read_color_entry(const String& group, const String &key, Colo
|
|||
return default_value;
|
||||
}
|
||||
|
||||
Vector<String> shades = read_entry(group, key).split(',');
|
||||
bool ok = shades.size() >= 3;
|
||||
auto shades = read_entry(group, key).split(',');
|
||||
if (shades.size() < 3)
|
||||
return default_value;
|
||||
bool ok1 = true,
|
||||
ok2 = true,
|
||||
ok3 = true,
|
||||
ok4 = true;
|
||||
Color value;
|
||||
if (shades.size() == 3)
|
||||
value = Color(shades[0].to_uint(ok),
|
||||
shades[1].to_uint(ok),
|
||||
shades[2].to_uint(ok));
|
||||
else
|
||||
value = Color(shades[0].to_uint(ok),
|
||||
shades[1].to_uint(ok),
|
||||
shades[2].to_uint(ok),
|
||||
shades[3].to_uint(ok));
|
||||
if (!ok)
|
||||
if (shades.size() == 3) {
|
||||
value = Color(shades[0].to_uint(ok1),
|
||||
shades[1].to_uint(ok2),
|
||||
shades[2].to_uint(ok3));
|
||||
} else {
|
||||
value = Color(shades[0].to_uint(ok1),
|
||||
shades[1].to_uint(ok2),
|
||||
shades[2].to_uint(ok3),
|
||||
shades[3].to_uint(ok4));
|
||||
}
|
||||
if (!(ok1 && ok2 && ok3 && ok4))
|
||||
return default_value;
|
||||
return value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue