Hack around #7991 - will investigate later.

This commit is contained in:
Henrik Rydgård 2015-09-23 17:34:16 +02:00
parent bd5df95a12
commit 28b6cdf0de
3 changed files with 9 additions and 4 deletions

View File

@ -789,7 +789,10 @@ void MainScreen::CreateViews() {
#endif
logos->Add(new ImageView(I_LOGO, IS_DEFAULT, new LinearLayoutParams(Margins(-12, 0, 0, 0))));
rightColumnItems->Add(logos);
rightColumnItems->Add(new TextView(versionString, new LinearLayoutParams(Margins(70, -6, 0, 0))))->SetSmall(true);
TextView *ver = rightColumnItems->Add(new TextView(versionString, new LinearLayoutParams(Margins(70, -6, 0, 0))));
ver->SetSmall(true);
ver->SetClip(false);
#if defined(_WIN32) || defined(USING_QT_UI)
rightColumnItems->Add(new Choice(mm->T("Load","Load...")))->OnClick.Handle(this, &MainScreen::OnLoadFile);
#endif

View File

@ -617,7 +617,7 @@ void TextView::Draw(UIContext &dc) {
bool clip = false;
if (w > bounds_.w || h > bounds_.h)
clip = true;
if (bounds_.w < 0 || bounds_.h < 0) {
if (bounds_.w < 0 || bounds_.h < 0 || !clip_) {
// We have a layout but, but try not to screw up rendering.
// TODO: Fix properly.
clip = false;

View File

@ -673,8 +673,8 @@ private:
class TextView : public InertView {
public:
TextView(const std::string &text, LayoutParams *layoutParams = 0)
: InertView(layoutParams), text_(text), textAlign_(0), textColor_(0xFFFFFFFF), small_(false), shadow_(false), focusable_(false) {}
TextView(const std::string &text, LayoutParams *layoutParams = 0)
: InertView(layoutParams), text_(text), textAlign_(0), textColor_(0xFFFFFFFF), small_(false), shadow_(false), focusable_(false), clip_(true) {}
TextView(const std::string &text, int textAlign, bool small, LayoutParams *layoutParams = 0)
: InertView(layoutParams), text_(text), textAlign_(textAlign), textColor_(0xFFFFFFFF), small_(small), shadow_(false), focusable_(false) {}
@ -688,6 +688,7 @@ public:
void SetTextColor(uint32_t color) { textColor_ = color; }
void SetShadow(bool shadow) { shadow_ = shadow; }
void SetFocusable(bool focusable) { focusable_ = focusable; }
void SetClip(bool clip) { clip_ = clip; }
bool CanBeFocused() const override { return focusable_; }
@ -698,6 +699,7 @@ private:
bool small_;
bool shadow_;
bool focusable_;
bool clip_;
};
class TextEdit : public View {