mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
Minor UI tweaks
This commit is contained in:
parent
d6fa5b8399
commit
d2e70ce06f
@ -175,6 +175,10 @@ void UIContext::DrawTextRect(const char *str, const Bounds &bounds, uint32_t col
|
||||
}
|
||||
|
||||
void UIContext::FillRect(const UI::Drawable &drawable, const Bounds &bounds) {
|
||||
// Only draw if alpha is non-zero.
|
||||
if ((drawable.color & 0xFF000000) == 0)
|
||||
return;
|
||||
|
||||
switch (drawable.type) {
|
||||
case UI::DRAW_SOLID_COLOR:
|
||||
uidrawbuffer_->DrawImageStretch(theme->whiteImage, bounds.x, bounds.y, bounds.x2(), bounds.y2(), drawable.color);
|
||||
|
@ -10,6 +10,10 @@ UIScreen::UIScreen()
|
||||
: Screen(), root_(0), recreateViews_(true), hatDown_(0) {
|
||||
}
|
||||
|
||||
UIScreen::~UIScreen() {
|
||||
delete root_;
|
||||
}
|
||||
|
||||
void UIScreen::DoRecreateViews() {
|
||||
if (recreateViews_) {
|
||||
delete root_;
|
||||
|
@ -8,7 +8,7 @@ class I18NCategory;
|
||||
class UIScreen : public Screen {
|
||||
public:
|
||||
UIScreen();
|
||||
~UIScreen() { delete root_; }
|
||||
~UIScreen();
|
||||
|
||||
virtual void update(InputState &input);
|
||||
virtual void render();
|
||||
|
@ -414,6 +414,9 @@ void CheckBox::Draw(UIContext &dc) {
|
||||
|
||||
void Button::GetContentDimensions(const UIContext &dc, float &w, float &h) const {
|
||||
dc.MeasureText(dc.theme->uiFont, text_.c_str(), &w, &h);
|
||||
// Add some internal padding to not look totally ugly
|
||||
w += 16;
|
||||
h += 8;
|
||||
}
|
||||
|
||||
void Button::Draw(UIContext &dc) {
|
||||
|
Loading…
Reference in New Issue
Block a user