summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/documentwidget.c4
-rw-r--r--src/ui/text.c4
-rw-r--r--src/ui/text_simple.c7
-rw-r--r--src/ui/touch.c4
-rw-r--r--src/ui/window.c10
5 files changed, 19 insertions, 10 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 746e03e0..46af5fcd 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -1224,10 +1224,6 @@ static void showErrorPage_DocumentWidget_(iDocumentWidget *d, enum iGmStatusCode
1224 case tooManyRedirects_GmStatusCode: 1224 case tooManyRedirects_GmStatusCode:
1225 appendFormat_String(src, "=> %s\n", cstr_String(meta)); 1225 appendFormat_String(src, "=> %s\n", cstr_String(meta));
1226 break; 1226 break;
1227 case tlsFailure_GmStatusCode:
1228// useBanner = iFalse; /* valid data wasn't received from host */
1229// appendFormat_String(src, ">%s\n", cstr_String(meta));
1230 break;
1231 case tlsServerCertificateExpired_GmStatusCode: 1227 case tlsServerCertificateExpired_GmStatusCode:
1232 makeFooterButtons_DocumentWidget_( 1228 makeFooterButtons_DocumentWidget_(
1233 d, 1229 d,
diff --git a/src/ui/text.c b/src/ui/text.c
index 977cac9c..4a4b3776 100644
--- a/src/ui/text.c
+++ b/src/ui/text.c
@@ -1871,7 +1871,7 @@ iInt2 tryAdvance_Text(int fontId, iRangecc text, int width, const char **endPos)
1871} 1871}
1872 1872
1873iInt2 tryAdvanceNoWrap_Text(int fontId, iRangecc text, int width, const char **endPos) { 1873iInt2 tryAdvanceNoWrap_Text(int fontId, iRangecc text, int width, const char **endPos) {
1874 if (width <= 1) { 1874 if (width && width <= 1) {
1875 *endPos = text.start; 1875 *endPos = text.start;
1876 return zero_I2(); 1876 return zero_I2();
1877 } 1877 }
@@ -2070,7 +2070,7 @@ iTextMetrics draw_WrapText(iWrapText *d, int fontId, iInt2 pos, int color) {
2070 const int width = d->mode == word_WrapTextMode 2070 const int width = d->mode == word_WrapTextMode
2071 ? tryAdvance_Text(fontId, text, d->maxWidth, &endPos).x 2071 ? tryAdvance_Text(fontId, text, d->maxWidth, &endPos).x
2072 : tryAdvanceNoWrap_Text(fontId, text, d->maxWidth, &endPos).x; 2072 : tryAdvanceNoWrap_Text(fontId, text, d->maxWidth, &endPos).x;
2073 notify_WrapText_(d, endPos, (iTextAttrib){ .colorId = color }, 0, width); 2073 notify_WrapText_(d, endPos, (iTextAttrib){ .fgColorId = color }, 0, width);
2074 drawRange_Text(fontId, pos, color, (iRangecc){ text.start, endPos }); 2074 drawRange_Text(fontId, pos, color, (iRangecc){ text.start, endPos });
2075 text.start = endPos; 2075 text.start = endPos;
2076 pos.y += lineHeight_Text(fontId); 2076 pos.y += lineHeight_Text(fontId);
diff --git a/src/ui/text_simple.c b/src/ui/text_simple.c
index 81fb94a5..8560c138 100644
--- a/src/ui/text_simple.c
+++ b/src/ui/text_simple.c
@@ -61,7 +61,7 @@ static iRect runSimple_Font_(iFont *d, const iRunArgs *args) {
61 and other non-complex LTR scripts. Composed glyphs are not supported (must rely on text 61 and other non-complex LTR scripts. Composed glyphs are not supported (must rely on text
62 being in a pre-composed form). This algorithm is used if HarfBuzz is not available. */ 62 being in a pre-composed form). This algorithm is used if HarfBuzz is not available. */
63 const iInt2 orig = args->pos; 63 const iInt2 orig = args->pos;
64 iTextAttrib attrib = { .colorId = args->color }; 64 iTextAttrib attrib = { .fgColorId = args->color };
65 iRect bounds = { orig, init_I2(0, d->height) }; 65 iRect bounds = { orig, init_I2(0, d->height) };
66 float xpos = orig.x; 66 float xpos = orig.x;
67 float xposMax = xpos; 67 float xposMax = xpos;
@@ -118,8 +118,9 @@ static iRect runSimple_Font_(iFont *d, const iRunArgs *args) {
118 if (match_RegExp(activeText_->ansiEscape, chPos, args->text.end - chPos, &m)) { 118 if (match_RegExp(activeText_->ansiEscape, chPos, args->text.end - chPos, &m)) {
119 if (mode & draw_RunMode && ~mode & permanentColorFlag_RunMode) { 119 if (mode & draw_RunMode && ~mode & permanentColorFlag_RunMode) {
120 /* Change the color. */ 120 /* Change the color. */
121 const iColor clr = 121 iColor clr;
122 ansiForeground_Color(capturedRange_RegExpMatch(&m, 1), tmParagraph_ColorId); 122 ansiColors_Color(capturedRange_RegExpMatch(&m, 1), tmParagraph_ColorId,
123 none_ColorId, &clr, NULL);
123 SDL_SetTextureColorMod(activeText_->cache, clr.r, clr.g, clr.b); 124 SDL_SetTextureColorMod(activeText_->cache, clr.r, clr.g, clr.b);
124 if (args->mode & fillBackground_RunMode) { 125 if (args->mode & fillBackground_RunMode) {
125 SDL_SetRenderDrawColor(activeText_->render, clr.r, clr.g, clr.b, 0); 126 SDL_SetRenderDrawColor(activeText_->render, clr.r, clr.g, clr.b, 0);
diff --git a/src/ui/touch.c b/src/ui/touch.c
index 195d1dff..d6846572 100644
--- a/src/ui/touch.c
+++ b/src/ui/touch.c
@@ -42,7 +42,11 @@ iDeclareType(TouchState)
42 42
43static const uint32_t longPressSpanMs_ = 500; 43static const uint32_t longPressSpanMs_ = 500;
44static const uint32_t shortPressSpanMs_ = 250; 44static const uint32_t shortPressSpanMs_ = 250;
45#if defined (iPlatformAndroidMobile)
46static const int tapRadiusPt_ = 30; /* inaccurate sensors? */
47#else
45static const int tapRadiusPt_ = 10; 48static const int tapRadiusPt_ = 10;
49#endif
46 50
47enum iTouchEdge { 51enum iTouchEdge {
48 none_TouchEdge, 52 none_TouchEdge,
diff --git a/src/ui/window.c b/src/ui/window.c
index 0bbe588c..9f12cabf 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -263,6 +263,10 @@ static float pixelRatio_Window_(const iWindow *d) {
263# define baseDPI_Window 96.0f 263# define baseDPI_Window 96.0f
264#endif 264#endif
265 265
266#if defined (iPlatformAndroidMobile)
267float displayDensity_Android(void);
268#endif
269
266static float displayScale_Window_(const iWindow *d) { 270static float displayScale_Window_(const iWindow *d) {
267 /* The environment variable LAGRANGE_OVERRIDE_DPI can be used to override the automatic 271 /* The environment variable LAGRANGE_OVERRIDE_DPI can be used to override the automatic
268 display DPI detection. If not set, or is an empty string, ignore it. 272 display DPI detection. If not set, or is an empty string, ignore it.
@@ -289,6 +293,8 @@ static float displayScale_Window_(const iWindow *d) {
289#elif defined (iPlatformMsys) 293#elif defined (iPlatformMsys)
290 iUnused(d); 294 iUnused(d);
291 return desktopDPI_Win32(); 295 return desktopDPI_Win32();
296#elif defined (iPlatformAndroidMobile)
297 return displayDensity_Android();
292#else 298#else
293 if (isRunningUnderWindowSystem_App()) { 299 if (isRunningUnderWindowSystem_App()) {
294 float vdpi = 0.0f; 300 float vdpi = 0.0f;
@@ -457,7 +463,7 @@ void init_Window(iWindow *d, enum iWindowType type, iRect rect, uint32_t flags)
457 d->mouseGrab = NULL; 463 d->mouseGrab = NULL;
458 d->focus = NULL; 464 d->focus = NULL;
459 d->pendingCursor = NULL; 465 d->pendingCursor = NULL;
460 d->isExposed = iFalse; 466 d->isExposed = (deviceType_App() != desktop_AppDeviceType);
461 d->isMinimized = iFalse; 467 d->isMinimized = iFalse;
462 d->isInvalidated = iFalse; /* set when posting event, to avoid repeated events */ 468 d->isInvalidated = iFalse; /* set when posting event, to avoid repeated events */
463 d->isMouseInside = iTrue; 469 d->isMouseInside = iTrue;
@@ -541,6 +547,8 @@ void init_MainWindow(iMainWindow *d, iRect rect) {
541 SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal"); 547 SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal");
542 flags |= SDL_WINDOW_METAL; 548 flags |= SDL_WINDOW_METAL;
543 d->base.isExposed = iTrue; 549 d->base.isExposed = iTrue;
550#elif defined (iPlatformAndroidMobile)
551 d->base.isExposed = iTrue;
544#else 552#else
545 if (!forceSoftwareRender_App()) { 553 if (!forceSoftwareRender_App()) {
546 flags |= SDL_WINDOW_OPENGL; 554 flags |= SDL_WINDOW_OPENGL;