From 2c72884f26e12fdbe6ec236596870817563b1c66 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 9 Oct 2022 16:13:48 +0200 Subject: [PATCH] GuiLyXFiles: differentiate user and system folders --- lib/Makefile.am | 3 ++- lib/images/lyxfiles-folder.svgz | Bin 416 -> 0 bytes lib/images/lyxfiles-system-folder.svgz | Bin 0 -> 1635 bytes lib/images/lyxfiles-user-folder.svgz | Bin 0 -> 943 bytes lib/images/lyxfiles-user.svgz | Bin 477 -> 775 bytes src/frontends/qt/GuiLyXFiles.cpp | 10 ++++++---- 6 files changed, 8 insertions(+), 5 deletions(-) delete mode 100644 lib/images/lyxfiles-folder.svgz create mode 100644 lib/images/lyxfiles-system-folder.svgz create mode 100644 lib/images/lyxfiles-user-folder.svgz diff --git a/lib/Makefile.am b/lib/Makefile.am index e863f2c0ab..bff08ade78 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -628,9 +628,10 @@ dist_images_DATA1X = \ images/layout-toggle_LyX-Code.svgz \ images/layout-toggle_Section.svgz \ images/lyx.svg \ - images/lyxfiles-folder.svgz \ images/lyxfiles-system.svgz \ + images/lyxfiles-system-folder.svgz \ images/lyxfiles-user.svgz \ + images/lyxfiles-user-folder.svgz \ images/lyx-quit.svgz \ images/marginalnote-insert.svgz \ images/master-buffer-update.svgz \ diff --git a/lib/images/lyxfiles-folder.svgz b/lib/images/lyxfiles-folder.svgz deleted file mode 100644 index d3d36458df4d44cc6935c075d5e723f59bc4dcfb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 416 zcmV;R0bl+fiwFP!000000DY57Zi6rohW9ze$Xy$3{0LMbmAdE&+5<#|U?c)jK@j!y zow13-qKZJ+p85Z8{NnI-yL2$uKVv)eC6kF@Q1{7))e)D*=a~U+s6xt66!ovwfRbY6+lXKViJC-*1%g}W^?*0JH K^*zbz_`q*xp!)!#A8Wr_n(JZ%z^=$Od_rJ?9 zD%#Whu$=FjLp>WEn$effA8y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index 0000000000000000000000000000000000000000..67e1d7679dc7c2e384c9c08d00a6893dc932925f GIT binary patch literal 943 zcmV;g15o@QiwFP!000000F_ovlcP2ez0a>uv6rOEk|iM_;jw2csjb{{+sz?2#>hYo zMlN9d_3P6TATyu4F&+cmuitBRH)7Ub&-)r3P1{wr*+h)c2$^PU^QtK}(U0$cVI85a z&zd}|ZDTf3W23JRckAw0+#!TYQx#&tmp)uzMGooVsT*12g3;IBh)^VDs#gIUdJIbrCx zberUY8NuiRamqQS3N!J$4}x_!-D(QmL}lL}R?Fq-bRv_H*tS@@1iC}EHQjQu&*G<4 zL;PeQoqcY%W(O38G^SsE`~EFBF(rAQ-)LT_pJK1eDWywT;#}-le2RPk=sFb7C7!!} zID(K zPJ;jT2JUuZ^dwffeF$yg3ygA;N<~b^HP3{LU&z*X3i^K08S|!U z>`ltgZEKny*V)Ciuz)5?iinZ#o&Mku7=`r6N`B2y#p81P1j#)cyJtU z^+hOm+`Ah*wsyt*L;~X>>&qbqAz;`eh6FmoZ;3RVF+*3hhYe#|fSvaN;>`LU=AR zd`tKtQp+^fsCEEF6&;}C6=X^Y(@M_ILNGxScg0hlIzk#EgKa1y2aTCT;GGGKyx}ym z2cp0oEG4we#mR(AS0)z(&k$TNSopAR=S{{eM<-^!&Da+Yhj7dWOe|C3ZyX68IuK9; zhiCX?M8y9ek@d3hr`w!_dBf9mzc>CCUNF1bZE44;XaK_j%(G)?3JTEbNfi4G-2bP*FFA@h`ffbz!z-(XktH^@*9o0gD^l*Bw0 zTubx^;zU8br0IgYX^5#9;{^e))5VPuI8h$qYO2irw$C7G4^w2L4yM|JfX@ R-AnV~?mty8qD=z{000ct%^&~( literal 0 HcmV?d00001 diff --git a/lib/images/lyxfiles-user.svgz b/lib/images/lyxfiles-user.svgz index 6e21ca72bb0eba4ff4d3b844e09e16a2a402be96..7e9b246a85234a9e4aee8db1a0894b216e91ba21 100644 GIT binary patch literal 775 zcmV+i1Ni(OiwFP!000000F6~kkJ}&+zVEL<-b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#(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 diff --git a/src/frontends/qt/GuiLyXFiles.cpp b/src/frontends/qt/GuiLyXFiles.cpp index c9ab003dad..2c97f2baa2 100644 --- a/src/frontends/qt/GuiLyXFiles.cpp +++ b/src/frontends/qt/GuiLyXFiles.cpp @@ -417,7 +417,8 @@ void GuiLyXFiles::updateContents() filesLW->clear(); QIcon user_icon(getPixmap("images/", "lyxfiles-user", "svgz,png")); QIcon system_icon(getPixmap("images/", "lyxfiles-system", "svgz,png")); - QIcon folder_icon(getPixmap("images/", "lyxfiles-folder", "svgz,png")); + QIcon user_folder_icon(getPixmap("images/", "lyxfiles-user-folder", "svgz,png")); + QIcon system_folder_icon(getPixmap("images/", "lyxfiles-system-folder", "svgz,png")); QStringList cats; QMap::const_iterator it = files.constBegin(); QFont capfont; @@ -453,8 +454,8 @@ void GuiLyXFiles::updateContents() guiname = qt_("Default Template"); else if (translateName()) guiname = toqstr(translateIfPossible(qstring_to_ucs4(guiString(guiname)))); - QIcon file_icon = (realpath.startsWith(toqstr(package().user_support().absFileName()))) ? - user_icon : system_icon; + bool const user = realpath.startsWith(toqstr(package().user_support().absFileName())); + QIcon file_icon = user ? user_icon : system_icon; item->setIcon(0, file_icon); item->setData(0, Qt::UserRole, it.key()); item->setData(0, Qt::DisplayRole, guiname); @@ -477,7 +478,8 @@ void GuiLyXFiles::updateContents() if (!subcatItem) { subcatItem = new QTreeWidgetItem(); subcatItem->setText(0, subcat); - subcatItem->setIcon(0, folder_icon); + file_icon = user ? user_folder_icon : system_folder_icon; + subcatItem->setIcon(0, file_icon); cats << catsave; } subcatItem->addChild(item);