Commit 1d17bd99 authored by Aloshi's avatar Aloshi

Design tweaks.

Fixed dpad_right.svg.
parent ec4ee702
......@@ -338,7 +338,7 @@ set(ES_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/off_svg.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/fav_add_svg.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/fav_remove_svg.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/slider_knob_png.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/slider_knob_svg.cpp
)
#SOURCE_GROUP(resources FILES ResourceUtil.cpp)
......
......@@ -20,7 +20,7 @@ const Res2hEntry res2hFiles[res2hNrOfFiles] = {
{":/opensans_hebrew_condensed_regular.ttf", opensans_hebrew_condensed_regular_ttf_size, opensans_hebrew_condensed_regular_ttf_data},
{":/option_arrow.svg", option_arrow_svg_size, option_arrow_svg_data},
{":/scroll_gradient.png", scroll_gradient_png_size, scroll_gradient_png_data},
{":/slider_knob.png", slider_knob_png_size, slider_knob_png_data},
{":/slider_knob.svg", slider_knob_svg_size, slider_knob_svg_data},
{":/star_filled.svg", star_filled_svg_size, star_filled_svg_data},
{":/star_unfilled.svg", star_unfilled_svg_size, star_unfilled_svg_data},
{":/help/button_a.svg", help_button_a_svg_size, help_button_a_svg_data},
......@@ -57,7 +57,7 @@ res2hMapType::value_type mapTemp[] = {
std::make_pair(":/opensans_hebrew_condensed_regular.ttf", res2hFiles[13]),
std::make_pair(":/option_arrow.svg", res2hFiles[14]),
std::make_pair(":/scroll_gradient.png", res2hFiles[15]),
std::make_pair(":/slider_knob.png", res2hFiles[16]),
std::make_pair(":/slider_knob.svg", res2hFiles[16]),
std::make_pair(":/star_filled.svg", res2hFiles[17]),
std::make_pair(":/star_unfilled.svg", res2hFiles[18]),
std::make_pair(":/help/button_a.svg", res2hFiles[19]),
......
......@@ -53,8 +53,8 @@ extern const unsigned char option_arrow_svg_data[];
extern const size_t scroll_gradient_png_size;
extern const unsigned char scroll_gradient_png_data[];
extern const size_t slider_knob_png_size;
extern const unsigned char slider_knob_png_data[];
extern const size_t slider_knob_svg_size;
extern const unsigned char slider_knob_svg_data[];
extern const size_t star_filled_svg_size;
extern const unsigned char star_filled_svg_data[];
......
This diff is collapsed.
//this file was auto-generated from "slider_knob.svg" by res2h
#include "../Resources.h"
const size_t slider_knob_svg_size = 627;
const unsigned char slider_knob_svg_data[627] = {
0x3c,0x3f,0x78,0x6d,0x6c,0x20,0x76,0x65,0x72,0x73,
0x69,0x6f,0x6e,0x3d,0x22,0x31,0x2e,0x30,0x22,0x20,
0x65,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x3d,0x22,
0x75,0x74,0x66,0x2d,0x38,0x22,0x3f,0x3e,0x0d,0x0a,
0x3c,0x21,0x2d,0x2d,0x20,0x47,0x65,0x6e,0x65,0x72,
0x61,0x74,0x6f,0x72,0x3a,0x20,0x41,0x64,0x6f,0x62,
0x65,0x20,0x49,0x6c,0x6c,0x75,0x73,0x74,0x72,0x61,
0x74,0x6f,0x72,0x20,0x31,0x36,0x2e,0x30,0x2e,0x33,
0x2c,0x20,0x53,0x56,0x47,0x20,0x45,0x78,0x70,0x6f,
0x72,0x74,0x20,0x50,0x6c,0x75,0x67,0x2d,0x49,0x6e,
0x20,0x2e,0x20,0x53,0x56,0x47,0x20,0x56,0x65,0x72,
0x73,0x69,0x6f,0x6e,0x3a,0x20,0x36,0x2e,0x30,0x30,
0x20,0x42,0x75,0x69,0x6c,0x64,0x20,0x30,0x29,0x20,
0x20,0x2d,0x2d,0x3e,0x0d,0x0a,0x3c,0x21,0x44,0x4f,
0x43,0x54,0x59,0x50,0x45,0x20,0x73,0x76,0x67,0x20,
0x50,0x55,0x42,0x4c,0x49,0x43,0x20,0x22,0x2d,0x2f,
0x2f,0x57,0x33,0x43,0x2f,0x2f,0x44,0x54,0x44,0x20,
0x53,0x56,0x47,0x20,0x31,0x2e,0x31,0x2f,0x2f,0x45,
0x4e,0x22,0x20,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,
0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e,0x6f,0x72,
0x67,0x2f,0x47,0x72,0x61,0x70,0x68,0x69,0x63,0x73,
0x2f,0x53,0x56,0x47,0x2f,0x31,0x2e,0x31,0x2f,0x44,
0x54,0x44,0x2f,0x73,0x76,0x67,0x31,0x31,0x2e,0x64,
0x74,0x64,0x22,0x3e,0x0d,0x0a,0x3c,0x73,0x76,0x67,
0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x3d,0x22,
0x31,0x2e,0x31,0x22,0x20,0x69,0x64,0x3d,0x22,0x45,
0x62,0x65,0x6e,0x65,0x5f,0x31,0x22,0x20,0x78,0x6d,
0x6c,0x6e,0x73,0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,
0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e,0x6f,
0x72,0x67,0x2f,0x32,0x30,0x30,0x30,0x2f,0x73,0x76,
0x67,0x22,0x20,0x78,0x6d,0x6c,0x6e,0x73,0x3a,0x78,
0x6c,0x69,0x6e,0x6b,0x3d,0x22,0x68,0x74,0x74,0x70,
0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e,
0x6f,0x72,0x67,0x2f,0x31,0x39,0x39,0x39,0x2f,0x78,
0x6c,0x69,0x6e,0x6b,0x22,0x20,0x78,0x3d,0x22,0x30,
0x70,0x78,0x22,0x20,0x79,0x3d,0x22,0x30,0x70,0x78,
0x22,0x0d,0x0a,0x09,0x20,0x77,0x69,0x64,0x74,0x68,
0x3d,0x22,0x31,0x36,0x70,0x78,0x22,0x20,0x68,0x65,
0x69,0x67,0x68,0x74,0x3d,0x22,0x31,0x36,0x70,0x78,
0x22,0x20,0x76,0x69,0x65,0x77,0x42,0x6f,0x78,0x3d,
0x22,0x30,0x20,0x30,0x20,0x31,0x36,0x20,0x31,0x36,
0x22,0x20,0x65,0x6e,0x61,0x62,0x6c,0x65,0x2d,0x62,
0x61,0x63,0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,0x3d,
0x22,0x6e,0x65,0x77,0x20,0x30,0x20,0x30,0x20,0x31,
0x36,0x20,0x31,0x36,0x22,0x20,0x78,0x6d,0x6c,0x3a,
0x73,0x70,0x61,0x63,0x65,0x3d,0x22,0x70,0x72,0x65,
0x73,0x65,0x72,0x76,0x65,0x22,0x3e,0x0d,0x0a,0x3c,
0x70,0x61,0x74,0x68,0x20,0x66,0x69,0x6c,0x6c,0x2d,
0x72,0x75,0x6c,0x65,0x3d,0x22,0x65,0x76,0x65,0x6e,
0x6f,0x64,0x64,0x22,0x20,0x63,0x6c,0x69,0x70,0x2d,
0x72,0x75,0x6c,0x65,0x3d,0x22,0x65,0x76,0x65,0x6e,
0x6f,0x64,0x64,0x22,0x20,0x66,0x69,0x6c,0x6c,0x3d,
0x22,0x23,0x37,0x37,0x37,0x37,0x37,0x37,0x22,0x20,
0x64,0x3d,0x22,0x4d,0x38,0x2c,0x30,0x63,0x34,0x2e,
0x34,0x31,0x38,0x2c,0x30,0x2c,0x38,0x2c,0x33,0x2e,
0x35,0x38,0x32,0x2c,0x38,0x2c,0x38,0x63,0x30,0x2c,
0x34,0x2e,0x34,0x31,0x38,0x2d,0x33,0x2e,0x35,0x38,
0x32,0x2c,0x38,0x2d,0x38,0x2c,0x38,0x73,0x2d,0x38,
0x2d,0x33,0x2e,0x35,0x38,0x32,0x2d,0x38,0x2d,0x38,
0x0d,0x0a,0x09,0x43,0x30,0x2c,0x33,0x2e,0x35,0x38,
0x32,0x2c,0x33,0x2e,0x35,0x38,0x33,0x2c,0x30,0x2c,
0x38,0x2c,0x30,0x7a,0x22,0x2f,0x3e,0x0d,0x0a,0x3c,
0x2f,0x73,0x76,0x67,0x3e,0x0d,0x0a
};
......@@ -2,23 +2,48 @@
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="37.134px" height="37.134px" viewBox="0 0 37.134 37.134" enable-background="new 0 0 37.134 37.134" xml:space="preserve">
width="37.133px" height="37.133px" viewBox="0 0 37.133 37.133" enable-background="new 0 0 37.133 37.133" xml:space="preserve">
<g>
<g>
<path fill="none" stroke="#777777" stroke-width="1.5" stroke-miterlimit="10" d="M33.976,12.641h-9.482V3.159
c0,0,0-2.371-2.371-2.371h-7.111c0,0-2.369,0-2.369,2.371v9.482H3.158c0,0-2.371,0-2.371,2.37v7.112c0,0,0,2.371,2.371,2.371
h9.484v9.481c0,0,0,2.371,2.369,2.371h7.111c0,0,2.371,0,2.371-2.371v-9.481h9.482c0,0,2.371,0,2.371-2.371v-7.112
C36.347,15.011,36.347,12.641,33.976,12.641z"/>
<g>
<path fill="#777777" d="M22.122,37.096h-7.11c-2.289,0-3.119-1.866-3.119-3.121v-8.73H3.158c-2.29,0-3.121-1.866-3.121-3.121
v-7.112c0-2.289,1.867-3.12,3.121-3.12h8.735V3.159c0-2.29,1.865-3.121,3.119-3.121h7.111c2.29,0,3.121,1.867,3.121,3.121v8.732
h8.731c1.234,0,2.201,0.552,2.722,1.554c0.388,0.744,0.398,1.482,0.398,1.563v7.115c0,2.29-1.866,3.121-3.121,3.121h-8.732v8.73
C25.243,36.265,23.376,37.096,22.122,37.096z M3.158,13.391c-0.376,0.006-1.621,0.139-1.621,1.62v7.112
c0.005,0.376,0.139,1.621,1.621,1.621h10.234v10.23c0.005,0.376,0.139,1.621,1.619,1.621h7.107
c0.384-0.006,1.624-0.142,1.624-1.621v-10.23h10.232c0.376-0.006,1.621-0.14,1.621-1.621v-7.115
c-0.005-0.279-0.107-1.617-1.62-1.617H23.745V3.159c-0.006-0.376-0.14-1.621-1.621-1.621h-7.111
c-0.376,0.006-1.619,0.139-1.619,1.621v10.232H3.158z"/>
</g>
</g>
<g>
<path fill="#777777" d="M18.568,22.218c-0.976,0-1.893-0.38-2.583-1.07c-0.689-0.689-1.068-1.606-1.067-2.582
c0-2.012,1.637-3.649,3.65-3.649s3.649,1.637,3.649,3.65C22.217,20.581,20.581,22.218,18.568,22.218z M18.568,16.417
c-1.186,0-2.15,0.964-2.15,2.15c0,0.575,0.223,1.115,0.629,1.521s0.946,0.63,1.521,0.63c1.186,0,2.149-0.965,2.149-2.151
C20.717,17.381,19.753,16.417,18.568,16.417z"/>
</g>
<g>
<path fill="#777777" d="M21.573,8.654h-6.011c-0.274,0-0.526-0.15-0.658-0.39c-0.131-0.241-0.121-0.534,0.027-0.765l3.005-4.684
c0.276-0.431,0.987-0.43,1.262,0l3.006,4.684c0.148,0.231,0.159,0.524,0.027,0.765C22.099,8.504,21.847,8.654,21.573,8.654z
M16.934,7.154h3.267l-1.634-2.545L16.934,7.154z"/>
</g>
<g>
<path fill="#777777" d="M7.846,22.323c-0.141,0-0.282-0.04-0.405-0.119l-4.684-3.005c-0.215-0.138-0.345-0.375-0.345-0.631
s0.13-0.493,0.345-0.631l4.684-3.006c0.231-0.147,0.524-0.159,0.765-0.027c0.24,0.131,0.39,0.384,0.39,0.658v6.011
c0,0.274-0.15,0.526-0.39,0.658C8.094,22.292,7.97,22.323,7.846,22.323z M4.551,18.568l2.545,1.633v-3.266L4.551,18.568z"/>
</g>
<g>
<path fill="#777777" d="M33.917,18.567l-4.685-3.005v6.01L33.917,18.567z"/>
<path fill="#777777" d="M29.232,22.322c-0.124,0-0.247-0.03-0.359-0.092c-0.241-0.132-0.391-0.384-0.391-0.658v-6.01
c0-0.274,0.149-0.526,0.391-0.658c0.239-0.132,0.533-0.122,0.765,0.027l4.685,3.005c0.215,0.138,0.345,0.376,0.345,0.631
s-0.13,0.493-0.345,0.631l-4.685,3.005C29.514,22.282,29.373,22.322,29.232,22.322z M29.982,16.934V20.2l2.546-1.633
L29.982,16.934z"/>
</g>
<g>
<path fill="#777777" d="M18.567,34.665L18.567,34.665c-0.255,0-0.493-0.13-0.631-0.345l-3.005-4.684
c-0.148-0.231-0.158-0.524-0.027-0.765c0.132-0.241,0.384-0.391,0.658-0.391h6.011c0.274,0,0.526,0.149,0.658,0.391
c0.132,0.24,0.121,0.533-0.027,0.765l-3.006,4.684C19.06,34.535,18.822,34.665,18.567,34.665z M16.934,29.981l1.633,2.545
l1.634-2.545H16.934z"/>
</g>
<path fill="none" stroke="#777777" stroke-width="1.5" stroke-miterlimit="10" d="M18.568,21.468c1.602,0,2.9-1.299,2.9-2.901
c0-1.602-1.299-2.9-2.9-2.9c-1.604,0-2.9,1.299-2.9,2.9C15.667,20.169,16.964,21.468,18.568,21.468z"/>
<path fill="none" stroke="#777777" stroke-width="1.5" stroke-linejoin="round" stroke-miterlimit="10" d="M18.567,3.22
l-3.005,4.684h6.011L18.567,3.22z"/>
<path fill="none" stroke="#777777" stroke-width="1.5" stroke-linejoin="round" stroke-miterlimit="10" d="M3.162,18.568
l4.684,3.005v-6.011L3.162,18.568z"/>
<path fill="#777777" stroke="#777777" stroke-width="1.5" stroke-linejoin="round" stroke-miterlimit="10" d="M33.916,18.567
l-4.684-3.005v6.01L33.916,18.567z"/>
<path fill="none" stroke="#777777" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
M18.567,33.915l3.006-4.684h-6.011L18.567,33.915z"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
<path fill-rule="evenodd" clip-rule="evenodd" fill="#777777" d="M8,0c4.418,0,8,3.582,8,8c0,4.418-3.582,8-8,8s-8-3.582-8-8
C0,3.582,3.583,0,8,0z"/>
</svg>
......@@ -44,8 +44,9 @@ void ButtonComponent::setText(const std::string& text, const std::string& helpTe
mHelpText = helpText;
mTextCache = std::unique_ptr<TextCache>(mFont->buildTextCache(mText, 0, 0, getCurTextColor()));
setSize(mTextCache->metrics.size + Eigen::Vector2f(12, 0));
float minWidth = mFont->sizeText("DELETE").x() + 12;
setSize(std::max(mTextCache->metrics.size.x() + 12, minWidth), mTextCache->metrics.size.y());
updateHelpPrompts();
}
......
......@@ -78,7 +78,7 @@ void ImageComponent::resize()
SVGResource* svg = dynamic_cast<SVGResource*>(mTexture.get());
if(svg)
{
svg->rasterizeAt((int)mSize.x(), (int)mSize.y());
svg->rasterizeAt((int)round(mSize.x()), (int)round(mSize.y()));
}
}
......
#include "MenuComponent.h"
#include "ButtonComponent.h"
#define BUTTON_GRID_VERT_PADDING 20
#define BUTTON_GRID_HORIZ_PADDING 16
#define BUTTON_GRID_VERT_PADDING 32
#define BUTTON_GRID_HORIZ_PADDING 10
using namespace Eigen;
......@@ -98,3 +98,11 @@ std::shared_ptr<ComponentGrid> makeButtonGrid(Window* window, const std::vector<
return buttonGrid;
}
std::shared_ptr<ImageComponent> makeArrow(Window* window)
{
auto bracket = std::make_shared<ImageComponent>(window);
bracket->setImage(":/arrow.svg");
bracket->setResize(0, round(Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()));
return bracket;
}
......@@ -7,8 +7,10 @@
#include "../Util.h"
class ButtonComponent;
class ImageComponent;
std::shared_ptr<ComponentGrid> makeButtonGrid(Window* window, const std::vector< std::shared_ptr<ButtonComponent> >& buttons);
std::shared_ptr<ImageComponent> makeArrow(Window* window);
class MenuComponent : public GuiComponent
{
......
......@@ -55,7 +55,7 @@ private:
// add checkbox
auto checkbox = std::make_shared<ImageComponent>(mWindow);
checkbox->setImage(it->selected ? ":/checkbox_checked.svg" : ":/checkbox_unchecked.svg");
checkbox->setResize(0, font->getLetterHeight());
row.addElement(checkbox, false);
// input handler
......@@ -135,8 +135,8 @@ public:
// handles positioning/resizing of text and arrows
void onSizeChanged() override
{
mLeftArrow.setResize(0, mSize.y() * 0.5f);
mRightArrow.setResize(0, mSize.y() * 0.5f);
mLeftArrow.setResize(0, mText.getFont()->getLetterHeight());
mRightArrow.setResize(0, mText.getFont()->getLetterHeight());
if(mSize.x() < (mLeftArrow.getSize().x() + mRightArrow.getSize().x()))
LOG(LogWarning) << "OptionListComponent too narrow!";
......
......@@ -16,9 +16,9 @@ SliderComponent::SliderComponent(Window* window, float min, float max, float inc
mMoveScale = ((max - min) * 0.0007f) / increment;
mKnob.setOrigin(0.5f, 0.5f);
mKnob.setImage(":/slider_knob.png");
mKnob.setImage(":/slider_knob.svg");
setSize(196, 32);
setSize(Renderer::getScreenWidth() * 0.15f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight());
}
bool SliderComponent::input(InputConfig* config, Input input)
......@@ -108,7 +108,7 @@ float SliderComponent::getValue()
void SliderComponent::onSizeChanged()
{
if(!mSuffix.empty())
mFont = Font::get((int)(mSize.y() * 0.8f), FONT_PATH_LIGHT);
mFont = Font::get((int)(mSize.y()), FONT_PATH_LIGHT);
onValueChanged();
}
......@@ -139,11 +139,7 @@ void SliderComponent::onValueChanged()
}
// update knob position/size
if(mKnob.getTextureSize().y() > mSize.y()) // only downscale
mKnob.setResize(0, mSize.y());
else
mKnob.setResize(0, 0);
mKnob.setResize(0, mSize.y() * 0.7f);
float lineLength = mSize.x() - mKnob.getSize().x() - (mValueCache ? mValueCache->metrics.size.x() + 4 : 0);
mKnob.setPosition(((mValue + mMin) / mMax) * lineLength + mKnob.getSize().x()/2, mSize.y() / 2);
}
......
......@@ -6,9 +6,7 @@
SwitchComponent::SwitchComponent(Window* window, bool state) : GuiComponent(window), mImage(window), mState(state)
{
mImage.setImage(":/checkbox_unchecked.svg");
float height = (float)FONT_SIZE_MEDIUM;
mImage.setResize(0, height);
mImage.setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight());
mSize = mImage.getSize();
}
......
......@@ -52,7 +52,7 @@ GuiInputConfig::GuiInputConfig(Window* window, InputConfig* target, bool reconfi
// icon
auto icon = std::make_shared<ImageComponent>(mWindow);
icon->setImage(inputIcon[i]);
icon->setResize(0, Font::get(FONT_SIZE_MEDIUM)->getHeight() * 0.8f);
icon->setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * ((i < 4) ? 1.2f : 1.0f)); // hack to enlarge dpad
row.addElement(icon, false);
// spacer between icon and text
......
......@@ -13,22 +13,11 @@
#include "../components/SliderComponent.h"
#include "../components/TextComponent.h"
#include "../components/OptionListComponent.h"
#include "../components/MenuComponent.h"
#include "../VolumeControl.h"
#include "../scrapers/GamesDBScraper.h"
#include "../scrapers/TheArchiveScraper.h"
std::shared_ptr<ImageComponent> makeBracket(Window* window)
{
auto bracket = std::make_shared<ImageComponent>(window);
bracket->setImage(":/arrow.svg");
// resize
const float fontHeight = Font::get(FONT_SIZE_MEDIUM)->getHeight();
bracket->setResize(0, round(fontHeight * 0.5f));
return bracket;
}
GuiMenu::GuiMenu(Window* window) : GuiComponent(window), mMenu(window, "MAIN MENU")
{
setSize((float)Renderer::getScreenWidth(), (float)Renderer::getScreenHeight());
......@@ -68,7 +57,7 @@ GuiMenu::GuiMenu(Window* window) : GuiComponent(window), mMenu(window, "MAIN MEN
row.makeAcceptInputHandler(openAndSave);
auto scrape_now = std::make_shared<TextComponent>(mWindow, "SCRAPE NOW", Font::get(FONT_SIZE_MEDIUM), 0x777777FF);
auto bracket = makeBracket(mWindow);
auto bracket = makeArrow(mWindow);
row.addElement(scrape_now, true);
row.addElement(bracket, false);
s->addRow(row);
......@@ -195,7 +184,7 @@ void GuiMenu::addEntry(const char* name, unsigned int color, bool add_arrow, con
if(add_arrow)
{
std::shared_ptr<ImageComponent> bracket = makeBracket(mWindow);
std::shared_ptr<ImageComponent> bracket = makeArrow(mWindow);
row.addElement(bracket, false);
}
......
......@@ -68,7 +68,7 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, MetaDataList* md, const std::vector
auto bracket = std::make_shared<ImageComponent>(mWindow);
bracket->setImage(":/arrow.svg");
bracket->setResize(Eigen::Vector2f(0, lbl->getSize().y() * 0.8f));
bracket->setResize(Eigen::Vector2f(0, lbl->getFont()->getLetterHeight()));
row.addElement(bracket, false);
bool multiLine = iter->type == MD_MULTILINE_STRING;
......
......@@ -282,6 +282,10 @@ float Font::getHeight() const
return mMaxGlyphHeight * 1.5f * fontScale;
}
float Font::getLetterHeight() const
{
return charData['S'].texH * fontScale;
}
void Font::drawCenteredText(std::string text, float xOffset, float y, unsigned int color)
{
......@@ -434,7 +438,7 @@ TextCache* Font::buildTextCache(const std::string& text, float offsetX, float of
float x = offsetX;
float yTop = (charData['S'].bearingY);
float yTop = charData['S'].bearingY * fontScale;
float yBot = getHeight();
float y = offsetY + (yBot + yTop)/2.0f;
......
......@@ -66,6 +66,7 @@ public:
void drawCenteredText(std::string text, float xOffset, float y, unsigned int color);
float getHeight() const;
float getLetterHeight() const;
void unload(std::shared_ptr<ResourceManager>& rm) override;
void reload(std::shared_ptr<ResourceManager>& rm) override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment