mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
ide: IconDes improvements
This commit is contained in:
parent
7e2760bc7d
commit
c0507faf0a
5 changed files with 32 additions and 6 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
PREMULTIPLIED
|
PREMULTIPLIED
|
||||||
|
VERSION(20260403)
|
||||||
IMAGE_ID(pdf)
|
IMAGE_ID(pdf)
|
||||||
IMAGE_ID(pdf__UHD)
|
IMAGE_ID(pdf__600)
|
||||||
|
|
||||||
IMAGE_BEGIN_DATA
|
IMAGE_BEGIN_DATA
|
||||||
IMAGE_DATA(120,156,237,218,205,109,195,48,12,5,96,143,208,1,50,64,55,72,22,201,189,167,220,187,65,166,235,28,129,23,113,107)
|
IMAGE_DATA(120,156,237,218,205,109,195,48,12,5,96,143,208,1,50,64,55,72,22,201,189,167,220,187,65,166,235,28,129,23,113,107)
|
||||||
|
|
|
||||||
|
|
@ -384,7 +384,7 @@ IconDes::IconDes()
|
||||||
AddFrame(sb);
|
AddFrame(sb);
|
||||||
AddFrame(ViewFrame());
|
AddFrame(ViewFrame());
|
||||||
|
|
||||||
leftpane.Left(rgbactrl, 256);
|
leftpane.Left(rgbactrl, DPI(250));
|
||||||
rgbactrl.SubCtrl(&imgs);
|
rgbactrl.SubCtrl(&imgs);
|
||||||
|
|
||||||
rgbactrl <<= THISBACK(ColorChanged);
|
rgbactrl <<= THISBACK(ColorChanged);
|
||||||
|
|
@ -415,7 +415,7 @@ IconDes::IconDes()
|
||||||
search <<= THISBACK(Search);
|
search <<= THISBACK(Search);
|
||||||
search.SetFilter(CharFilterToUpper);
|
search.SetFilter(CharFilterToUpper);
|
||||||
|
|
||||||
bottompane.Bottom(iconshow, 64);
|
bottompane.Bottom(iconshow, DPI(150));
|
||||||
|
|
||||||
magnify = 13;
|
magnify = 13;
|
||||||
pen = 1;
|
pen = 1;
|
||||||
|
|
|
||||||
|
|
@ -391,6 +391,7 @@ private:
|
||||||
|
|
||||||
static FileSel& ImgFile();
|
static FileSel& ImgFile();
|
||||||
static String FormatImageName(const Slot& c);
|
static String FormatImageName(const Slot& c);
|
||||||
|
static String FormatImageNameQtf(const Slot& c);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void ListMenu(Bar& bar);
|
void ListMenu(Bar& bar);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,30 @@ String IconDes::FormatImageName(const Slot& c)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String IconDes::FormatImageNameQtf(const Slot& c)
|
||||||
|
{
|
||||||
|
Size sz = c.image.GetSize();
|
||||||
|
String r;
|
||||||
|
r << "\1[g \1" << c.name << "\1 [@r " << sz.cx << "[@K x]" << sz.cy << "]";
|
||||||
|
if(c.flags & IML_IMAGE_FLAG_FIXED)
|
||||||
|
r << " [@B$Y Fxd]";
|
||||||
|
else {
|
||||||
|
if(c.flags & IML_IMAGE_FLAG_FIXED_COLORS)
|
||||||
|
r << " [@B$Y Clr]";
|
||||||
|
if(c.flags & IML_IMAGE_FLAG_FIXED_SIZE)
|
||||||
|
r << " [@B$Y Sz]";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(c.flags & (IML_IMAGE_FLAG_FIXED|IML_IMAGE_FLAG_FIXED_SIZE))) {
|
||||||
|
int scale = ImlFlagsToDPIScale(c.flags);
|
||||||
|
r << "[@B " << decode(scale, DPI_100, " 1[0 00`%]", DPI_150, " 15[0 0`%]", DPI_200, " 2[0 00`%]", DPI_300, " 3[0 00`%]", "") << "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(c.exp)
|
||||||
|
r << " X";
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
void IconDes::SyncList()
|
void IconDes::SyncList()
|
||||||
{
|
{
|
||||||
if(syncinglist)
|
if(syncinglist)
|
||||||
|
|
@ -34,7 +58,7 @@ void IconDes::SyncList()
|
||||||
for(int i = 0; i < slot.GetCount(); i++) {
|
for(int i = 0; i < slot.GetCount(); i++) {
|
||||||
Slot& c = slot[i];
|
Slot& c = slot[i];
|
||||||
if(ToUpper(c.name).Find(s) >= 0)
|
if(ToUpper(c.name).Find(s) >= 0)
|
||||||
ilist.Add(i, FormatImageName(c), RawToValue(MakeTuple(c.image, c.flags)));
|
ilist.Add(i, FormatImageNameQtf(c), RawToValue(MakeTuple(c.image, c.flags)));
|
||||||
}
|
}
|
||||||
ilist.ScrollTo(sc);
|
ilist.ScrollTo(sc);
|
||||||
ilist.FindSetCursor(q);
|
ilist.FindSetCursor(q);
|
||||||
|
|
@ -85,7 +109,7 @@ void IconDes::PrepareImageDlg(WithImageLayout<TopWindow>& dlg)
|
||||||
dlg.scale = decode(scale, DPI_100, 1, DPI_150, 2, DPI_200, 3, DPI_300, 4, 0);
|
dlg.scale = decode(scale, DPI_100, 1, DPI_150, 2, DPI_200, 3, DPI_300, 4, 0);
|
||||||
|
|
||||||
for(Ctrl& q : dlg)
|
for(Ctrl& q : dlg)
|
||||||
if(dynamic_cast<Option *>(&q))
|
if(dynamic_cast<Option *>(&q) || dynamic_cast<Switch *>(&q))
|
||||||
q << [&] { dlg.Break(-1000); };
|
q << [&] { dlg.Break(-1000); };
|
||||||
}
|
}
|
||||||
dlg.name.SetConvert(
|
dlg.name.SetConvert(
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ void IconShow::Paint(Draw& w)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int n = min(__countof(color), sz.cx / (sz300.cx + DPI(15)));
|
int n = min(__countof(color), sz.cx / (2 * sz300.cx + DPI(20)));
|
||||||
int cx = sz.cx / n;
|
int cx = sz.cx / n;
|
||||||
int y = DPI(5);
|
int y = DPI(5);
|
||||||
for(int i = 0; i < n; i++)
|
for(int i = 0; i < n; i++)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue