Skip to content

Commit

Permalink
Simplify sidebar resizing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom94 committed Dec 26, 2024
1 parent f655a65 commit 32bdc95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/ImageViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,13 +578,11 @@ bool ImageViewer::mouse_motion_event(
redraw();
}

if (mDragType == EMouseDragType::SidebarDrag || canDragSidebarFrom(p)) {
mSidebarLayout->set_cursor(Cursor::HResize);
mImageCanvas->set_cursor(Cursor::HResize);
} else {
mSidebarLayout->set_cursor(Cursor::Arrow);
mImageCanvas->set_cursor(Cursor::Arrow);
}
bool shouldShowResizeCursor = mDragType == EMouseDragType::SidebarDrag || canDragSidebarFrom(p);
Cursor cursorType = shouldShowResizeCursor ? Cursor::HResize : Cursor::Arrow;

mSidebarLayout->set_cursor(cursorType);
mImageCanvas->set_cursor(cursorType);

switch (mDragType) {
case EMouseDragType::SidebarDrag:
Expand Down
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <GLFW/glfw3native.h>
#endif

#include <chrono>
#include <iostream>
#include <thread>

Expand Down

0 comments on commit 32bdc95

Please sign in to comment.