bugfixes; introduce TEXTBOX_BORDERED_SINGLE_MEDIUM

This commit is contained in:
nakst 2021-11-28 20:51:23 +00:00
parent aaa0114e8d
commit 3ce62566b9
9 changed files with 15 additions and 33 deletions

View File

@ -83,7 +83,7 @@ const EsStyle styleBitmapSizeTextbox = {
.metrics = {
.mask = ES_THEME_METRICS_PREFERRED_WIDTH,
.preferredWidth = 70,
.preferredWidth = 80,
},
};
@ -677,7 +677,7 @@ void MenuImage(Instance *instance, EsElement *element, EsCommand *) {
bytes = EsStringFormat(buffer, sizeof(buffer), "%d", instance->bitmapWidth);
EsTextDisplayCreate(table, ES_CELL_H_RIGHT, ES_STYLE_TEXT_LABEL, INTERFACE_STRING(ImageEditorPropertyWidth));
textbox = EsTextboxCreate(table, ES_TEXTBOX_EDIT_BASED, &styleBitmapSizeTextbox);
textbox = EsTextboxCreate(table, ES_TEXTBOX_EDIT_BASED, ES_STYLE_TEXTBOX_BORDERED_SINGLE_MEDIUM);
EsTextboxInsert(textbox, buffer, bytes, false);
textbox->userData.i = 0;
textbox->messageUser = BitmapSizeTextboxMessage;

View File

@ -53,15 +53,6 @@ const EsStyle styleButtonsRow = {
},
};
const EsStyle styleTextboxMedium = {
.inherit = ES_STYLE_TEXTBOX_BORDERED_SINGLE,
.metrics = {
.mask = ES_THEME_METRICS_PREFERRED_WIDTH,
.preferredWidth = 80,
},
};
InstallerMetadata *metadata;
Array<EsMessageDevice> connectedDrives;
EsListView *drivesList;
@ -1139,7 +1130,7 @@ void _start() {
// TODO Make a date/time entry element or textbox overlay.
EsTextDisplayCreate(table, ES_CELL_H_RIGHT, ES_STYLE_TEXT_LABEL, INTERFACE_STRING(InstallerTime));
timeTextbox = EsTextboxCreate(table, ES_CELL_H_LEFT, &styleTextboxMedium);
timeTextbox = EsTextboxCreate(table, ES_CELL_H_LEFT, ES_STYLE_TEXTBOX_BORDERED_SINGLE_MEDIUM);
EsTextboxInsert(timeTextbox, timeBuffer, timeBytes);
// TODO A date field.

View File

@ -1257,8 +1257,7 @@ EsMessage *EsMessageReceive() {
for (uintptr_t i = 0; i < gui.allWindows.Length(); i++) {
UIScaleChanged(gui.allWindows[i], &message.message);
gui.allWindows[i]->state |= UI_STATE_RELAYOUT;
UIWindowNeedsUpdate(gui.allWindows[i]);
EsElementRelayout(gui.allWindows[i]);
}
return &message.message;

View File

@ -6523,7 +6523,7 @@ void UIScaleChanged(EsElement *element, EsMessage *message) {
EsMessageMutexCheck();
element->RefreshStyle(nullptr, false, true);
element->state |= UI_STATE_RELAYOUT | UI_STATE_RELAYOUT_CHILD;
element->offsetX = element->offsetY = element->width = element->height = 0;
EsMessageSend(element, message);
for (uintptr_t i = 0; i < element->children.Length(); i++) {
@ -6537,7 +6537,7 @@ void _EsUISetFont(EsFontFamily id) {
for (uintptr_t i = 0; i < gui.allWindows.Length(); i++) {
UIScaleChanged(gui.allWindows[i], &m);
UIWindowNeedsUpdate(gui.allWindows[i]);
EsElementRelayout(gui.allWindows[i]);
}
}
@ -7213,7 +7213,7 @@ void UIWindowPaintNow(EsWindow *window, ProcessMessageTiming *timing, bool after
void UIWindowLayoutNow(EsWindow *window, ProcessMessageTiming *timing) {
if (timing) timing->startLayout = EsTimeStampMs();
window->InternalMove(window->width, window->height, 0, 0);
window->InternalMove(window->windowWidth, window->windowHeight, 0, 0);
while (window->updateActions.Length()) {
// TODO Preventing/detecting infinite cycles?
@ -7466,8 +7466,8 @@ void UIProcessWindowManagerMessage(EsWindow *window, EsMessage *message, Process
UIRefreshPrimaryClipboard(window); // Embedded window activated.
}
window->width = window->windowWidth = message->windowResized.content.r;
window->height = window->windowHeight = message->windowResized.content.b;
window->windowWidth = message->windowResized.content.r;
window->windowHeight = message->windowResized.content.b;
if (window->windowStyle == ES_WINDOW_CONTAINER) {
EsRectangle opaqueBounds = ES_RECT_4(CONTAINER_OPAQUE_C, window->windowWidth - CONTAINER_OPAQUE_C,

View File

@ -1949,7 +1949,7 @@ struct EsListView : EsElement {
selectedCellStyle = GetStyle(MakeStyleKey(ES_STYLE_LIST_SELECTED_CHOICE_CELL, 0), false);
EsListViewChangeStyles(this, nullptr, nullptr, nullptr, nullptr, ES_FLAGS_DEFAULT, ES_FLAGS_DEFAULT);
} else if (message->type == ES_MSG_LIST_VIEW_GET_CONTENT) {
} else if (message->type == ES_MSG_LIST_VIEW_GET_CONTENT && activeColumns.Length()) {
uintptr_t index = message->getContent.index;
ListViewFixedItemData data = {};

View File

@ -91,15 +91,6 @@ const EsStyle styleSettingsGroupContainer3 = {
},
};
const EsStyle styleSettingsNumberTextbox = {
.inherit = ES_STYLE_TEXTBOX_BORDERED_SINGLE,
.metrics = {
.mask = ES_THEME_METRICS_PREFERRED_WIDTH,
.preferredWidth = 80,
},
};
const EsStyle styleSettingsCheckboxGroup = {
.metrics = {
.mask = ES_THEME_METRICS_GAP_MAJOR | ES_THEME_METRICS_GAP_MINOR,
@ -435,7 +426,7 @@ void SettingsAddNumberBox(EsElement *table, const char *string, ptrdiff_t string
control->discreteStep = discreteStep;
EsTextDisplayCreate(table, ES_CELL_H_RIGHT | ES_CELL_H_PUSH, 0, string, stringBytes);
EsTextbox *textbox = EsTextboxCreate(table, ES_CELL_H_LEFT | ES_CELL_H_PUSH | ES_TEXTBOX_EDIT_BASED | ES_ELEMENT_FREE_USER_DATA, &styleSettingsNumberTextbox);
EsTextbox *textbox = EsTextboxCreate(table, ES_CELL_H_LEFT | ES_CELL_H_PUSH | ES_TEXTBOX_EDIT_BASED | ES_ELEMENT_FREE_USER_DATA, ES_STYLE_TEXTBOX_BORDERED_SINGLE_MEDIUM);
EsTextboxUseNumberOverlay(textbox, false);
textbox->userData = control;
textbox->accessKey = accessKey;
@ -674,19 +665,19 @@ void SettingsPageKeyboard(EsElement *element, SettingsPage *page) {
EsPanelSetBands(table, 2);
EsTextDisplayCreate(table, ES_CELL_H_RIGHT | ES_CELL_H_PUSH, 0, INTERFACE_STRING(DesktopSettingsKeyboardKeyRepeatDelay)); // TODO.
textbox = EsTextboxCreate(table, ES_CELL_H_LEFT | ES_CELL_H_PUSH | ES_TEXTBOX_EDIT_BASED, &styleSettingsNumberTextbox);
textbox = EsTextboxCreate(table, ES_CELL_H_LEFT | ES_CELL_H_PUSH | ES_TEXTBOX_EDIT_BASED, ES_STYLE_TEXTBOX_BORDERED_SINGLE_MEDIUM);
textbox->accessKey = 'D';
EsTextboxUseNumberOverlay(textbox, false);
EsTextboxInsert(textbox, "400 ms");
EsTextDisplayCreate(table, ES_CELL_H_RIGHT | ES_CELL_H_PUSH, 0, INTERFACE_STRING(DesktopSettingsKeyboardKeyRepeatRate)); // TODO.
textbox = EsTextboxCreate(table, ES_CELL_H_LEFT | ES_CELL_H_PUSH | ES_TEXTBOX_EDIT_BASED, &styleSettingsNumberTextbox);
textbox = EsTextboxCreate(table, ES_CELL_H_LEFT | ES_CELL_H_PUSH | ES_TEXTBOX_EDIT_BASED, ES_STYLE_TEXTBOX_BORDERED_SINGLE_MEDIUM);
textbox->accessKey = 'R';
EsTextboxUseNumberOverlay(textbox, false);
EsTextboxInsert(textbox, "40 ms");
EsTextDisplayCreate(table, ES_CELL_H_RIGHT | ES_CELL_H_PUSH, 0, INTERFACE_STRING(DesktopSettingsKeyboardCaretBlinkRate)); // TODO.
textbox = EsTextboxCreate(table, ES_CELL_H_LEFT | ES_CELL_H_PUSH | ES_TEXTBOX_EDIT_BASED, &styleSettingsNumberTextbox);
textbox = EsTextboxCreate(table, ES_CELL_H_LEFT | ES_CELL_H_PUSH | ES_TEXTBOX_EDIT_BASED, ES_STYLE_TEXTBOX_BORDERED_SINGLE_MEDIUM);
textbox->accessKey = 'B';
EsTextboxUseNumberOverlay(textbox, false);
EsTextboxInsert(textbox, "500 ms");

View File

@ -120,3 +120,4 @@ define ES_STYLE_TOOLBAR_SPACER (ES_STYLE_CAST(5))
define ES_STYLE_TOOLBAR_BUTTON_GROUP_SEPARATOR (ES_STYLE_CAST(7))
define ES_STYLE_TOOLBAR_SPACER_SMALL (ES_STYLE_CAST(3))
define ES_STYLE_LIST_CHOICE_ITEM_2X (ES_STYLE_CAST(9))
define ES_STYLE_TEXTBOX_BORDERED_SINGLE_MEDIUM (ES_STYLE_CAST(11))

Binary file not shown.

Binary file not shown.