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
|
|
@ -384,7 +384,7 @@ IconDes::IconDes()
|
|||
AddFrame(sb);
|
||||
AddFrame(ViewFrame());
|
||||
|
||||
leftpane.Left(rgbactrl, 256);
|
||||
leftpane.Left(rgbactrl, DPI(250));
|
||||
rgbactrl.SubCtrl(&imgs);
|
||||
|
||||
rgbactrl <<= THISBACK(ColorChanged);
|
||||
|
|
@ -415,7 +415,7 @@ IconDes::IconDes()
|
|||
search <<= THISBACK(Search);
|
||||
search.SetFilter(CharFilterToUpper);
|
||||
|
||||
bottompane.Bottom(iconshow, 64);
|
||||
bottompane.Bottom(iconshow, DPI(150));
|
||||
|
||||
magnify = 13;
|
||||
pen = 1;
|
||||
|
|
|
|||
|
|
@ -391,6 +391,7 @@ private:
|
|||
|
||||
static FileSel& ImgFile();
|
||||
static String FormatImageName(const Slot& c);
|
||||
static String FormatImageNameQtf(const Slot& c);
|
||||
|
||||
public:
|
||||
void ListMenu(Bar& bar);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,30 @@ String IconDes::FormatImageName(const Slot& c)
|
|||
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()
|
||||
{
|
||||
if(syncinglist)
|
||||
|
|
@ -34,7 +58,7 @@ void IconDes::SyncList()
|
|||
for(int i = 0; i < slot.GetCount(); i++) {
|
||||
Slot& c = slot[i];
|
||||
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.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);
|
||||
|
||||
for(Ctrl& q : dlg)
|
||||
if(dynamic_cast<Option *>(&q))
|
||||
if(dynamic_cast<Option *>(&q) || dynamic_cast<Switch *>(&q))
|
||||
q << [&] { dlg.Break(-1000); };
|
||||
}
|
||||
dlg.name.SetConvert(
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ void IconShow::Paint(Draw& w)
|
|||
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 y = DPI(5);
|
||||
for(int i = 0; i < n; i++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue