MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OnMouseOver

Method OnMouseOver

src/fios_gui.cpp:792–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

790 }
791
792 void OnMouseOver([[maybe_unused]] Point pt, WidgetID widget) override
793 {
794 if (widget == WID_SL_DRIVES_DIRECTORIES_LIST) {
795 auto it = this->vscroll->GetScrolledItemFromWidget(this->display_list, pt.y, this, WID_SL_DRIVES_DIRECTORIES_LIST, WidgetDimensions::scaled.inset.top);
796 if (it == this->display_list.end()) return;
797
798 /* Get the corresponding non-filtered out item from the list */
799 const FiosItem *file = *it;
800
801 if (file != this->highlighted) {
802 this->highlighted = file;
803 this->SetWidgetDirty(WID_SL_DRIVES_DIRECTORIES_LIST);
804 }
805 } else if (this->highlighted != nullptr) {
806 this->highlighted = nullptr;
807 this->SetWidgetDirty(WID_SL_DRIVES_DIRECTORIES_LIST);
808 }
809 }
810
811 EventState OnKeyPress([[maybe_unused]] char32_t key, uint16_t keycode) override
812 {

Callers

nothing calls this directly

Calls 3

SetWidgetDirtyMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected