GUI: ins edit disable scroll if no scroll range
This commit is contained in:
parent
1dec8bff40
commit
9bf38e02ca
|
@ -1791,11 +1791,13 @@ void FurnaceGUI::drawMacros(std::vector<FurnaceGUIMacroDesc>& macros, FurnaceGUI
|
||||||
if (macroDragScroll>scrollMax) {
|
if (macroDragScroll>scrollMax) {
|
||||||
macroDragScroll=scrollMax;
|
macroDragScroll=scrollMax;
|
||||||
}
|
}
|
||||||
|
ImGui::BeginDisabled(scrollMax<1);
|
||||||
ImGui::SetNextItemWidth(availableWidth);
|
ImGui::SetNextItemWidth(availableWidth);
|
||||||
if (CWSliderInt("##MacroScroll",¯oDragScroll,0,scrollMax,"")) {
|
if (CWSliderInt("##MacroScroll",¯oDragScroll,0,scrollMax,"")) {
|
||||||
if (macroDragScroll<0) macroDragScroll=0;
|
if (macroDragScroll<0) macroDragScroll=0;
|
||||||
if (macroDragScroll>scrollMax) macroDragScroll=scrollMax;
|
if (macroDragScroll>scrollMax) macroDragScroll=scrollMax;
|
||||||
}
|
}
|
||||||
|
ImGui::EndDisabled();
|
||||||
|
|
||||||
// draw macros
|
// draw macros
|
||||||
for (FurnaceGUIMacroDesc& i: macros) {
|
for (FurnaceGUIMacroDesc& i: macros) {
|
||||||
|
@ -1844,11 +1846,13 @@ void FurnaceGUI::drawMacros(std::vector<FurnaceGUIMacroDesc>& macros, FurnaceGUI
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::BeginDisabled(scrollMax<1);
|
||||||
ImGui::SetNextItemWidth(availableWidth);
|
ImGui::SetNextItemWidth(availableWidth);
|
||||||
if (CWSliderInt("##MacroScroll",¯oDragScroll,0,scrollMax,"")) {
|
if (CWSliderInt("##MacroScroll",¯oDragScroll,0,scrollMax,"")) {
|
||||||
if (macroDragScroll<0) macroDragScroll=0;
|
if (macroDragScroll<0) macroDragScroll=0;
|
||||||
if (macroDragScroll>scrollMax) macroDragScroll=scrollMax;
|
if (macroDragScroll>scrollMax) macroDragScroll=scrollMax;
|
||||||
}
|
}
|
||||||
|
ImGui::EndDisabled();
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue