mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-01 10:21:04 +00:00
Use new Entry suffixes in SpriteSizeCommand
This commit is contained in:
parent
527c85e26e
commit
7c15aee0a5
@ -12,8 +12,8 @@
|
||||
<label text="Height:" />
|
||||
</box>
|
||||
<box vertical="true" homogeneous="true" expansive="true">
|
||||
<entry expansive="true" id="width_px" maxsize="8" magnet="true" tooltip="New width for the sprite (in pixels)" />
|
||||
<entry expansive="true" id="height_px" maxsize="8" tooltip="New height for the sprite (in pixels)" />
|
||||
<entry expansive="true" id="width_px" suffix="px" maxsize="8" magnet="true" tooltip="New width for the sprite (in pixels)" />
|
||||
<entry expansive="true" id="height_px" suffix="px" maxsize="8" tooltip="New height for the sprite (in pixels)" />
|
||||
</box>
|
||||
<check text="Lock Ratio" id="lock_ratio" selected="true" />
|
||||
</box>
|
||||
@ -26,8 +26,8 @@
|
||||
<label text="Height:" />
|
||||
</box>
|
||||
<box vertical="true" homogeneous="true" expansive="true">
|
||||
<entry expansive="true" text="100%%" id="width_perc" maxsize="8" magnet="true" tooltip="New width for the sprite Percentage of current width." />
|
||||
<entry expansive="true" text="100%%" id="height_perc" maxsize="8" tooltip="New height for the sprite Percentage of current height." />
|
||||
<entry expansive="true" text="100" suffix="%" id="width_perc" maxsize="8" magnet="true" tooltip="New width for the sprite Percentage of current width." />
|
||||
<entry expansive="true" text="100" suffix="%" id="height_perc" maxsize="8" tooltip="New height for the sprite Percentage of current height." />
|
||||
</box>
|
||||
<box horizontal="true" width="64" />
|
||||
</box>
|
||||
|
@ -239,8 +239,9 @@ Widget* WidgetLoader::convertXmlElementToWidget(const TiXmlElement* elem, Widget
|
||||
}
|
||||
/* entry */
|
||||
else if (ustrcmp(elem_name, "entry") == 0) {
|
||||
const char *maxsize = elem->Attribute("maxsize");
|
||||
const char *text = elem->Attribute("text");
|
||||
const char* maxsize = elem->Attribute("maxsize");
|
||||
const char* text = elem->Attribute("text");
|
||||
const char* suffix = elem->Attribute("suffix");
|
||||
|
||||
if (maxsize != NULL) {
|
||||
bool readonly = bool_attr_is_true(elem, "readonly");
|
||||
@ -250,7 +251,12 @@ Widget* WidgetLoader::convertXmlElementToWidget(const TiXmlElement* elem, Widget
|
||||
|
||||
if (readonly)
|
||||
((Entry*)widget)->setReadOnly(true);
|
||||
|
||||
if (suffix)
|
||||
((Entry*)widget)->setSuffix(suffix);
|
||||
}
|
||||
else
|
||||
throw std::runtime_error("<entry> element found without 'maxsize' attribute");
|
||||
}
|
||||
/* grid */
|
||||
else if (ustrcmp(elem_name, "grid") == 0) {
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
using namespace ui;
|
||||
|
||||
#define PERC_FORMAT "%.1f%%"
|
||||
#define PERC_FORMAT "%.1f"
|
||||
|
||||
class SpriteSizeJob : public Job
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user