mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Fix shadowing issue in TabHolder that messed up the direction of tab switching animation
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
namespace UI {
|
||||
|
||||
TabHolder::TabHolder(Orientation orientation, float stripSize, TabHolderFlags flags, View *bannerView, LayoutParams *layoutParams)
|
||||
: LinearLayout(Opposite(orientation), layoutParams), orientation_(orientation), flags_(flags) {
|
||||
: LinearLayout(Opposite(orientation), layoutParams), tabOrientation_(orientation), flags_(flags) {
|
||||
SetSpacing(0.0f);
|
||||
if (orientation == ORIENT_HORIZONTAL) {
|
||||
// This orientation supports adding a back button.
|
||||
@@ -66,9 +66,9 @@ void TabHolder::AddBack(UIScreen *parent) {
|
||||
|
||||
void TabHolder::AddTabContents(std::string_view title, ImageID imageId, ViewGroup *tabContents) {
|
||||
tabs_.push_back(tabContents);
|
||||
if (orientation_ == ORIENT_HORIZONTAL && (flags_ & TabHolderFlags::HorizontalOnlyIcons) && imageId.isValid()) {
|
||||
if (tabOrientation_ == ORIENT_HORIZONTAL && (flags_ & TabHolderFlags::HorizontalOnlyIcons) && imageId.isValid()) {
|
||||
tabStrip_->AddChoice(imageId);
|
||||
} else if (orientation_ == ORIENT_VERTICAL && (flags_ & TabHolderFlags::VerticalShowIcons) && imageId.isValid()) {
|
||||
} else if (tabOrientation_ == ORIENT_VERTICAL && (flags_ & TabHolderFlags::VerticalShowIcons) && imageId.isValid()) {
|
||||
tabStrip_->AddChoice(title, imageId);
|
||||
} else {
|
||||
tabStrip_->AddChoice(title);
|
||||
@@ -86,9 +86,9 @@ void TabHolder::AddTabContents(std::string_view title, ImageID imageId, ViewGrou
|
||||
|
||||
void TabHolder::AddTabDeferred(std::string_view title, ImageID imageId, std::function<ViewGroup *()> createCb) {
|
||||
tabs_.push_back(nullptr); // marker
|
||||
if (orientation_ == ORIENT_HORIZONTAL && (flags_ & TabHolderFlags::HorizontalOnlyIcons) && imageId.isValid()) {
|
||||
if (tabOrientation_ == ORIENT_HORIZONTAL && (flags_ & TabHolderFlags::HorizontalOnlyIcons) && imageId.isValid()) {
|
||||
tabStrip_->AddChoice(imageId);
|
||||
} else if (orientation_ == ORIENT_VERTICAL && (flags_ & TabHolderFlags::VerticalShowIcons) && imageId.isValid()) {
|
||||
} else if (tabOrientation_ == ORIENT_VERTICAL && (flags_ & TabHolderFlags::VerticalShowIcons) && imageId.isValid()) {
|
||||
tabStrip_->AddChoice(title, imageId);
|
||||
} else {
|
||||
tabStrip_->AddChoice(title);
|
||||
|
||||
@@ -59,7 +59,7 @@ private:
|
||||
ChoiceStrip *tabStrip_ = nullptr;
|
||||
ScrollView *tabScroll_ = nullptr;
|
||||
ViewGroup *contents_ = nullptr;
|
||||
Orientation orientation_ = ORIENT_HORIZONTAL;
|
||||
Orientation tabOrientation_ = ORIENT_HORIZONTAL;
|
||||
|
||||
TabHolderFlags flags_ = TabHolderFlags::Default;
|
||||
int currentTab_ = 0;
|
||||
|
||||
Reference in New Issue
Block a user