summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-03-07 20:10:53 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-03-07 20:11:58 +0100
commit25c6acb702f2e80a67b8844c0261e4e93d1705f4 (patch)
treee13b42ca1bc02a2aa42cf811b38a4c7899318277 /editor
parent9b853d7a7b12f11e98e8c12b2e4ba96f4111add8 (diff)
Make the pagination buttons wider in the asset library browser
This makes the page number buttons easier to click.
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index 4d9c5625a3..064314f439 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -969,14 +969,16 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int
for (int i = from; i < to; i++) {
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);
hbc->add_child(current);
} 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", callable_mp(this, &EditorAssetLibrary::_search), varray(i));
hbc->add_child(current);