From 02b7b279af2009ecf864b934b3fd8a62e8730244 Mon Sep 17 00:00:00 2001 From: Beu Date: Fri, 8 Sep 2023 13:06:15 +0200 Subject: [PATCH] fix download button position --- core/Maps/DirectoryBrowser.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/Maps/DirectoryBrowser.php b/core/Maps/DirectoryBrowser.php index 08acc3aa..a1a0ecb3 100644 --- a/core/Maps/DirectoryBrowser.php +++ b/core/Maps/DirectoryBrowser.php @@ -140,7 +140,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener { $index = 0; $posY = $height / 2 - 10; $pageFrame = null; - $pageMaxCount = floor(($height * 0.85) / 4); + $pageMaxCount = floor(($height * 0.78) / 4); $navigateRootQuad = new Quad_Icons64x64_1(); $frame->addChild($navigateRootQuad); @@ -231,21 +231,26 @@ class DirectoryBrowser implements ManialinkPageAnswerListener { } } + $downloadPosX = -$width / 2 + 5; + $label = new Label_Text(); $frame->addChild($label); - $label->setPosition(-$width / 2 + 5, -$height / 2 + 8.5); + $label->setPosition($downloadPosX, $height * -0.39); $label->setHorizontalAlign($label::LEFT); $label->setTextSize(1); $label->setText('Download from URL: '); + + $downloadPosX += 30; $entry = new Entry(); $frame->addChild($entry); $entry->setStyle(Label_Text::STYLE_TextValueSmall); $entry->setHorizontalAlign($entry::LEFT); - $entry->setPosition(-$width / 2 + 35, -$height / 2 + 8.5); + $entry->setPosition($downloadPosX, $height * -0.39); $entry->setTextSize(1); $entry->setSize($width * 0.35, 4); - $entry->setName('SearchString'); + + $downloadPosX += $width * 0.35 + 10; //Search for Map-Name $mapNameButton = $this->maniaControl->getManialinkManager()->getElementBuilder()->buildRoundTextButton( @@ -255,7 +260,7 @@ class DirectoryBrowser implements ManialinkPageAnswerListener { self::ACTION_DOWNLOAD_FILE ); $frame->addChild($mapNameButton); - $mapNameButton->setPosition(-$width / 2 + 100, -$height / 2 + 8.5); + $mapNameButton->setPosition($downloadPosX, $height * -0.39); } else { $errorLabel = new Label();