Skip to content

Commit

Permalink
Hack around #7991 - will investigate later.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Sep 23, 2015
1 parent bd5df95 commit 28b6cdf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion UI/MainScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ext/native/ui/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions ext/native/ui/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,8 @@ class Spacer : public InertView {

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) {}
Expand All @@ -688,6 +688,7 @@ class TextView : public InertView {
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_; }

Expand All @@ -698,6 +699,7 @@ class TextView : public InertView {
bool small_;
bool shadow_;
bool focusable_;
bool clip_;
};

class TextEdit : public View {
Expand Down

0 comments on commit 28b6cdf

Please sign in to comment.