diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 4344aac4cd..393e274b06 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -590,6 +590,7 @@ void EmuScreen::CreateViews() { saveStatePreview_->SetFixedSize(160, 90); saveStatePreview_->SetColor(0x90FFFFFF); saveStatePreview_->SetVisibility(V_GONE); + saveStatePreview_->SetCanBeFocused(false); root_->Add(saveStatePreview_); root_->Add(new OnScreenMessagesView(new AnchorLayoutParams((Size)bounds.w, (Size)bounds.h))); } diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 7ad5efa998..e6c22b6286 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -82,6 +82,10 @@ void AsyncImageFileView::Draw(UIContext &dc) { textureFailed_ = true; } + if (HasFocus()) { + dc.FillRect(dc.theme->itemFocusedStyle.background, bounds_.Expand(3)); + } + // TODO: involve sizemode if (texture_) { dc.Flush(); @@ -126,7 +130,7 @@ protected: virtual void CreatePopupContents(UI::ViewGroup *parent) { // TODO: Find an appropriate size for the image view - parent->Add(new AsyncImageFileView(filename_, UI::IS_DEFAULT, NULL, new UI::LayoutParams(480, 272))); + parent->Add(new AsyncImageFileView(filename_, UI::IS_DEFAULT, NULL, new UI::LayoutParams(480, 272)))->SetCanBeFocused(false); } private: diff --git a/UI/PauseScreen.h b/UI/PauseScreen.h index 7c47df1ff2..49fbd0e635 100644 --- a/UI/PauseScreen.h +++ b/UI/PauseScreen.h @@ -67,7 +67,7 @@ class PrioritizedWorkQueue; class AsyncImageFileView : public UI::Clickable { public: AsyncImageFileView(const std::string &filename, UI::ImageSizeMode sizeMode, PrioritizedWorkQueue *wq, UI::LayoutParams *layoutParams = 0) - : UI::Clickable(layoutParams), filename_(filename), color_(0xFFFFFFFF), sizeMode_(sizeMode), texture_(NULL), textureFailed_(false), fixedSizeW_(0.0f), fixedSizeH_(0.0f) {} + : UI::Clickable(layoutParams), canFocus_(true), filename_(filename), color_(0xFFFFFFFF), sizeMode_(sizeMode), texture_(NULL), textureFailed_(false), fixedSizeW_(0.0f), fixedSizeH_(0.0f) {} ~AsyncImageFileView() { delete texture_; } @@ -80,10 +80,14 @@ public: void SetColor(uint32_t color) { color_ = color; } void SetOverlayText(std::string text) { text_ = text; } void SetFixedSize(float fixW, float fixH) { fixedSizeW_ = fixW; fixedSizeH_ = fixH; } + void SetCanBeFocused(bool can) { canFocus_ = can; } + + bool CanBeFocused() const override { return canFocus_; } const std::string &GetFilename() const { return filename_; } private: + bool canFocus_; std::string filename_; std::string text_; uint32_t color_;