Merge pull request #14924 from iota97/jap-ui-space

Improve UI space for different translation a bit.
This commit is contained in:
Henrik Rydgård 2021-09-28 19:36:31 +02:00 committed by GitHub
commit 65213e61b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 7 deletions

View file

@ -217,6 +217,13 @@ void UIContext::DrawTextRect(const char *str, const Bounds &bounds, uint32_t col
}
}
void UIContext::DrawTextShadowRect(const char *str, const Bounds &bounds, uint32_t color, int align) {
uint32_t alpha = (color >> 1) & 0xFF000000;
Bounds shadowBounds(bounds.x+2, bounds.y+2, bounds.w, bounds.h);
DrawTextRect(str, shadowBounds, alpha, align);
DrawTextRect(str, bounds, color, align);
}
void UIContext::FillRect(const UI::Drawable &drawable, const Bounds &bounds) {
// Only draw if alpha is non-zero.
if ((drawable.color & 0xFF000000) == 0)

View file

@ -84,6 +84,7 @@ public:
void DrawText(const char *str, float x, float y, uint32_t color, int align = 0);
void DrawTextShadow(const char *str, float x, float y, uint32_t color, int align = 0);
void DrawTextRect(const char *str, const Bounds &bounds, uint32_t color, int align = 0);
void DrawTextShadowRect(const char *str, const Bounds &bounds, uint32_t color, int align = 0);
void FillRect(const UI::Drawable &drawable, const Bounds &bounds);
void DrawImageVGradient(ImageID image, uint32_t color1, uint32_t color2, const Bounds &bounds);

View file

@ -99,7 +99,7 @@ void SingleControlMapper::Refresh() {
using namespace UI;
float itemH = 45;
float itemH = 55.0f;
float leftColumnWidth = 200;
float rightColumnWidth = 250; // TODO: Should be flexible somehow. Maybe we need to implement Measure.
@ -478,7 +478,8 @@ void JoystickHistoryView::Draw(UIContext &dc) {
}
float minRadius = std::min(bounds_.w, bounds_.h) * 0.5f - image->w;
dc.Begin();
dc.DrawTextShadow(title_.c_str(), bounds_.centerX(), bounds_.centerY() + minRadius + 5.0, 0xFFFFFFFF, ALIGN_TOP | ALIGN_HCENTER);
Bounds textBounds(bounds_.x, bounds_.centerY() + minRadius + 5.0, bounds_.w, bounds_.h/2 - minRadius - 5.0);
dc.DrawTextShadowRect(title_.c_str(), textBounds, 0xFFFFFFFF, ALIGN_TOP | ALIGN_HCENTER | FLAG_WRAP_TEXT);
dc.Flush();
dc.BeginNoTex();
dc.Draw()->RectOutline(bounds_.centerX() - minRadius, bounds_.centerY() - minRadius, minRadius * 2.0f, minRadius * 2.0f, 0x80FFFFFF);

View file

@ -2053,9 +2053,8 @@ void GestureMappingScreen::CreateViews() {
auto mc = GetI18NCategory("MappableControls");
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
Choice *back = new Choice(di->T("Back"), "", false, new AnchorLayoutParams(130, WRAP_CONTENT, 10, NONE, NONE, 10));
root_->Add(back)->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, 140, new AnchorLayoutParams(10, 0, 10, 0, false));
AddStandardBack(root_);
TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, 200, new AnchorLayoutParams(10, 0, 10, 0, false));
root_->Add(tabHolder);
ScrollView *rightPanel = new ScrollView(ORIENT_VERTICAL);
tabHolder->AddTab(co->T("Gesture"), rightPanel);

View file

@ -610,7 +610,7 @@ void TouchControlLayoutScreen::CreateViews() {
const Bounds &bounds = screenManager()->getUIContext()->GetBounds();
InitPadLayout(bounds.w, bounds.h);
const float leftColumnWidth = 140.0f;
const float leftColumnWidth = 170.0f;
layoutAreaScale = 1.0-(leftColumnWidth+10)/bounds.w;
using namespace UI;

View file

@ -40,7 +40,7 @@ Button Opacity = ボタンの透明度
Button style = ボタンのスタイル
Calibrate Analog Stick = アナログスティックをキャリブレートする
Calibrate D-Pad = 十字キーをキャリブレートする
Calibrated = キャリブレーション(調整)された動作
Calibrated = キャリブレーション\n(調整)された動作
Calibration = キャリブレーション
Circular stick input = 環状スティック入力
Classic = クラシック