diff --git a/src/components/ComponentGrid.cpp b/src/components/ComponentGrid.cpp index 11a6522d7..12e3e92b1 100644 --- a/src/components/ComponentGrid.cpp +++ b/src/components/ComponentGrid.cpp @@ -63,6 +63,7 @@ float ComponentGrid::getRowHeight(int row) void ComponentGrid::setColWidthPerc(int col, float width) { + assert(width >= 0 && width <= 1); assert(col >= 0 && col < mGridSize.x()); mColWidths[col] = width; onSizeChanged(); @@ -70,6 +71,7 @@ void ComponentGrid::setColWidthPerc(int col, float width) void ComponentGrid::setRowHeightPerc(int row, float height) { + assert(height >= 0 && height <= 1); assert(row >= 0 && row < mGridSize.y()); mRowHeights[row] = height; onSizeChanged(); diff --git a/src/components/ScraperSearchComponent.cpp b/src/components/ScraperSearchComponent.cpp index d7e109383..aa8539cc8 100644 --- a/src/components/ScraperSearchComponent.cpp +++ b/src/components/ScraperSearchComponent.cpp @@ -95,7 +95,6 @@ void ScraperSearchComponent::onSizeChanged() // limit thumbnail size using setMaxHeight - we do this instead of letting mGrid call setSize because it maintains the aspect ratio // we also pad a little so it doesn't rub up against the metadata labels mResultThumbnail->setMaxSize(mGrid.getColWidth(1) - 16, mGrid.getRowHeight(1)); - mResultDesc->setSize(mDescContainer->getSize().x(), 0); // make desc text wrap at edge of container // metadata // (mMD_Grid has already been resized by mGrid) @@ -124,7 +123,12 @@ void ScraperSearchComponent::onSizeChanged() mMD_Players->setFont(fontComp); mMD_Grid->setColWidthPerc(0, maxLblWidth / mMD_Grid->getSize().x()); + + // make result font follow label font + mResultDesc->setFont(Font::get(fontHeight, FONT_PATH_REGULAR)); } + + mResultDesc->setSize(mDescContainer->getSize().x(), 0); // make desc text wrap at edge of container } void ScraperSearchComponent::updateViewStyle() @@ -177,7 +181,7 @@ void ScraperSearchComponent::onSearchDone(const std::vector mScraperResults = results; - const int end = results.size() > 5 ? 5 : results.size(); // at max display 5 + const int end = results.size() > MAX_SCRAPER_RESULTS ? MAX_SCRAPER_RESULTS : results.size(); // at max display 5 auto font = Font::get(FONT_SIZE_MEDIUM); unsigned int color = 0x777777FF; @@ -240,8 +244,8 @@ void ScraperSearchComponent::updateInfoPane() if(i != -1 && (int)mScraperResults.size() > i) { ScraperSearchResult& res = mScraperResults.at(i); - mResultName->setText(res.mdl.get("name")); - mResultDesc->setText(res.mdl.get("desc")); + mResultName->setText(strToUpper(res.mdl.get("name"))); + mResultDesc->setText(strToUpper(res.mdl.get("desc"))); mDescContainer->setScrollPos(Eigen::Vector2d(0, 0)); mDescContainer->resetAutoScrollTimer(); diff --git a/src/components/ScraperSearchComponent.h b/src/components/ScraperSearchComponent.h index 28dc49d27..68c600099 100644 --- a/src/components/ScraperSearchComponent.h +++ b/src/components/ScraperSearchComponent.h @@ -5,7 +5,7 @@ #include "../components/ComponentGrid.h" #include -#define MAX_SCRAPER_RESULTS 5 +#define MAX_SCRAPER_RESULTS 7 class ComponentList; class ImageComponent; diff --git a/src/guis/GuiScraperMulti.cpp b/src/guis/GuiScraperMulti.cpp index 2e7f22a54..e34f54ec1 100644 --- a/src/guis/GuiScraperMulti.cpp +++ b/src/guis/GuiScraperMulti.cpp @@ -21,7 +21,7 @@ GuiScraperMulti::GuiScraperMulti(Window* window, const std::queue(mWindow, "SCRAPING IN PROGRESS", Font::get(FONT_SIZE_LARGE), 0x777777FF, TextComponent::ALIGN_CENTER); + mTitle = std::make_shared(mWindow, "SCRAPING IN PROGRESS", Font::get(FONT_SIZE_LARGE), 0x555555FF, TextComponent::ALIGN_CENTER); mGrid.setEntry(mTitle, Vector2i(0, 0), false, true); mSystem = std::make_shared(mWindow, "SYSTEM", Font::get(FONT_SIZE_MEDIUM), 0x777777FF, TextComponent::ALIGN_CENTER); @@ -47,7 +47,7 @@ GuiScraperMulti::GuiScraperMulti(Window* window, const std::queuegetFont()->getHeight() / mGrid.getSize().y()); - mGrid.setRowHeightPerc(1, mSystem->getFont()->getHeight() / mGrid.getSize().y()); - mGrid.setRowHeightPerc(2, mSubtitle->getFont()->getHeight() / mGrid.getSize().y()); + mGrid.setRowHeightPerc(0, mTitle->getFont()->getLetterHeight() * 1.9725f / mGrid.getSize().y()); + mGrid.setRowHeightPerc(1, (mSystem->getFont()->getLetterHeight() + 2) / mGrid.getSize().y()); + mGrid.setRowHeightPerc(2, mSubtitle->getFont()->getHeight() * 1.75f / mGrid.getSize().y()); mGrid.setRowHeightPerc(4, mButtonGrid->getSize().y() / mGrid.getSize().y()); } @@ -74,7 +74,7 @@ void GuiScraperMulti::doNextSearch() // update title std::stringstream ss; - mSystem->setText(strToUpper(mSearchQueue.front().system->getName())); + mSystem->setText(strToUpper(mSearchQueue.front().system->getFullName())); // update subtitle ss.str(""); // clear diff --git a/src/resources/Font.h b/src/resources/Font.h index 51a39cc91..30f623450 100644 --- a/src/resources/Font.h +++ b/src/resources/Font.h @@ -14,7 +14,7 @@ class TextCache; #define FONT_SIZE_SMALL ((unsigned int)(0.035f * Renderer::getScreenHeight())) #define FONT_SIZE_MEDIUM ((unsigned int)(0.045f * Renderer::getScreenHeight())) -#define FONT_SIZE_LARGE ((unsigned int)(0.1f * Renderer::getScreenHeight())) +#define FONT_SIZE_LARGE ((unsigned int)(0.085f * Renderer::getScreenHeight())) #define FONT_PATH_LIGHT ":/opensans_hebrew_condensed_light.ttf" #define FONT_PATH_REGULAR ":/opensans_hebrew_condensed_regular.ttf"