From c0507faf0aef0e75eec1613e637e7dc91190f0cf Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Tue, 5 May 2026 14:43:56 +0200 Subject: [PATCH] ide: IconDes improvements --- examples/UWord/UWord.iml | 3 ++- uppsrc/ide/IconDes/Bar.cpp | 4 ++-- uppsrc/ide/IconDes/IconDes.h | 1 + uppsrc/ide/IconDes/List.cpp | 28 ++++++++++++++++++++++++++-- uppsrc/ide/IconDes/Paint.cpp | 2 +- 5 files changed, 32 insertions(+), 6 deletions(-) diff --git a/examples/UWord/UWord.iml b/examples/UWord/UWord.iml index 5458fe726..72c345b9e 100644 --- a/examples/UWord/UWord.iml +++ b/examples/UWord/UWord.iml @@ -1,6 +1,7 @@ PREMULTIPLIED +VERSION(20260403) IMAGE_ID(pdf) -IMAGE_ID(pdf__UHD) +IMAGE_ID(pdf__600) 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) diff --git a/uppsrc/ide/IconDes/Bar.cpp b/uppsrc/ide/IconDes/Bar.cpp index 738ec123e..e8c540c1e 100644 --- a/uppsrc/ide/IconDes/Bar.cpp +++ b/uppsrc/ide/IconDes/Bar.cpp @@ -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; diff --git a/uppsrc/ide/IconDes/IconDes.h b/uppsrc/ide/IconDes/IconDes.h index 2ebcda780..4467555d8 100644 --- a/uppsrc/ide/IconDes/IconDes.h +++ b/uppsrc/ide/IconDes/IconDes.h @@ -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); diff --git a/uppsrc/ide/IconDes/List.cpp b/uppsrc/ide/IconDes/List.cpp index 2c9cfd01d..af8e2ab17 100644 --- a/uppsrc/ide/IconDes/List.cpp +++ b/uppsrc/ide/IconDes/List.cpp @@ -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& 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