summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-29 08:41:08 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-29 08:43:04 +0300
commit34d7ac2c5df7f2792d29fbbd9b58fed3783fdc6e (patch)
tree8d1f1fb22ec68a12541276c59c793520acad1eb3 /src
parentd1548176e227df3840c644a8a9d384b14fc842f8 (diff)
DocumentWidget: Tuning alt text hovering
Diffstat (limited to 'src')
-rw-r--r--src/ui/documentwidget.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 891d8588..d338cf04 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -562,7 +562,8 @@ static void updateHover_DocumentWidget_(iDocumentWidget *d, iInt2 mouse) {
562 animate_DocumentWidget_(d); 562 animate_DocumentWidget_(d);
563 refresh_Widget(w); 563 refresh_Widget(w);
564 } 564 }
565 else if (d->hoverPre && targetValue_Anim(&d->altTextOpacity) < 0.5f) { 565 else if (d->hoverPre && targetValue_Anim(&d->altTextOpacity) < 0.5f &&
566 ~d->flags & noHoverWhileScrolling_DocumentWidgetFlag) {
566 setValue_Anim(&d->altTextOpacity, 1.0f, 0); 567 setValue_Anim(&d->altTextOpacity, 1.0f, 0);
567 refresh_Widget(w); 568 refresh_Widget(w);
568 } 569 }
@@ -3477,7 +3478,7 @@ static void draw_DocumentWidget_(const iDocumentWidget *d) {
3477 const iGmPreMeta *meta = preMeta_GmDocument(d->doc, d->hoverAltPre->preId); 3478 const iGmPreMeta *meta = preMeta_GmDocument(d->doc, d->hoverAltPre->preId);
3478 if (meta->flags & topLeft_GmPreMetaFlag && ~meta->flags & decoration_GmRunFlag && 3479 if (meta->flags & topLeft_GmPreMetaFlag && ~meta->flags & decoration_GmRunFlag &&
3479 !isEmpty_Range(&meta->altText)) { 3480 !isEmpty_Range(&meta->altText)) {
3480 const int margin = 2 * gap_UI; 3481 const int margin = 3 * gap_UI / 2;
3481 const int altFont = uiLabel_FontId; 3482 const int altFont = uiLabel_FontId;
3482 const int wrap = docBounds.size.x - 2 * margin; 3483 const int wrap = docBounds.size.x - 2 * margin;
3483 iInt2 pos = addY_I2(add_I2(docBounds.pos, meta->pixelRect.pos), 3484 iInt2 pos = addY_I2(add_I2(docBounds.pos, meta->pixelRect.pos),