Skip to content

Commit 60776ec

Browse files
committed
UI: changed display of BLACK to be a slightly ligher onyx colour.
1 parent 964b0d9 commit 60776ec

7 files changed

Lines changed: 22 additions & 6 deletions

File tree

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2018-10-20 (0.12.14)
2+
UI: fix navigation when network access down then available
3+
UI: changed display of "BLACK" to be a slightly ligher onyx colour.
4+
ANDROID: update help tip in scratch window
5+
16
2018-10-13 (0.12.14)
27
COMMON: fix about page logo
38

src/common/inet2.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,12 @@ socket_t net_listen(int server_port) {
312312
* disconnect the given network connection
313313
*/
314314
void net_disconnect(socket_t s) {
315+
if (s != -1) {
315316
#if defined(_Win32)
316-
closesocket(s);
317+
closesocket(s);
317318
#else
318-
close(s);
319+
close(s);
319320
#endif
321+
}
320322
}
321323

src/platform/android/app/src/main/assets/main.bas

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@ func mk_scratch()
5858
text << "rem Welcome to SmallBASIC"
5959
text << "rem"
6060
if (is_sdl) then
61-
text << "rem Press F1 for keyword help."
61+
text << "rem Press F1 or F2 for keyword help."
6262
text << "rem Press and hold Ctrl then press 'h' for editor help."
6363
text << "rem Press and hold Ctrl then press 'r' to RUN this program."
6464
text << "rem Click the right mouse button for menu options."
6565
else
6666
text << "rem Press the 3 vertical dots for menu options."
67+
text << "rem Press and drag the line numbers to scroll."
6768
endif
6869
try
6970
tsave scratch_file, text

src/ui/inputs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int get_color(var_p_t value, int def) {
5656
} else if (n[0] == '#' && n[1]) {
5757
result = strtol(n + 1, NULL, 16);
5858
} else if (strcasecmp(n, "black") == 0) {
59-
result = 0;
59+
result = DEFAULT_BACKGROUND;
6060
} else if (strcasecmp(n, "red") == 0) {
6161
result = 0x800000;
6262
} else if (strcasecmp(n, "green") == 0) {

src/ui/inputs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
#include "ui/strlib.h"
1717
#include "ui/shape.h"
1818
#include "ui/image.h"
19+
#include "ui/utils.h"
1920

2021
const uint32_t colors[] = {
21-
0x000000, // 0 black
22+
DEFAULT_BACKGROUND, // 0 black
2223
0x000080, // 1 blue
2324
0x008000, // 2 green
2425
0x008080, // 3 cyan

src/ui/system.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,13 @@ char *System::loadResource(const char *fileName) {
491491
opt_file_permitted = 0;
492492
}
493493
}
494+
if (buffer == NULL) {
495+
// remove failed item from history
496+
strlib::String *old = _history.peek();
497+
if (old && old->equals(fileName)) {
498+
delete _history.pop();
499+
}
500+
}
494501
return buffer;
495502
}
496503

src/ui/utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#endif
1818

1919
#define DEFAULT_FOREGROUND 0xa1a1a1
20-
#define DEFAULT_BACKGROUND 0
20+
#define DEFAULT_BACKGROUND 0x121212
2121
#define HANDLE_SCREEN_BUFFER HANDLE_SCREEN
2222
#define USER_MESSAGE_EXIT 1000
2323

0 commit comments

Comments
 (0)