Break off css into separate file

This commit is contained in:
Kurt Kremitzki
2017-02-24 14:35:50 -06:00
committed by Yorik van Havre
parent 9b9ff54616
commit 970679b9cd
3 changed files with 193 additions and 189 deletions

View File

@@ -37,6 +37,7 @@ if(BUILD_GUI)
Ship.py
images/Ship.png
images/ShipExample.png
StartPage.css
)
add_subdirectory(Gui)

View File

@@ -0,0 +1,116 @@
body {
background: #basecolor;
color: #textcolor;
font-family: Arial, Helvetica, Sans;
font-size: 11px;
}
a {
color: #linkcolor;
font-weight: bold;
text-decoration: none;
padding: 2px;
}
a:hover {
color: white;
background: #linkcolor;
border-radius: 5px;
}
p {
text-align: justify;
}
.left {
text-align: left;
}
h1 {
font-size: 3em;
letter-spacing: 2px;
padding: 20px 0 0 80px;
align: bottom;
color: #ffffff;
}
h2 {
font-size: 1.2em;
}
ul {
list-style-type: none;
padding: 0;
}
#column {
margin: 0 350px 0 10px;
}
#column img {
max-width: 14px;
}
.block {
background: #windowcolor;
border-radius: 5px;
padding: 8px;
margin-bottom: 10px;
color: #windowtextcolor;
width: auto;
}
.options {
clear: both;
}
.from {
font-size: 0.7em;
font-weight: normal;
}
#versionbox {
float: right;
text-align: right;
font-size: 0.33em;
font-weight: normal;
padding-right: 20px;
letter-spacing: 0;
color: #ffffff;
}
#description {
background: #windowcolor;
border-radius: 5px;
padding: 8px;
color: #windowtextcolor;
float: right;
width: 316px;
right: 10px;
height: 100%;
position: relative;
}
#description img {
max-width: 300px;
clear: both;
}
#description p span {
text-align: left;
}
.disabled {
opacity: 0.5;
}
pre {
width: 300px !important;
white-space: pre-wrap;
}
.stick {
position: fixed !important;
top: 0px;
right: 18px !important;
}

View File

