Эх сурвалжийг харах

Fixed mobile interface desktop theme issue

TC pushbot 5 4 жил өмнө
parent
commit
065dd61792

+ 1 - 1
web/SystemAO/file_system/file_explorer.html

@@ -1561,7 +1561,7 @@
                        
                         $("#folderList").append(`<div class="fileObject item ${currentTheme}" draggable="true" ondragstart="onFileObjectDragStart(this,event);" ondrop="dropToFolder(event)" ondragover="allowDrop(event)" fileID="${i}" filename="${filename}" filepath="${filepath}" ondblclick="openthis(this,event);" type="folder">
                             <span style="display:inline-block !important;word-break: break-all;" class="${textclass}">
-                                <i class="${icon} icon" style="margin-right:12px; color:#9c9ee4;"></i>  ${displayName} ${shareicon}
+                                <i class="${icon} icon" style="margin-right:12px; color:#eab54e;"></i>  ${displayName} ${shareicon}
                             </span></div>`);
                     }else if (viewMode == "grid"){
                         var displayName = JSON.parse(JSON.stringify(filename));

+ 18 - 4
web/mobile.system

@@ -303,11 +303,25 @@
 
             function changeDesktopTheme(themename){
                 //Match the given theme to the themename
-                for (var i =0; i < desktopThemeList.length ; i++){
-                    if (desktopThemeList[i].Theme == themename){
-                        var targetImage = desktopThemeList[i].Bglist[0];
-                        $("#backdrop").css("background-image", `url(img/desktop/bg/${themename}/${targetImage})`)
+                if (themename.includes(":/") == false){
+                    //This is a path
+                    for (var i =0; i < desktopThemeList.length ; i++){
+                        if (desktopThemeList[i].Theme == themename){
+                            var targetImage = desktopThemeList[i].Bglist[0];
+                            $("#backdrop").css("background-image", `url(img/desktop/bg/${themename}/${targetImage})`)
+                        }
                     }
+                }else{
+                    //This is a path (user defined background folder)
+                    $.get("system/desktop/theme?load=" + themename, function(data){
+                        if (data.error !== undefined){
+                            //The folder is gone. Use default instead
+                            console.log(data.error);
+                            changeDesktopTheme("default");
+                        }else{
+                            $("#backdrop").css("background-image", `url(media/?file=${data[0]})`)
+                        }
+                    });
                 }
             }