This commit is contained in:
nakst 2021-08-19 21:08:09 +01:00
parent db3f454bba
commit c4b48f0698
3 changed files with 19 additions and 2 deletions
apps/file_manager
desktop
kernel

View File

@ -528,8 +528,20 @@ void ListItemGenerateThumbnailTask(Instance *, Task *task) {
return; // There are no longer any list items visible for this file.
}
EsFileInformation information = EsFileOpen(STRING(task->string), ES_FILE_READ | ES_NODE_FAIL_IF_NOT_FOUND);
if (ES_SUCCESS != information.error) {
return; // The file could not be loaded.
}
if (information.size > 64 * 1024 * 1024) {
EsHandleClose(information.handle);
return; // The file is too large.
}
size_t fileBytes;
void *file = EsFileReadAll(STRING(task->string), &fileBytes);
void *file = EsFileReadAllFromHandle(information.handle, &fileBytes);
EsHandleClose(information.handle);
if (!file) {
return; // The file could not be loaded.

View File

@ -3742,7 +3742,7 @@ EsButton *EsButtonCreate(EsElement *parent, uint64_t flags, const EsStyle *style
style = UIGetDefaultStyleVariant(style, parent);
}
if (style == ES_STYLE_PUSH_BUTTON_NORMAL) {
if (style == ES_STYLE_PUSH_BUTTON_NORMAL || style == ES_STYLE_PUSH_BUTTON_DANGEROUS) {
flags |= ES_BUTTON_PUSH;
} else if (style == ES_STYLE_PUSH_BUTTON_TOOLBAR || style == ES_STYLE_PUSH_BUTTON_TOOLBAR_MEDIUM
|| style == ES_STYLE_PUSH_BUTTON_TOOLBAR_BIG || style == ES_STYLE_PUSH_BUTTON_STATUS_BAR) {

View File

@ -3,6 +3,11 @@
// TODO Don't send key released messages if the focused window has changed.
// TODO Blur clamping is incorrect with minimal repainting!
// Terminology:
// Dynamic resize - flicker-free resizing in container windows with an embedded window owned by a separate process.
// Direct update - paint first onto the video card's framebuffer, then onto the window manager's; used to reduce latency.
// Fast scroll - scrolling by shifting the bits in the window's surface, rather than repainting the entire area.
struct EmbeddedWindow {
void Destroy();
void Close();