Skip to content

Commit

Permalink
change pointer type on hover and unhover
Browse files Browse the repository at this point in the history
  • Loading branch information
vgmoose committed Sep 2, 2024
1 parent 2fdf675 commit e4d4e26
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,12 @@ bool Element::onTouchDrag(InputEvents* event)
if (this->dragging && (abs(event->yPos - this->lastMouseY) >= TRESHOLD || abs(event->xPos - this->lastMouseX) >= TRESHOLD))
{
ret |= (this->elasticCounter > 0);
auto prevElasticCounter = this->elasticCounter;
this->elasticCounter = NO_HIGHLIGHT;
if (prevElasticCounter != NO_HIGHLIGHT) {
// change the cursor back to the arrow
CST_SetCursor(CST_CURSOR_ARROW);
}
}

return ret;
Expand Down
2 changes: 1 addition & 1 deletion src/InputEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ bool InputEvents::processSDLEvents()

if (this->type == SDL_QUIT)
{
this->quitaction();
if (this->quitaction != NULL) this->quitaction();
return false; //Quitting overrides all other events.
}
else if (event.key.repeat == 0 && (this->type == SDL_KEYDOWN || this->type == SDL_KEYUP))
Expand Down
10 changes: 5 additions & 5 deletions src/RootDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ RootDisplay::RootDisplay()
RootDisplay::dpiScale = CST_GetDpiScale();

// set platform-specific default background colors, (which can be overridden)
#if defined(__WIIU__)
#if defined(__WIIU__) || defined(WIIU_MOCK)
this->backgroundColor = fromRGB(0x20 - 0x10, 154 - 0x10, 199 - 0x10);
#elif defined(WII)
#elif defined(WII) || defined(WII_MOCK)
// the system wii gray
this->backgroundColor = fromRGB(0x8b, 0x8b, 0x8b);
#elif defined(_3DS) || defined(_3DS_MOCK)
this->backgroundColor = fromRGB(30, 30, 30);
#elif defined(SWITCH)
#elif defined(SWITCH) || defined(SWITCH_MOCK)
this->backgroundColor = fromRGB(0xd6, 0x0 + 0x20, 0x12 + 0x20);
#else
this->backgroundColor = fromRGB(0x2d, 0x26, 0x49);
#endif

// set starting resolution based on SDL version
#if defined(WII)
#if defined(WII) || defined(WII_MOCK)
setScreenResolution(640, 480);
#elif defined(_3DS) || defined(_3DS_MOCK)
setScreenResolution(400, 480); // 3ds has a special resolution!
Expand Down Expand Up @@ -240,7 +240,7 @@ int RootDisplay::mainLoop()

// if we see a minus, exit immediately!
if (events->pressed(SELECT_BUTTON) && this->canUseSelectToExit) {
if (events->quitaction) events->quitaction();
if (events->quitaction != NULL) events->quitaction();
else isRunning = false;
}
}
Expand Down

0 comments on commit e4d4e26

Please sign in to comment.