ide: IconDes now shows Image .iml size estimates

This commit is contained in:
Mirek Fidler 2024-07-29 14:05:20 +02:00
parent 6349bd66cc
commit 837fce23ea
2 changed files with 10 additions and 3 deletions

View file

@ -1,4 +1,4 @@
LAYOUT(ImageLayout, 168, 232)
LAYOUT(ImageLayout, 168, 252)
ITEM(Upp::Label, dv___0, SetLabel(t_("Name")).LeftPosZ(8, 40).TopPosZ(8, 19))
ITEM(Upp::EditString, name, LeftPosZ(52, 108).TopPosZ(8, 19))
ITEM(Upp::Label, dv___2, SetLabel(t_("Size")).LeftPosZ(8, 40).TopPosZ(32, 19))
@ -12,8 +12,9 @@ LAYOUT(ImageLayout, 168, 232)
ITEM(Upp::Option, dark, SetLabel(t_("Dark variant")).LeftPosZ(8, 156).TopPosZ(128, 16))
ITEM(Upp::Option, s3, SetLabel(t_("Supersampled 3x")).LeftPosZ(8, 156).TopPosZ(152, 16))
ITEM(Upp::Option, exp, SetLabel(t_("Export as icon.ico and .png")).LeftPosZ(8, 160).TopPosZ(176, 16))
ITEM(Upp::Button, ok, SetLabel(t_("OK")).LeftPosZ(28, 64).TopPosZ(200, 24))
ITEM(Upp::Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(96, 64).TopPosZ(200, 24))
ITEM(Upp::Button, ok, SetLabel(t_("OK")).LeftPosZ(28, 64).TopPosZ(220, 24))
ITEM(Upp::Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(96, 64).TopPosZ(220, 24))
ITEM(Upp::Label, estimated_size, SetAlign(Upp::ALIGN_RIGHT).LeftPosZ(8, 156).TopPosZ(196, 19))
END_LAYOUT
LAYOUT(ImageSizeLayout, 168, 68)

View file

@ -438,6 +438,12 @@ void IconDes::EditImage()
dword flags = c.flags;
bool exp = c.exp;
String name = c.name;
Vector<ImageIml> bimg;
ImageIml mm;
mm.image = c.image;
bimg << mm;
dlg.estimated_size = FormatFileSize(PackImlData(bimg).GetCount());
dlg.cx <<= img.GetWidth();
dlg.cy <<= img.GetHeight();