From 266282813aad65898293a14a5c8ec36bac9d0c47 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 7 Mar 2021 20:10:53 +0100 Subject: [PATCH] Make the pagination buttons wider in the asset library browser This makes the page number buttons easier to click. (cherry picked from commit 25c6acb702f2e80a67b8844c0261e4e93d1705f4) --- editor/plugins/asset_library_editor_plugin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 0a6177a29af..1da3d0fbdfd 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1010,7 +1010,8 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int if (i == p_page) { Button *current = memnew(Button); - current->set_text(itos(i + 1)); + // Keep the extended padding for the currently active page (see below). + current->set_text(vformat(" %d ", i + 1)); current->set_disabled(true); current->set_focus_mode(Control::FOCUS_NONE); @@ -1018,7 +1019,8 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int } else { Button *current = memnew(Button); - current->set_text(itos(i + 1)); + // Add padding to make page number buttons easier to click. + current->set_text(vformat(" %d ", i + 1)); current->connect("pressed", this, "_search", varray(i)); hbc->add_child(current);