diff --git a/THEMES.md b/THEMES.md index d98273c44..4bcd23048 100644 --- a/THEMES.md +++ b/THEMES.md @@ -194,8 +194,7 @@ Reference * image name="header" - POSITION | SIZE | PATH * textlist name="gamelist" - ALL * image name="gameimage" - POSITION | SIZE - * container name="infoPanel" - POSITION | SIZE - * text name="description" - POSITION | FONT_PATH | FONT_SIZE | COLOR + * text name="description" - POSITION | SIZE | FONT_PATH | FONT_SIZE | COLOR #### grid * image name="background" - PATH | TILING @@ -217,6 +216,16 @@ Reference * text name="subtext" - FONT_PATH | COLOR +## Types of properties: + +* NORMALIZED_PAIR - two decimals, in the range [0..1]. For example, `0.25 0.5`. +* PATH - a path. If the first character is a `~`, it will be expanded into the environment variable for the home path (`$HOME` or `%HOMEPATH%`, depending on platform). If the first character is a `.`, it will be expanded to the theme file's directory. +* BOOLEAN - `true`/`1` or `false`/`0`. +* COLOR - a hexidecimal RGB or RGBA color (6 or 8 digits). If 6 digits, will assume the alpha channel is `FF` (not transparent). +* FLOAT - a decimal. +* STRING - a string of text. + + ## Types of elements and their properties: #### image @@ -248,10 +257,6 @@ Reference * `scrollSound` - type: PATH. * `center` - type: BOOLEAN. -#### container - * `pos` - type: NORMALIZED_PAIR. - * `size` - type: NORMALIZED_PAIR. - #### ninepatch * `pos` - type: NORMALIZED_PAIR. * `size` - type: NORMALIZED_PAIR. @@ -266,16 +271,6 @@ A quick word on the "ninepatch" type - EmulationStation borrows the concept of " *Note that a view may choose to only make only certain properties on a particular element themable.* -## Types of properties: - -* NORMALIZED_PAIR - two decimals, in the range [0..1]. For example, `0.25 0.5`. -* PATH - a path. If the first character is a `~`, it will be expanded into the environment variable for the home path (`$HOME` or `%HOMEPATH%`, depending on platform). If the first character is a `.`, it will be expanded to the theme file's directory. -* BOOLEAN - `true`/`1` or `false`/`0`. -* COLOR - a hexidecimal RGB or RGBA color (6 or 8 digits). If 6 digits, will assume the alpha channel is `FF` (not transparent). -* FLOAT - a decimal. -* STRING - a string of text. - - -Aloshi http://www.aloshi.com diff --git a/src/components/ScrollableContainer.cpp b/src/components/ScrollableContainer.cpp index 73a4a6ab2..87e948c78 100644 --- a/src/components/ScrollableContainer.cpp +++ b/src/components/ScrollableContainer.cpp @@ -80,7 +80,10 @@ void ScrollableContainer::update(int deltaTime) Eigen::Vector2f contentSize = getContentSize(); if(mScrollPos.x() + getSize().x() > contentSize.x()) mScrollPos[0] = (double)contentSize.x() - getSize().x(); - if(mScrollPos.y() + getSize().y() > contentSize.y()) + + if(contentSize.y() < getSize().y()) + mScrollPos[1] = 0; + else if(mScrollPos.y() + getSize().y() > contentSize.y()) mScrollPos[1] = (double)contentSize.y() - getSize().y(); GuiComponent::update(deltaTime); diff --git a/src/views/gamelist/DetailedGameListView.cpp b/src/views/gamelist/DetailedGameListView.cpp index 5b02511ce..4cafd64d3 100644 --- a/src/views/gamelist/DetailedGameListView.cpp +++ b/src/views/gamelist/DetailedGameListView.cpp @@ -39,8 +39,10 @@ void DetailedGameListView::onThemeChanged(const std::shared_ptr& them using namespace ThemeFlags; mImage.applyTheme(theme, getName(), "gameimage", POSITION | ThemeFlags::SIZE); - mDescContainer.applyTheme(theme, getName(), "infoPanel", POSITION | ThemeFlags::SIZE); - mDescription.applyTheme(theme, getName(), "description", POSITION | ThemeFlags::SIZE | FONT_PATH | FONT_SIZE | COLOR); + + mDescContainer.applyTheme(theme, getName(), "description", POSITION | ThemeFlags::SIZE); + mDescription.setSize(mDescContainer.getSize().x(), 0); + mDescription.applyTheme(theme, getName(), "description", FONT_PATH | FONT_SIZE | COLOR); } void DetailedGameListView::updateInfoPanel() @@ -56,6 +58,7 @@ void DetailedGameListView::updateInfoPanel() mDescription.setText(file->metadata.get("desc")); mDescContainer.resetAutoScrollTimer(); + mDescContainer.setScrollPos(Eigen::Vector2d(0, 0)); } }