From c113cb95a7c902df99c958409ab98a54845843fa Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Wed, 20 Mar 2019 18:38:07 +0100 Subject: [PATCH] GuiLyXFiles: add icons that indicate whether a file is from user or system --- lib/Makefile.am | 2 ++ lib/images/lyxfiles-system.svgz | Bin 0 -> 818 bytes lib/images/lyxfiles-user.svgz | Bin 0 -> 477 bytes src/frontends/qt4/GuiLyXFiles.cpp | 9 ++++++--- 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 lib/images/lyxfiles-system.svgz create mode 100644 lib/images/lyxfiles-user.svgz diff --git a/lib/Makefile.am b/lib/Makefile.am index 819a61ec81..2b37cc015e 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -618,6 +618,8 @@ dist_images_DATA1X = \ images/layout-toggle_LyX-Code.svgz \ images/layout-toggle_Chunk.svgz \ images/layout-toggle_Section.svgz \ + images/lyxfiles-system.svgz \ + images/lyxfiles-user.svgz \ images/lyx-quit.svgz \ images/marginalnote-insert.svgz \ images/master-buffer-update.svgz \ diff --git a/lib/images/lyxfiles-system.svgz b/lib/images/lyxfiles-system.svgz new file mode 100644 index 0000000000000000000000000000000000000000..24d99418757ee8bf94c008002eaea8e46b147373 GIT binary patch literal 818 zcmV-21I_#&iwFP!000000EJZBj+-zLec!LJ=ws!f=HO}s=jWz<1YF3^*wh98>h0X z%g}dzmvnvdW`DOGACGs8F%0g;Oe?R zuLfUE&7-gSw(YwyMt0+?8}LvcuITgm3}+odvM7pFs8lJA2tGb_Q~8TO55*o|3ROag z6z^8#e^E`nOYqr5<3=nQ9Vg!$PZQcUn&+mTPSM(v)tu?#ks=}xgA_KO z-@TtLw5w|Ky&rxqCjJOe{^%dDO0vJYw{^8S^g~-t`=%|Ap89=_jJD}|@eDjY-TO7^ zoObYI|1ebk#Szw3+fY#YWoknBKt&Rk{*|p4NJT_zVBlyK%^`RdSj6+>K$e-4E$Kuh(} zfYF!+iX1a(SAfzSa+O0S4ae8aYH(5oC@`6%laggQo6jX#RuD=D9?M}zPQJBJNEVL> z!eHqfIyAz$we-b4esLWR+kbbB)bv&{{=b;7d@21#;w?A!`RNSCOTpieW8Y zVFFM{Fqe=agSkJ2np|k)73Q{xabR-;nNw^fi$PjqMPmzu2@6u^V6_2d7Tt8XQ8x!E z9h=V!S4~P2D4#W~2!84ZOH4W~OsxV`=qt#%Ua!=D}$o{K{N?lmZ)I8h161%bcY4zFQ87e7 z?51BofZaMBMH(Y4pL5TB%k|@HufQOzlSVg?nc-5O8u;h;Q?`S^d8#>8MvDe& z10UN}?S|6|01%wDt2k?5=l!`t=zOs%H}-@$LqdsOXzvio34)89EplcB^>Pr*^u5t8 zd207?Bewkbp&rLEAIl^n`~4o_0u@CT6q&nfPhYdouA#2(huS)U;hVOL( zH^U-{=!86VKHzPFqvXDeD95;jZJ_F2c*?1#(L6e`|DXOL8q`*ICHT~++8DQy^K!i zmzPR?k4Ydv{{)p@i8ke&KHs}Qa~pG$=%&jWy$>NFE{<-QPei*pO?{@mTTBrZaKgt> zQ3D?eQLfAF%$cyDqcURy2kGQNiJ50c85_h05zkD9ct3V=QJ|nDC;~5J27IOKe7y(hHCfhy4R^>lEV|C8BiO|_BqKwXZ|-@;`!*Nh{8fe7_td@!Tj}th TrOxZP%Xak_=-^NqqXPf{UoPLp literal 0 HcmV?d00001 diff --git a/src/frontends/qt4/GuiLyXFiles.cpp b/src/frontends/qt4/GuiLyXFiles.cpp index 95b5ef2171..c442b4e023 100644 --- a/src/frontends/qt4/GuiLyXFiles.cpp +++ b/src/frontends/qt4/GuiLyXFiles.cpp @@ -30,7 +30,6 @@ #include "support/Package.h" #include -#include #include using namespace std; @@ -274,7 +273,8 @@ void GuiLyXFiles::updateContents() getFiles(files, type); filesLW->clear(); - QFileIconProvider iconprovider; + QIcon user_icon(getPixmap("images/", "lyxfiles-user", "svgz,png")); + QIcon system_icon(getPixmap("images/", "lyxfiles-system", "svgz,png")); QStringList cats; QMap::const_iterator it = files.constBegin(); QFont capfont; @@ -306,7 +306,9 @@ void GuiLyXFiles::updateContents() QString guiname = filename.left(filename.lastIndexOf(getSuffix())).replace('_', ' '); if (translateName()) guiname = toqstr(translateIfPossible(qstring_to_ucs4(guiname))); - item->setIcon(0, iconprovider.icon(info)); + QIcon file_icon = (info.filePath().startsWith(toqstr(package().user_support().absFileName()))) ? + user_icon : system_icon; + item->setIcon(0, file_icon); item->setData(0, Qt::UserRole, info.filePath()); item->setData(0, Qt::DisplayRole, guiname); item->setData(0, Qt::ToolTipRole, info.filePath()); @@ -326,6 +328,7 @@ void GuiLyXFiles::updateContents() } } else { subcatItem->setText(0, subcat); + subcatItem->setIcon(0, file_icon); cats << catsave; } subcatItem->addChild(item); -- 2.39.5