Skip to content
Extraits de code Groupes Projets
Vérifiée Valider b8bae846 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

UI: Add the lua icon for scripts

parent 6f7e1179
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!9Lua cpp expose
......@@ -2,7 +2,9 @@
-->
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<!-- Uni-theme icons -->
<file>icons/vivy.png</file>
<file>icons/lua.png</file>
<!-- Fonts, FiraCode is OFL-1.1, NotoSans is APACHE-2.0 -->
<file>fonts/FiraCode-Regular.ttf</file>
......
rsc/icons/lua.png

9,12 ko

......@@ -45,7 +45,7 @@ ScriptDocumentView::getDocumentTabToolTip() const noexcept
QIcon
ScriptDocumentView::getDocumentTabIcon() const noexcept
{
return QIcon(VIVY_ICON_FILE);
return QIcon(VIVY_ICON_SCRIPT);
}
void
......
......@@ -6,13 +6,21 @@ using namespace Vivy;
QIcon
VivyFileIconProvider::icon(const QFileInfo &info) const noexcept
{
if (const auto name = info.fileName(); name.isEmpty() || name.isNull())
const QString name = info.fileName();
Utils::DocumentType type;
if (name.isEmpty() || name.isNull())
return defaultFile;
// TODO: For file detection use functions in Utils.hh
else if (info.isDir())
return defaultFolder;
else if (const auto suffix = info.suffix(); suffix == "vivy" || suffix == "ass")
else if (Utils::detectDocumentType(info, &type)) {
if (type == Utils::DocumentType::Vivy)
return vivyFile;
else
else if (type == Utils::DocumentType::VivyScript)
return vivyScript;
}
return defaultFile;
}
......@@ -21,6 +21,7 @@ public:
private:
QIcon defaultFile{ VIVY_ICON_FILE };
QIcon vivyScript{ VIVY_ICON_SCRIPT };
QIcon vivyFile{ VIVY_ICON_APP };
QIcon defaultFolder{ VIVY_ICON_FOLDER };
};
......
......@@ -8,6 +8,7 @@
// Only support dark theme for now
#define VIVY_ICON_APP ":icons/vivy.png"
#define VIVY_ICON_SCRIPT ":icons/lua.png"
#define VIVY_ICON_OPEN ":icons/dark/document-open.svg"
#define VIVY_ICON_NEW ":icons/dark/document-new.svg"
#define VIVY_ICON_SAVE ":icons/dark/document-save.svg"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter