feat: Added option to specify max file size to load into memory

This commit is contained in:
WerWolv
2024-05-19 15:10:22 +02:00
parent e9b492a287
commit 71c1bcde0d
8 changed files with 64 additions and 16 deletions

View File

@@ -312,6 +312,23 @@ namespace hex {
}
bool SliderDataSize::draw(const std::string &name) {
return ImGuiExt::SliderBytes(name.c_str(), &m_value, m_min, m_max);
}
void SliderDataSize::load(const nlohmann::json &data) {
if (data.is_number_integer()) {
m_value = data.get<u64>();
} else {
log::warn("Invalid data type loaded from settings for slider!");
}
}
nlohmann::json SliderDataSize::store() {
return m_value;
}
ColorPicker::ColorPicker(ImColor defaultColor) {
m_value = {
defaultColor.Value.x,