1) replaced link element before li item in order to make the whole box clickable
2) placed "New file" item as first one so that it is always at the same place no matter what session or recent files you have
3) created a thumbnail for "New file" item
This commit is contained in:
Pablo Gil
2018-09-04 23:54:04 +02:00
committed by wmayer
parent 42a63668ef
commit c31dae7c9a
2 changed files with 246 additions and 12 deletions

View File

@@ -71,7 +71,7 @@ def getInfo(filename):
"returns available file information"
global iconbank,tempfolder
tformat = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Start").GetString("TimeFormat","%m/%d/%Y %H:%M:%S")
def getLocalTime(timestamp):
@@ -89,7 +89,7 @@ def getInfo(filename):
return hsize
if os.path.exists(filename):
if os.path.isdir(filename):
return None
@@ -156,7 +156,7 @@ def getInfo(filename):
def buildCard(filename,method,arg=None):
"builds a html <li> element representing a file. method is a script + a keyword, for ex. url.py?key="
result = ""
@@ -174,16 +174,16 @@ def buildCard(filename,method,arg=None):
if finfo[5]:
infostring += "\n\n" + finfo[5]
if size:
result += '<li class="icon">'
result += '<a href="'+method+arg+'" title="'+infostring+'">'
result += '<li class="icon">'
result += '<img src="'+image+'">'
result += '<div class="caption">'
result += '<h4>'+basename+'</h4>'
result += '<p>'+size+'</p>'
result += '<p>'+author+'</p>'
result += '</div>'
result += '</a>'
result += '</li>'
result += '</a>'
return result
@@ -302,17 +302,17 @@ def handle():
if rfcount:
SECTION_RECENTFILES = "<h2>"+TranslationTexts.T_RECENTFILES+"</h2>"
SECTION_RECENTFILES += "<ul>"
for i in range(rfcount):
filename = rf.GetString("MRU%d" % (i))
SECTION_RECENTFILES += buildCard(filename,method="LoadMRU.py?MRU=",arg=str(i))
SECTION_RECENTFILES += '<li class="icon">'
SECTION_RECENTFILES += '<a href="LoadNew.py" title="'+TranslationTexts.T_CREATENEW+'">'
SECTION_RECENTFILES += '<img src="'+iconbank["createimg"]+'">'
SECTION_RECENTFILES += '<li class="icon">'
SECTION_RECENTFILES += '<img src="images/new_file_thumbnail.svg">'
SECTION_RECENTFILES += '<div class="caption">'
SECTION_RECENTFILES += '<h4>'+TranslationTexts.T_CREATENEW+'</h4>'
SECTION_RECENTFILES += '</div>'
SECTION_RECENTFILES += '</li>'
SECTION_RECENTFILES += '</a>'
for i in range(rfcount):
filename = rf.GetString("MRU%d" % (i))
SECTION_RECENTFILES += buildCard(filename,method="LoadMRU.py?MRU=",arg=str(i))
SECTION_RECENTFILES += '</ul>'
if sys.version_info.major < 3:
SECTION_RECENTFILES = SECTION_RECENTFILES.decode("utf8")
@@ -392,7 +392,7 @@ def handle():
UL_WORKBENCHES += '</li>'
UL_WORKBENCHES += '</ul>'
HTML = HTML.replace("UL_WORKBENCHES",UL_WORKBENCHES)
# Detect additional addons that are not a workbench
try:
@@ -521,4 +521,3 @@ def checkPostOpenStartPage():
if len(sys.argv) > 1:
postStart()
Start.CanOpenStartPage = True

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.3 KiB