diff --git a/apps/installer.cpp b/apps/installer.cpp index afd3eaf..39f09b6 100644 --- a/apps/installer.cpp +++ b/apps/installer.cpp @@ -1031,7 +1031,8 @@ void _start() { EsSyscall(ES_SYSCALL_WINDOW_SET_PROPERTY, handle, ES_WINDOW_SOLID_TRUE, 0, ES_WINDOW_PROPERTY_SOLID); EsSyscall(ES_SYSCALL_WINDOW_SET_PROPERTY, handle, 0, 0, ES_WINDOW_PROPERTY_FOCUSED); - EsPanel *sheet = EsPanelCreate(window, ES_PANEL_VERTICAL | ES_CELL_PUSH | ES_CELL_CENTER, ES_STYLE_INSTALLER_ROOT); + EsPanel *clearBackground = EsPanelCreate(window, ES_CELL_FILL, ES_STYLE_CLEAR_BACKGROUND); + EsPanel *sheet = EsPanelCreate(clearBackground, ES_PANEL_VERTICAL | ES_CELL_PUSH | ES_CELL_CENTER, ES_STYLE_INSTALLER_ROOT); switcher = EsPanelCreate(sheet, ES_CELL_H_FILL | ES_PANEL_SWITCHER); switcher->messageUser = SwitcherMessage; diff --git a/apps/test.cpp b/apps/test.cpp index 4be63b8..73090c5 100644 --- a/apps/test.cpp +++ b/apps/test.cpp @@ -152,6 +152,9 @@ void InitialiseInstance(EsInstance *instance) { EsPanel *panel = EsPanelCreate(instance->window, ES_CELL_FILL, &stylePanel); EsButtonCreate(panel, ES_BUTTON_CHECKBOX, 0, "Checkbox"); + EsTextboxCreate(panel); + EsTextboxCreate(panel); + EsButtonOnCommand(EsButtonCreate(panel, ES_FLAGS_DEFAULT, 0, "Alert 1"), [] (EsInstance *, EsElement *element, EsCommand *) { EsDialog *dialog = EsDialogShow(element->window, "Rename multiple items", -1, "Choose the format for the new names.", -1, ES_ICON_DOCUMENT_EDIT, ES_FLAGS_DEFAULT); diff --git a/desktop/gui.cpp b/desktop/gui.cpp index ca50358..5210cbb 100644 --- a/desktop/gui.cpp +++ b/desktop/gui.cpp @@ -40,7 +40,7 @@ struct { // Input. bool draggingStarted, mouseButtonDown; uint8_t leftModifiers, rightModifiers; - int lastClickX, lastClickY, lastClickButton, resizeType; + int lastClickX, lastClickY, lastClickButton; // Menus. bool menuMode; @@ -59,7 +59,6 @@ struct { // Misc. Array allWindows; HashTable keyboardShortcutNames; - EsCursorStyle resizeCursor; EsElement *insertAfter; // Resizing data. @@ -445,11 +444,15 @@ struct EsWindow : EsElement { EsWindowStyle windowStyle; uint32_t windowWidth, windowHeight; + // TODO Replace this with a bitset? bool willUpdate, toolbarFillMode, destroyInstanceAfterClose, doNotPaint; bool restoreOnNextMove, resetPositionOnNextMove, receivedFirstResize, isMaximised; bool hovering, activated, appearActivated; bool visualizeRepaints, visualizeLayoutBounds, visualizePaintSteps; // Inspector properties. + uint8_t resizeType; + EsCursorStyle resizeCursor; + EsElement *mainPanel, *toolbar; EsPanel *toolbarSwitcher; Array dialogs; @@ -669,14 +672,14 @@ int ProcessWindowBorderMessage(EsWindow *window, EsMessage *message, EsRectangle message->cursorStyle = ES_CURSOR_NORMAL; if (window->isMaximised) { - gui.resizeType = 0; - gui.resizeCursor = message->cursorStyle; + window->resizeType = 0; + window->resizeCursor = message->cursorStyle; } else { bool left = position.x < to, right = position.x >= bounds.r - to, top = position.y < to, bottom = position.y >= bounds.b - to; if (gui.resizing) { - message->cursorStyle = gui.resizeCursor; + message->cursorStyle = window->resizeCursor; } else if (position.x < from || position.y < from || position.x >= bounds.r - from || position.y >= bounds.b - from) { } else if ((right && top) || (bottom && left)) { @@ -690,8 +693,8 @@ int ProcessWindowBorderMessage(EsWindow *window, EsMessage *message, EsRectangle } if (!window->pressed && !gui.mouseButtonDown) { - gui.resizeType = (left ? RESIZE_LEFT : 0) | (right ? RESIZE_RIGHT : 0) | (top ? RESIZE_TOP : 0) | (bottom ? RESIZE_BOTTOM : 0); - gui.resizeCursor = message->cursorStyle; + window->resizeType = (left ? RESIZE_LEFT : 0) | (right ? RESIZE_RIGHT : 0) | (top ? RESIZE_TOP : 0) | (bottom ? RESIZE_BOTTOM : 0); + window->resizeCursor = message->cursorStyle; } } @@ -702,15 +705,15 @@ int ProcessWindowBorderMessage(EsWindow *window, EsMessage *message, EsRectangle if (gui.resizing) { EsPoint screenPosition = EsMouseGetPosition(nullptr); - WindowChangeBounds(gui.resizeType, screenPosition.x, screenPosition.y, + WindowChangeBounds(window->resizeType, screenPosition.x, screenPosition.y, &gui.lastClickX, &gui.lastClickY, window, gui.resizingBothSides, &gui.resizeStartBounds); } } else if (message->type == ES_MSG_MOUSE_LEFT_DRAG) { EsPoint screenPosition = EsMouseGetPosition(nullptr); - if (!window->isMaximised || gui.resizeType == RESIZE_MOVE) { - WindowChangeBounds(gui.resizeType, screenPosition.x, screenPosition.y, + if (!window->isMaximised || window->resizeType == RESIZE_MOVE) { + WindowChangeBounds(window->resizeType, screenPosition.x, screenPosition.y, &gui.lastClickX, &gui.lastClickY, window, gui.resizingBothSides, &gui.resizeStartBounds); gui.resizing = true; @@ -7403,7 +7406,7 @@ void UIProcessWindowManagerMessage(EsWindow *window, EsMessage *message, Process } else if (message->type == ES_MSG_SCROLL_WHEEL) { EsElement *element = window->dragged ?: window->pressed ?: window->hovered; - if (element && (~element->flags & ES_ELEMENT_DISABLED) && (~element->state & UI_STATE_BLOCK_INTERACTION)) { + if (element && (~element->state & UI_STATE_BLOCK_INTERACTION)) { UIMessageSendPropagateToAncestors(element, message); } } else if (message->type == ES_MSG_WINDOW_RESIZED) { diff --git a/res/Theme Source.dat b/res/Theme Source.dat index beb7658..d78f6a2 100644 Binary files a/res/Theme Source.dat and b/res/Theme Source.dat differ