@@ -67,84 +67,89 @@ def translate(context,text):
# texts to be translated
text01 = translate("StartPage","FreeCAD Start Center")
text02 = translate("StartPage","Start a new project")
text03 = translate("StartPage","Recent Files")
text04 = translate("StartPage","Latest videos")
text05 = translate("StartPage","Latest commits")
text06 = translate("StartPage","On the web")
text07 = translate("StartPage","This is the FreeCAD Homepage. Here you will be able to find a lot of information about FreeCAD, including tutorials, examples and user documentation.")
text08 = translate("StartPage","FreeCAD Homepage")
text09 = translate("StartPage","Example projects")
text10 = translate("StartPage","Schenkel STEP file")
text11 = translate("StartPage","Load a PartDesign example")
text12 = translate("StartPage","Load a Drawing extraction")
text13 = translate("StartPage","Load a Robot simulation example")
text14 = translate("StartPage","Projects from the Web")
text15 = translate("StartPage","Schenkel STEP")
text16 = translate("StartPage","Complex Part")
text17 = translate("StartPage","Close this window after opening or creating a file")
text18 = translate("StartPage","Don't show me this window again next time")
text19 = translate("StartPage","Designing parts")
text20 = translate("StartPage","The <b>Part Design</b> workbench is designed to create complex pieces based on constrained 2D sketches. Use it to draw 2D shapes, constrain some of their elements and extrude them to form 3D pieces.")
text21 = translate("StartPage","Example workflow")
text22 = translate("StartPage","Part Design")
text23 = translate("StartPage","Designing architectural elements")
text24 = translate("StartPage","The <b>Architectural Design</b> workbench is specially designed for working with architectural elements such as walls or windows. Start by drawing 2D shapes, and use them as guides to build architecutral objects.")
text25 = translate("StartPage","Architectural Design")
text26 = translate("StartPage","Working with Meshes")
text27 = translate("StartPage","The <b>Mesh Workbench</b> is used to work with Mesh objects. Meshes are simpler 3D objects than Part objects, but they are often easier to import and export to/from other applications.")
text28 = translate("StartPage","FreeCAD offers you several tools to convert between Mesh and Part objects.")
text29 = translate("StartPage","Work with Meshes")
text30 = translate("StartPage","The complete workbench")
text31 = translate("StartPage","FreeCAD Complete workbench")
text32 = translate("StartPage","populated with some of the most commonly used tools.")
text33 = translate("StartPage","file size:")
text34 = translate("StartPage","creation time:")
text35 = translate("StartPage","last modified:")
text36 = translate("StartPage","location:")
text37 = translate("StartPage","User manual")
text38 = translate("StartPage","http://www.freecadweb.org/wiki/Online_Help_Toc")
text39 = translate("StartPage","Tutorials")
text40 = translate("StartPage","Python resources")
text41 = translate("StartPage","File not found")
text42 = translate("StartPage","from <a href=http://twitter.com/FreeCADNews>@FreeCADNews</a>")
text43 = translate("StartPage","The FreeCAD-tutorial blog")
text44 = translate("StartPage","from <a href=http://www.youtube.com/user/FreeCADNews?feature=mhee>FreeCADNews channel</a>")
text45 = translate("StartPage","This is the official user manual of FreeCAD, built, maintained and translated by the FreeCAD community.")
text46 = translate("StartPage","The tutorials section on the FreeCAD website")
text47 = translate("StartPage","The section of the FreeCAD website dedicated to python scripting, with examples, explanations, and API commands.")
text48 = translate("StartPage","A blog dedicated to teaching FreeCAD, maintained by members of the FreeCAD community")
text49 = translate("StartPage","Getting started")
text50 = translate("StartPage","The FreeCAD interface is divided in workbenches, which are sets of tools suited for a specific task. You can start with one of the workbenches in this list, or with the complete workbench, which presents you with some of the most used tools gathered from other workbenches. Click to read more about workbenches on the FreeCAD website.")
text51 = translate("StartPage","http://www.freecadweb.org/wiki/Workbenches")
text52 = translate("StartPage","Ship Design")
text53 = translate("StartPage","Designing and calculating ships")
text54 = translate("StartPage","The <b>Ship Design</b> module offers several tools to help ship designers to view, model and calculate profiles and other specific properties of ship hulls.")
text55 = translate("StartPage","Load an Architectural example model")
text56 = translate("StartPage","http://www.freecadweb.org/wiki/Tutorials")
text57 = translate("StartPage","http://www.freecadweb.org/wiki/Power_users_hub")
text58 = translate("StartPage","Your version of FreeCAD is up to date.")
text59 = translate("StartPage","There is a new release of FreeCAD available.")
text60 = translate("StartPage","Load an FEM 3D example analysis")
text61 = translate("StartPage","Obtain a development version")
text62 = translate("StartPage","<b>Development versions</b> are made available by community members from time to time and usually contain the latest changes, but are more likely to contain bugs.")
text63 = translate("StartPage","See all commits")
text64 = translate("StartPage","Load an FEM 2D example analysis")
text65 = translate("StartPage","FreeCAD Standard File")
text66 = translate("StartPage","Author")
text67 = translate("StartPage","Company")
text68 = translate("StartPage","License")
text01 = translate("StartPage", "FreeCAD Start Center")
text02 = translate("StartPage", "Start a new project")
text03 = translate("StartPage", "Recent Files")
text04 = translate("StartPage", "Latest videos")
text05 = translate("StartPage", "Latest commits")
text06 = translate("StartPage", "On the web")
text07 = translate("StartPage", "This is the FreeCAD Homepage. Here you will be able to find a lot of information about FreeCAD, including tutorials, examples and user documentation.")
text08 = translate("StartPage", "FreeCAD Homepage")
text09 = translate("StartPage", "Example projects")
text10 = translate("StartPage", "Schenkel STEP file")
text11 = translate("StartPage", "Load a PartDesign example")
text12 = translate("StartPage", "Load a Drawing extraction")
text13 = translate("StartPage", "Load a Robot simulation example")
text14 = translate("StartPage", "Projects from the Web")
text15 = translate("StartPage", "Schenkel STEP")
text16 = translate("StartPage", "Complex Part")
text17 = translate("StartPage", "Close this window after opening or creating a file")
text18 = translate("StartPage", "Don't show me this window again next time")
text19 = translate("StartPage", "Designing parts")
text20 = translate("StartPage", "The <b>Part Design</b> workbench is designed to create complex pieces based on constrained 2D sketches. Use it to draw 2D shapes, constrain some of their elements and extrude them to form 3D pieces.")
text21 = translate("StartPage", "Example workflow")
text22 = translate("StartPage", "Part Design")
text23 = translate("StartPage", "Designing architectural elements")
text24 = translate("StartPage", "The <b>Architectural Design</b> workbench is specially designed for working with architectural elements such as walls or windows. Start by drawing 2D shapes, and use them as guides to build architecutral objects.")
text25 = translate("StartPage", "Architectural Design")
text26 = translate("StartPage", "Working with Meshes")
text27 = translate("StartPage", "The <b>Mesh Workbench</b> is used to work with Mesh objects. Meshes are simpler 3D objects than Part objects, but they are often easier to import and export to/from other applications.")
text28 = translate("StartPage", "FreeCAD offers you several tools to convert between Mesh and Part objects.")
text29 = translate("StartPage", "Work with Meshes")
text30 = translate("StartPage", "The complete workbench")
text31 = translate("StartPage", "FreeCAD Complete workbench")
text32 = translate("StartPage", "populated with some of the most commonly used tools.")
text33 = translate("StartPage", "file size:")
text34 = translate("StartPage", "creation time:")
text35 = translate("StartPage", "last modified:")
text36 = translate("StartPage", "location:")
text37 = translate("StartPage", "User manual")
text38 = translate("StartPage", "http://www.freecadweb.org/wiki/Online_Help_Toc")
text39 = translate("StartPage", "Tutorials")
text40 = translate("StartPage", "Python resources")
text41 = translate("StartPage", "File not found")
text42 = translate("StartPage", "from <a href=http://twitter.com/FreeCADNews>@FreeCADNews</a>")
text43 = translate("StartPage", "The FreeCAD-tutorial blog")
text44 = translate("StartPage", "from <a href=http://www.youtube.com/user/FreeCADNews?feature=mhee>FreeCADNews channel</a>")
text45 = translate("StartPage", "This is the official user manual of FreeCAD, built, maintained and translated by the FreeCAD community.")
text46 = translate("StartPage", "The tutorials section on the FreeCAD website")
text47 = translate("StartPage", "The section of the FreeCAD website dedicated to python scripting, with examples, explanations, and API commands.")
text48 = translate("StartPage", "A blog dedicated to teaching FreeCAD, maintained by members of the FreeCAD community")
text49 = translate("StartPage", "Getting started")
text50 = translate("StartPage", "The FreeCAD interface is divided in workbenches, which are sets of tools suited for a specific task. You can start with one of the workbenches in this list, or with the complete workbench, which presents you with some of the most used tools gathered from other workbenches. Click to read more about workbenches on the FreeCAD website.")
text51 = translate("StartPage", "http://www.freecadweb.org/wiki/Workbenches")
text52 = translate("StartPage", "Ship Design")
text53 = translate("StartPage", "Designing and calculating ships")
text54 = translate("StartPage", "The <b>Ship Design</b> module offers several tools to help ship designers to view, model and calculate profiles and other specific properties of ship hulls.")
text55 = translate("StartPage", "Load an Architectural example model")
text56 = translate("StartPage", "http://www.freecadweb.org/wiki/Tutorials")
text57 = translate("StartPage", "http://www.freecadweb.org/wiki/Power_users_hub")
text58 = translate("StartPage", "Your version of FreeCAD is up to date.")
text59 = translate("StartPage", "There is a new release of FreeCAD available.")
text60 = translate("StartPage", "Load an FEM 3D example analysis")
text61 = translate("StartPage", "Obtain a development version")
text62 = translate("StartPage", "<b>Development versions</b> are made available by community members from time to time and usually contain the latest changes, but are more likely to contain bugs.")
text63 = translate("StartPage", "See all commits")
text64 = translate("StartPage", "Load an FEM 2D example analysis")
text65 = translate("StartPage", "FreeCAD Standard File")
text66 = translate("StartPage", "Author")
text67 = translate("StartPage", "Company")
text68 = translate("StartPage", "License")
# get FreeCAD version
v = FreeCAD.Version()
vmajor = v[0]
vminor = v[1]
vmajor, vminor = v[0], v[1]
vbuild = v[2].split(" ")[0]
# here is the html page skeleton
css_filename = os.path.join(FreeCAD.getResourceDir(),
"Mod", "Start", "StartPage", "StartPage.css")
with open(css_filename, 'r') as f:
startpage_css = f.read()
page = """
<html>
<head>
@@ -277,125 +282,7 @@ page = """
</script>
<style type="text/css">
body {
background: #basecolor;
color: #textcolor;
font-family: Arial, Helvetica, Sans;
font-size: 11px;
}
a {
color: #linkcolor;
font-weight: bold;
text-decoration: none;
padding: 2px;
}
a:hover {
color: white;
background: #linkcolor;
border-radius: 5px;
}
p {
text-align: justify;
}
.left {
text-align: left;
}
h1 {
font-size: 3em;
letter-spacing: 2px;
padding: 20px 0 0 80px;
align: bottom;
color: #ffffff;
}
h2 {
font-size: 1.2em;
}
ul {
list-style-type: none;
padding: 0;
}
#column {
margin: 0 350px 0 10px;
}
#column img {
max-width: 14px;
}
.block {
background: #windowcolor;
border-radius: 5px;
padding: 8px;
margin-bottom: 10px;
color: #windowtextcolor;
width: auto;
}
.options {
clear: both;
}
.from {
font-size: 0.7em;
font-weight: normal;
}
#versionbox {
float: right;
text-align: right;
font-size: 0.33em;
font-weight: normal;
padding-right: 20px;
letter-spacing: 0;
color: #ffffff;
}
#description {
background: #windowcolor;
border-radius: 5px;
padding: 8px;
color: #windowtextcolor;
float: right;
width: 316px;
right: 10px;
height: 100%;
position: relative;
}
#description img {
max-width: 300px;
clear: both;
}
#description p span {
text-align: left;
}
.disabled {
opacity: 0.5;
}
pre {
width: 300px !important;
white-space: pre-wrap;
}
.stick {
position: fixed !important;
top: 0px;
right: 18px !important;
}
<style type="text/css">""" + startpage_css + """
</style>
</head>