diff options
-rw-r--r-- | src/ui/inputwidget.c | 20 | ||||
-rw-r--r-- | src/ui/util.c | 5 |
2 files changed, 15 insertions, 10 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index f1b21922..6e9ef6c2 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c | |||
@@ -1553,12 +1553,15 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) { | |||
1553 | lastLine_InputWidget_(d)->wrapLines.end - d->visWrapLines.end); | 1553 | lastLine_InputWidget_(d)->wrapLines.end - d->visWrapLines.end); |
1554 | if (!lineDelta) d->wheelAccum = 0; | 1554 | if (!lineDelta) d->wheelAccum = 0; |
1555 | } | 1555 | } |
1556 | d->wheelAccum -= lineDelta * lineHeight; | 1556 | if (lineDelta) { |
1557 | d->visWrapLines.start += lineDelta; | 1557 | d->wheelAccum -= lineDelta * lineHeight; |
1558 | d->visWrapLines.end += lineDelta; | 1558 | d->visWrapLines.start += lineDelta; |
1559 | d->inFlags |= needUpdateBuffer_InputWidgetFlag; | 1559 | d->visWrapLines.end += lineDelta; |
1560 | refresh_Widget(d); | 1560 | d->inFlags |= needUpdateBuffer_InputWidgetFlag; |
1561 | return iTrue; | 1561 | refresh_Widget(d); |
1562 | return iTrue; | ||
1563 | } | ||
1564 | return iFalse; | ||
1562 | } | 1565 | } |
1563 | switch (processEvent_Click(&d->click, ev)) { | 1566 | switch (processEvent_Click(&d->click, ev)) { |
1564 | case none_ClickResult: | 1567 | case none_ClickResult: |
@@ -1926,8 +1929,9 @@ static void draw_InputWidget_(const iInputWidget *d) { | |||
1926 | const iWidget *w = constAs_Widget(d); | 1929 | const iWidget *w = constAs_Widget(d); |
1927 | iRect bounds = adjusted_Rect(bounds_InputWidget_(d), padding_(), neg_I2(padding_())); | 1930 | iRect bounds = adjusted_Rect(bounds_InputWidget_(d), padding_(), neg_I2(padding_())); |
1928 | iBool isHint = isHintVisible_InputWidget_(d); | 1931 | iBool isHint = isHintVisible_InputWidget_(d); |
1929 | const iBool isFocused = isFocused_Widget(w); | 1932 | const iBool isFocused = isFocused_Widget(w); |
1930 | const iBool isHover = isHover_Widget(w) && | 1933 | const iBool isHover = deviceType_App() == desktop_AppDeviceType && |
1934 | isHover_Widget(w) && | ||
1931 | contains_InputWidget_(d, mouseCoord_Window(get_Window(), 0)); | 1935 | contains_InputWidget_(d, mouseCoord_Window(get_Window(), 0)); |
1932 | if (d->inFlags & needUpdateBuffer_InputWidgetFlag) { | 1936 | if (d->inFlags & needUpdateBuffer_InputWidgetFlag) { |
1933 | updateBuffered_InputWidget_(iConstCast(iInputWidget *, d)); | 1937 | updateBuffered_InputWidget_(iConstCast(iInputWidget *, d)); |
diff --git a/src/ui/util.c b/src/ui/util.c index 6df4e980..b875e260 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -725,10 +725,11 @@ iWidget *makeMenu_Widget(iWidget *parent, const iMenuItem *items, size_t n) { | |||
725 | iClob(newKeyMods_LabelWidget(labelText, item->key, item->kmods, item->command)), | 725 | iClob(newKeyMods_LabelWidget(labelText, item->key, item->kmods, item->command)), |
726 | noBackground_WidgetFlag | frameless_WidgetFlag | alignLeft_WidgetFlag | | 726 | noBackground_WidgetFlag | frameless_WidgetFlag | alignLeft_WidgetFlag | |
727 | drawKey_WidgetFlag | itemFlags); | 727 | drawKey_WidgetFlag | itemFlags); |
728 | setWrap_LabelWidget(label, isInfo); | 728 | setWrap_LabelWidget(label, isInfo); |
729 | haveIcons |= checkIcon_LabelWidget(label); | 729 | haveIcons |= checkIcon_LabelWidget(label); |
730 | updateSize_LabelWidget(label); /* drawKey was set */ | 730 | updateSize_LabelWidget(label); /* drawKey was set */ |
731 | if (isInfo) { | 731 | if (isInfo) { |
732 | setFlags_Widget(as_Widget(label), fixedHeight_WidgetFlag, iTrue); /* wrap changes height */ | ||
732 | setTextColor_LabelWidget(label, uiTextAction_ColorId); | 733 | setTextColor_LabelWidget(label, uiTextAction_ColorId); |
733 | } | 734 | } |
734 | } | 735 | } |
@@ -745,7 +746,7 @@ iWidget *makeMenu_Widget(iWidget *parent, const iMenuItem *items, size_t n) { | |||
745 | iForEach(ObjectList, i, children_Widget(menu)) { | 746 | iForEach(ObjectList, i, children_Widget(menu)) { |
746 | if (isInstance_Object(i.object, &Class_LabelWidget)) { | 747 | if (isInstance_Object(i.object, &Class_LabelWidget)) { |
747 | iLabelWidget *label = i.object; | 748 | iLabelWidget *label = i.object; |
748 | if (icon_LabelWidget(label) == 0) { | 749 | if (!isWrapped_LabelWidget(label) && icon_LabelWidget(label) == 0) { |
749 | setIcon_LabelWidget(label, ' '); | 750 | setIcon_LabelWidget(label, ' '); |
750 | } | 751 | } |
751 | } | 752 | } |