GUI: selection/scroll improvements
now you can scroll left/right by dragging selection to the side edges
This commit is contained in:
parent
f59cb23d9b
commit
dd9983778b
|
@ -169,6 +169,7 @@ void FurnaceGUI::finishSelection() {
|
|||
}
|
||||
selecting=false;
|
||||
selectingFull=false;
|
||||
mobilePatSel=false;
|
||||
|
||||
if (dragging) {
|
||||
if (dragSourceX==dragDestinationX && dragSourceY==dragDestinationY && dragSourceXFine==dragDestinationXFine) {
|
||||
|
|
|
@ -569,6 +569,12 @@ void FurnaceGUI::addScroll(int amount) {
|
|||
haveHitBounds=false;
|
||||
}
|
||||
|
||||
void FurnaceGUI::addScrollX(int amount) {
|
||||
float lineHeight=(patFont->FontSize+2*dpiScale);
|
||||
nextAddScrollX=lineHeight*amount;
|
||||
haveHitBounds=false;
|
||||
}
|
||||
|
||||
void FurnaceGUI::setFileName(String name) {
|
||||
#ifdef _WIN32
|
||||
wchar_t ret[4096];
|
||||
|
@ -3571,7 +3577,7 @@ void FurnaceGUI::pointUp(int x, int y, int button) {
|
|||
}
|
||||
|
||||
void FurnaceGUI::pointMotion(int x, int y, int xrel, int yrel) {
|
||||
if (selecting) {
|
||||
if (selecting && (!mobileUI || mobilePatSel)) {
|
||||
// detect whether we have to scroll
|
||||
if (y<patWindowPos.y+2.0f*dpiScale) {
|
||||
addScroll(-1);
|
||||
|
@ -3579,6 +3585,12 @@ void FurnaceGUI::pointMotion(int x, int y, int xrel, int yrel) {
|
|||
if (y>patWindowPos.y+patWindowSize.y-2.0f*dpiScale) {
|
||||
addScroll(1);
|
||||
}
|
||||
if (x<patWindowPos.x+(mobileUI?40.0f:4.0f)*dpiScale) {
|
||||
addScrollX(-1);
|
||||
}
|
||||
if (x>patWindowPos.x+patWindowSize.x-(mobileUI?40.0f:4.0f)*dpiScale) {
|
||||
addScrollX(1);
|
||||
}
|
||||
}
|
||||
if (macroDragActive || macroLoopDragActive || waveDragActive || sampleDragActive || orderScrollLocked) {
|
||||
int distance=fabs((double)xrel);
|
||||
|
@ -8546,6 +8558,7 @@ FurnaceGUI::FurnaceGUI():
|
|||
dragMobileMenu(false),
|
||||
dragMobileEditButton(false),
|
||||
wantGrooveListFocus(false),
|
||||
mobilePatSel(false),
|
||||
lastAssetType(0),
|
||||
curWindow(GUI_WINDOW_NOTHING),
|
||||
nextWindow(GUI_WINDOW_NOTHING),
|
||||
|
|
|
@ -2366,6 +2366,7 @@ class FurnaceGUI {
|
|||
bool selecting, selectingFull, dragging, curNibble, orderNibble, followOrders, followPattern, changeAllOrders, mobileUI;
|
||||
bool collapseWindow, demandScrollX, fancyPattern, firstFrame, tempoView, waveHex, waveSigned, waveGenVisible, lockLayout, editOptsVisible, latchNibble, nonLatchNibble;
|
||||
bool keepLoopAlive, keepGrooveAlive, orderScrollLocked, orderScrollTolerance, dragMobileMenu, dragMobileEditButton, wantGrooveListFocus;
|
||||
bool mobilePatSel;
|
||||
unsigned char lastAssetType;
|
||||
FurnaceGUIWindows curWindow, nextWindow, curWindowLast;
|
||||
std::atomic<FurnaceGUIWindows> curWindowThreadSafe;
|
||||
|
@ -2517,7 +2518,7 @@ class FurnaceGUI {
|
|||
int bindSetTarget, bindSetTargetIdx, bindSetPrevValue;
|
||||
bool bindSetActive, bindSetPending;
|
||||
|
||||
float nextScroll, nextAddScroll, orderScroll, orderScrollSlideOrigin;
|
||||
float nextScroll, nextAddScroll, nextAddScrollX, orderScroll, orderScrollSlideOrigin;
|
||||
|
||||
ImVec2 orderScrollRealOrigin;
|
||||
ImVec2 dragMobileMenuOrigin;
|
||||
|
@ -3084,6 +3085,7 @@ class FurnaceGUI {
|
|||
void enableSafeMode();
|
||||
void updateScroll(int amount);
|
||||
void addScroll(int amount);
|
||||
void addScrollX(int amount);
|
||||
void setFileName(String name);
|
||||
void runBackupThread();
|
||||
void pushPartBlend();
|
||||
|
|
|
@ -154,6 +154,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
|||
if (ImGui::IsItemActive() && CHECK_LONG_HOLD) {
|
||||
ImGui::InhibitInertialScroll();
|
||||
NOTIFY_LONG_HOLD;
|
||||
mobilePatSel=true;
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
// for each column
|
||||
|
@ -210,6 +211,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
|||
if (ImGui::IsItemActive() && CHECK_LONG_HOLD) {
|
||||
ImGui::InhibitInertialScroll();
|
||||
NOTIFY_LONG_HOLD;
|
||||
mobilePatSel=true;
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
|
@ -253,6 +255,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
|||
if (ImGui::IsItemActive() && CHECK_LONG_HOLD) {
|
||||
ImGui::InhibitInertialScroll();
|
||||
NOTIFY_LONG_HOLD;
|
||||
mobilePatSel=true;
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
@ -290,6 +293,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
|||
if (ImGui::IsItemActive() && CHECK_LONG_HOLD) {
|
||||
ImGui::InhibitInertialScroll();
|
||||
NOTIFY_LONG_HOLD;
|
||||
mobilePatSel=true;
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
@ -342,6 +346,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
|||
if (ImGui::IsItemActive() && CHECK_LONG_HOLD) {
|
||||
ImGui::InhibitInertialScroll();
|
||||
NOTIFY_LONG_HOLD;
|
||||
mobilePatSel=true;
|
||||
}
|
||||
|
||||
// effect value
|
||||
|
@ -371,6 +376,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
|||
if (ImGui::IsItemActive() && CHECK_LONG_HOLD) {
|
||||
ImGui::InhibitInertialScroll();
|
||||
NOTIFY_LONG_HOLD;
|
||||
mobilePatSel=true;
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
@ -465,6 +471,7 @@ void FurnaceGUI::drawPattern() {
|
|||
ImGui::SetNextWindowScroll(ImVec2(-1.0f,nextScroll));
|
||||
nextScroll=-1.0f;
|
||||
nextAddScroll=0.0f;
|
||||
nextAddScrollX=0.0f;
|
||||
}
|
||||
ImDrawList* tdl=NULL;
|
||||
|
||||
|
@ -480,6 +487,10 @@ void FurnaceGUI::drawPattern() {
|
|||
nextScroll=-1.0f;
|
||||
nextAddScroll=0.0f;
|
||||
}
|
||||
if (nextAddScrollX!=0.0f) {
|
||||
ImGui::SetScrollX(ImGui::GetScrollX()+nextAddScrollX);
|
||||
nextAddScrollX=0.0f;
|
||||
}
|
||||
|
||||
ImGui::TableSetupScrollFreeze(1,1);
|
||||
for (int i=0; i<chans; i++) {
|
||||
|
|
Loading…
Reference in a new issue