GUI: always scroll scrolltexts on mobile
This commit is contained in:
parent
b701f06a98
commit
39a5408e4e
1
extern/imgui_patched/imgui.cpp
vendored
1
extern/imgui_patched/imgui.cpp
vendored
|
@ -1308,6 +1308,7 @@ ImGuiIO::ImGuiIO()
|
||||||
// ScrollText options
|
// ScrollText options
|
||||||
ScrollTextSpeed = 100.0f;
|
ScrollTextSpeed = 100.0f;
|
||||||
ScrollTextSpacing = 8.0f;
|
ScrollTextSpacing = 8.0f;
|
||||||
|
AlwaysScrollText = false;
|
||||||
|
|
||||||
// Miscellaneous options
|
// Miscellaneous options
|
||||||
MouseDrawCursor = false;
|
MouseDrawCursor = false;
|
||||||
|
|
1
extern/imgui_patched/imgui.h
vendored
1
extern/imgui_patched/imgui.h
vendored
|
@ -2099,6 +2099,7 @@ struct ImGuiIO
|
||||||
// ScrollText options
|
// ScrollText options
|
||||||
float ScrollTextSpeed; // = 100.0f;
|
float ScrollTextSpeed; // = 100.0f;
|
||||||
float ScrollTextSpacing; // = 8.0f;
|
float ScrollTextSpacing; // = 8.0f;
|
||||||
|
bool AlwaysScrollText; // = false // Always scroll scroll texts
|
||||||
|
|
||||||
// Miscellaneous options
|
// Miscellaneous options
|
||||||
bool MouseDrawCursor; // = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by backend implementations.
|
bool MouseDrawCursor; // = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by backend implementations.
|
||||||
|
|
6
extern/imgui_patched/imgui_widgets.cpp
vendored
6
extern/imgui_patched/imgui_widgets.cpp
vendored
|
@ -563,12 +563,12 @@ void ImGui::ScrollText(ImGuiID id, const char* text, const ImVec2& pos, ImVec2 s
|
||||||
float textPos=storage->GetFloat(id,0.0f);
|
float textPos=storage->GetFloat(id,0.0f);
|
||||||
|
|
||||||
dl->PushClipRect(minArea,maxArea,true);
|
dl->PushClipRect(minArea,maxArea,true);
|
||||||
if (hovered || alwaysScroll) {
|
if (hovered || alwaysScroll || g.IO.AlwaysScrollText) {
|
||||||
minArea.x-=textPos;
|
minArea.x-=textPos;
|
||||||
}
|
}
|
||||||
dl->AddText(minArea,ImGui::GetColorU32(ImGuiCol_Text),text);
|
dl->AddText(minArea,ImGui::GetColorU32(ImGuiCol_Text),text);
|
||||||
if ((hovered || alwaysScroll) && !mustNotScroll) {
|
if ((hovered || alwaysScroll || g.IO.AlwaysScrollText) && !mustNotScroll) {
|
||||||
textPos+=ImGui::GetIO().DeltaTime*g.IO.ScrollTextSpeed;
|
textPos+=g.IO.DeltaTime*g.IO.ScrollTextSpeed;
|
||||||
if (textPos>textSize.x) {
|
if (textPos>textSize.x) {
|
||||||
textPos-=textSize.x+size.x+g.IO.ScrollTextSpacing;
|
textPos-=textSize.x+size.x+g.IO.ScrollTextSpacing;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3270,6 +3270,7 @@ void FurnaceGUI::toggleMobileUI(bool enable, bool force) {
|
||||||
ImGui::GetIO().IniFilename=NULL;
|
ImGui::GetIO().IniFilename=NULL;
|
||||||
ImGui::GetIO().ConfigFlags|=ImGuiConfigFlags_InertialScrollEnable;
|
ImGui::GetIO().ConfigFlags|=ImGuiConfigFlags_InertialScrollEnable;
|
||||||
ImGui::GetIO().ConfigFlags|=ImGuiConfigFlags_NoHoverColors;
|
ImGui::GetIO().ConfigFlags|=ImGuiConfigFlags_NoHoverColors;
|
||||||
|
ImGui::GetIO().AlwaysScrollText=true;
|
||||||
fileDialog->mobileUI=true;
|
fileDialog->mobileUI=true;
|
||||||
} else {
|
} else {
|
||||||
ImGui::GetIO().IniFilename=NULL;
|
ImGui::GetIO().IniFilename=NULL;
|
||||||
|
@ -3279,6 +3280,7 @@ void FurnaceGUI::toggleMobileUI(bool enable, bool force) {
|
||||||
}
|
}
|
||||||
ImGui::GetIO().ConfigFlags&=~ImGuiConfigFlags_InertialScrollEnable;
|
ImGui::GetIO().ConfigFlags&=~ImGuiConfigFlags_InertialScrollEnable;
|
||||||
ImGui::GetIO().ConfigFlags&=~ImGuiConfigFlags_NoHoverColors;
|
ImGui::GetIO().ConfigFlags&=~ImGuiConfigFlags_NoHoverColors;
|
||||||
|
ImGui::GetIO().AlwaysScrollText=false;
|
||||||
fileDialog->mobileUI=false;
|
fileDialog->mobileUI=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue