Add a workaround to a scroll area bug
This commit is contained in:
parent
91ff487edd
commit
7437ecdae6
5 changed files with 26 additions and 0 deletions
|
|
@ -140,6 +140,7 @@ set(sources "src/main.cpp"
|
||||||
"src/GUIStuff/ElementHelpers/TextLabelHelpers.cpp"
|
"src/GUIStuff/ElementHelpers/TextLabelHelpers.cpp"
|
||||||
"src/GUIStuff/ElementHelpers/RadioButtonHelpers.cpp"
|
"src/GUIStuff/ElementHelpers/RadioButtonHelpers.cpp"
|
||||||
"src/GUIStuff/ElementHelpers/CheckBoxHelpers.cpp"
|
"src/GUIStuff/ElementHelpers/CheckBoxHelpers.cpp"
|
||||||
|
"src/GUIStuff/ElementHelpers/ScrollAreaHelpers.cpp"
|
||||||
"include/Helpers/Networking/NetLibrary.cpp"
|
"include/Helpers/Networking/NetLibrary.cpp"
|
||||||
"include/Helpers/Networking/NetServer.cpp"
|
"include/Helpers/Networking/NetServer.cpp"
|
||||||
"include/Helpers/Networking/NetClient.cpp"
|
"include/Helpers/Networking/NetClient.cpp"
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include "../../GUIStuff/ElementHelpers/LayoutHelpers.hpp"
|
#include "../../GUIStuff/ElementHelpers/LayoutHelpers.hpp"
|
||||||
#include "../../GUIStuff/ElementHelpers/TextBoxHelpers.hpp"
|
#include "../../GUIStuff/ElementHelpers/TextBoxHelpers.hpp"
|
||||||
#include "../../GUIStuff/ElementHelpers/NumberSliderHelpers.hpp"
|
#include "../../GUIStuff/ElementHelpers/NumberSliderHelpers.hpp"
|
||||||
|
#include "../../GUIStuff/ElementHelpers/ScrollAreaHelpers.hpp"
|
||||||
#include "../../GUIStuff/Elements/SVGIcon.hpp"
|
#include "../../GUIStuff/Elements/SVGIcon.hpp"
|
||||||
#include "../../GUIStuff/Elements/DropDown.hpp"
|
#include "../../GUIStuff/Elements/DropDown.hpp"
|
||||||
|
|
||||||
|
|
@ -60,6 +61,7 @@ void DrawingProgramLayerManagerGUI::setup_list_gui() {
|
||||||
nameToEdit.clear();
|
nameToEdit.clear();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
SCROLL_AREA_BUG_WORKAROUND();
|
||||||
gui.element<TreeListing>("list", TreeListing::Data {
|
gui.element<TreeListing>("list", TreeListing::Data {
|
||||||
.selectedIndices = &selectedLayerIndices,
|
.selectedIndices = &selectedLayerIndices,
|
||||||
.dirInfo = [&](const TreeListingObjIndexList& objIndex) -> std::optional<TreeListing::DirectoryInfo> {
|
.dirInfo = [&](const TreeListingObjIndexList& objIndex) -> std::optional<TreeListing::DirectoryInfo> {
|
||||||
|
|
|
||||||
10
src/GUIStuff/ElementHelpers/ScrollAreaHelpers.cpp
Normal file
10
src/GUIStuff/ElementHelpers/ScrollAreaHelpers.cpp
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#include "ScrollAreaHelpers.hpp"
|
||||||
|
#include <clay.h>
|
||||||
|
|
||||||
|
namespace GUIStuff { namespace ElementHelpers {
|
||||||
|
|
||||||
|
void SCROLL_AREA_BUG_WORKAROUND() {
|
||||||
|
CLAY_AUTO_ID({}){}
|
||||||
|
}
|
||||||
|
|
||||||
|
}}
|
||||||
10
src/GUIStuff/ElementHelpers/ScrollAreaHelpers.hpp
Normal file
10
src/GUIStuff/ElementHelpers/ScrollAreaHelpers.hpp
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace GUIStuff { namespace ElementHelpers {
|
||||||
|
|
||||||
|
// FIXME: Currently, when two scroll areas in popups are created in the "same place" (different ids), only the first scroll area that's displayed will
|
||||||
|
// have scrolling capabilities, while the second scroll area wont get any scroll data (Clay_GetScrollContainerData gives 0s for content and container dimensions)
|
||||||
|
// We can workaround this by adding invisible padding to the second scroll area (which is what this function does), but ideally this should be fixed later
|
||||||
|
void SCROLL_AREA_BUG_WORKAROUND();
|
||||||
|
|
||||||
|
}}
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
#include "../GUIStuff/ElementHelpers/ButtonHelpers.hpp"
|
#include "../GUIStuff/ElementHelpers/ButtonHelpers.hpp"
|
||||||
#include "../GUIStuff/ElementHelpers/LayoutHelpers.hpp"
|
#include "../GUIStuff/ElementHelpers/LayoutHelpers.hpp"
|
||||||
#include "../GUIStuff/ElementHelpers/TextLabelHelpers.hpp"
|
#include "../GUIStuff/ElementHelpers/TextLabelHelpers.hpp"
|
||||||
|
#include "../GUIStuff/ElementHelpers/ScrollAreaHelpers.hpp"
|
||||||
#include "FileSelectScreen.hpp"
|
#include "FileSelectScreen.hpp"
|
||||||
#include <Helpers/Logger.hpp>
|
#include <Helpers/Logger.hpp>
|
||||||
|
|
||||||
|
|
@ -117,9 +118,11 @@ void PhoneDrawingProgramScreen::bottom_toolbar() {
|
||||||
tool_settings_popup();
|
tool_settings_popup();
|
||||||
break;
|
break;
|
||||||
case SettingsMenuPopup::FG_COLOR:
|
case SettingsMenuPopup::FG_COLOR:
|
||||||
|
SCROLL_AREA_BUG_WORKAROUND();
|
||||||
color_settings_popup(&main.toolConfig.globalConf.foregroundColor);
|
color_settings_popup(&main.toolConfig.globalConf.foregroundColor);
|
||||||
break;
|
break;
|
||||||
case SettingsMenuPopup::BG_COLOR:
|
case SettingsMenuPopup::BG_COLOR:
|
||||||
|
SCROLL_AREA_BUG_WORKAROUND();
|
||||||
color_settings_popup(&main.toolConfig.globalConf.backgroundColor);
|
color_settings_popup(&main.toolConfig.globalConf.backgroundColor);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue