diff --git a/apps/file_manager/main.cpp b/apps/file_manager/main.cpp index 63f947d..e021bb9 100644 --- a/apps/file_manager/main.cpp +++ b/apps/file_manager/main.cpp @@ -6,7 +6,7 @@ // TODO Possible candidates for moving in the core API: // - String/paths utils -// - Blocking/non-blocking task systems +// - Blocking task systems // TODO Don't show modals if a folder can't be loaded. // Instead, show a list view with an error message, diff --git a/desktop/api.cpp b/desktop/api.cpp index 8ced5bf..52bcc15 100644 --- a/desktop/api.cpp +++ b/desktop/api.cpp @@ -564,7 +564,7 @@ int EsMessageSend(EsElement *element, EsMessage *message) { response = element->messageClass(element, message); } - if (element->state & UI_STATE_INSPECTING) { + if ((element->state & UI_STATE_INSPECTING) && message->type != ES_MSG_GET_INSPECTOR_INFORMATION) { InspectorNotifyElementEvent(element, "message", "Element processed message '%z' with response %i%z.\n", EnumLookupNameFromValue(enumStrings_EsMessageType, message->type), response, handledByUser ? " (from user callback)" : ""); } diff --git a/desktop/gui.cpp b/desktop/gui.cpp index a38947b..ad511ed 100644 --- a/desktop/gui.cpp +++ b/desktop/gui.cpp @@ -3538,6 +3538,7 @@ struct EsCanvasPane : EsElement { double panX, panY, zoom; bool zoomFit, contentsChanged, center; int previousWidth, previousHeight; + EsPoint lastPanPoint; }; EsElement *CanvasPaneGetCanvas(EsElement *element) { @@ -3601,17 +3602,26 @@ int ProcessCanvasPaneMessage(EsElement *element, EsMessage *message) { } else if (message->type == ES_MSG_PAINT) { EsElement *canvas = CanvasPaneGetCanvas(element); if (!canvas) return 0; - UIStyle *style = GetStyle(MakeStyleKey(ES_STYLE_CANVAS_SHADOW, 0), true); - EsRectangle shadow1 = ES_RECT_4PD(canvas->offsetX + style->preferredWidth, canvas->offsetY + canvas->height, - canvas->width, style->preferredHeight); - EsRectangle shadow2 = ES_RECT_4PD(canvas->offsetX + canvas->width, canvas->offsetY + style->preferredHeight, - style->preferredWidth, canvas->height - style->preferredHeight); - style->PaintLayers(message->painter, shadow1, THEME_CHILD_TYPE_ONLY, ES_FLAGS_DEFAULT); - style->PaintLayers(message->painter, shadow2, THEME_CHILD_TYPE_ONLY, ES_FLAGS_DEFAULT); + EsRectangle shadow = ES_RECT_4PD(canvas->offsetX, canvas->offsetY, canvas->width, canvas->height); + style->PaintLayers(message->painter, shadow, THEME_CHILD_TYPE_ONLY, ES_FLAGS_DEFAULT); + } else if (message->type == ES_MSG_MOUSE_MIDDLE_DOWN) { + pane->lastPanPoint = EsMouseGetPosition(pane); + } else if (message->type == ES_MSG_MOUSE_MIDDLE_DRAG) { + // TODO Set cursor. + EsPoint point = EsMouseGetPosition(pane); + pane->zoomFit = false; + pane->panX -= (float) (point.x - pane->lastPanPoint.y) / pane->zoom; + pane->panY -= (float) (point.x - pane->lastPanPoint.y) / pane->zoom; + pane->lastPanPoint = point; + EsElementRelayout(pane); + } else if (message->type == ES_MSG_GET_CURSOR && pane->window->dragged == pane) { + message->cursorStyle = ES_CURSOR_HAND_DRAG; + } else { + return 0; } - return 0; + return ES_HANDLED; } EsCanvasPane *EsCanvasPaneCreate(EsElement *parent, uint64_t flags, const EsStyle *style) { diff --git a/res/Theme Source.dat b/res/Theme Source.dat index 395a94a..2ba73ea 100644 Binary files a/res/Theme Source.dat and b/res/Theme Source.dat differ diff --git a/res/Themes/Theme.dat b/res/Themes/Theme.dat index 7fc9bb1..ed9c15e 100644 Binary files a/res/Themes/Theme.dat and b/res/Themes/Theme.dat differ