Skip to content

Commit 3edce43

Browse files
Kingminer7km7dev
andauthored
Resizable Scrollbar (#88)
* Resizable Scrollbar * remove hardcoded set size to 60 * Fix * hopefully the last thing --------- Co-authored-by: km7dev <km7@km7dev.me>
1 parent e0f356b commit 3edce43

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/DevTools.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ struct matjson::Serialize<Settings> {
2828
assign(value["advanced_settings"], s.advancedSettings);
2929
assign(value["show_memory_viewer"], s.showMemoryViewer);
3030
assign(value["show_mod_graph"], s.showModGraph);
31+
assign(value["scrollbar_size"], s.scrollbarSize);
3132
assign(value["theme"], s.theme);
3233
assign(value["theme_color"], s.themeColor);
3334
assign(value["button_x"], s.buttonPos.x);
@@ -52,6 +53,7 @@ struct matjson::Serialize<Settings> {
5253
{ "advanced_settings", settings.advancedSettings },
5354
{ "show_memory_viewer", settings.showMemoryViewer },
5455
{ "show_mod_graph", settings.showModGraph },
56+
{ "scrollbar_size", settings.scrollbarSize },
5557
{ "theme", settings.theme },
5658
{ "theme_color", settings.themeColor },
5759
{ "button_x", settings.buttonPos.x },
@@ -334,9 +336,9 @@ void DevTools::setup() {
334336

335337
#ifdef GEODE_IS_MOBILE
336338
ImGui::GetIO().FontGlobalScale = 2.f;
337-
ImGui::GetStyle().ScrollbarSize = 60.f;
338339
// ImGui::GetStyle().TabBarBorderSize = 60.f;
339340
#endif
341+
ImGui::GetStyle().ScrollbarSize = m_settings.scrollbarSize;
340342
}
341343

342344
void DevTools::destroy() {

src/DevTools.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ struct Settings {
2929
bool advancedSettings = false;
3030
bool showMemoryViewer = false;
3131
bool showModGraph = false;
32+
float scrollbarSize = GEODE_DESKTOP(14.f) GEODE_MOBILE(60.f);
3233
std::string theme = DARK_THEME;
3334
ccColor4B themeColor = {2, 119, 189, 255};
3435
CCPoint buttonPos = {50, 50};

src/pages/Settings.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ void DevTools::drawSettings() {
9494

9595
ImGui::Separator();
9696

97-
ImGui::DragFloat("Font Size", &ImGui::GetIO().FontGlobalScale, 0.01f, 1.0f, 3.0f);
97+
ImGui::DragFloat("Font Size", &ImGui::GetIO().FontGlobalScale, 1.f, 1.0f, 3.0f);
98+
if (ImGui::DragFloat("Scrollbar Size", &m_settings.scrollbarSize, 1.f, 1.0f, 100.0f)) {
99+
ImGui::GetStyle().ScrollbarSize = m_settings.scrollbarSize;
100+
}
98101

99102
#ifdef GEODE_IS_DESKTOP
100103

0 commit comments

Comments
 (0)