Skip to content

Commit

Permalink
Theme, preview, and eternal logos
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierkes committed Jun 18, 2015
1 parent eff0408 commit 915b9ac
Show file tree
Hide file tree
Showing 9 changed files with 911 additions and 158 deletions.
40 changes: 40 additions & 0 deletions resources/themes/gentleblues.theme
@@ -0,0 +1,40 @@
[General]
LoadColor=#a8bacc
Name="Gentle Blues"

[Background]
Color=#a8bacc
ImageFile=
Type=0

[Foreground]
Color=#a8bacc
Margin=65
Opacity=0
Padding=10
Position=1
Rounding=0
RoundingDisabled=10
Width=700

[ForegroundBlur]
Enabled=false
Radius=32

[ForegroundShadow]
Color=#000000
Enabled=false
Offset=2
Radius=8

[Spacings]
IndentFirstLine=false
LineSpacing=100
ParagraphAbove=0
ParagraphBelow=0
TabWidth=48

[Text]
Color=#2d3f56
Font="Times New Roman,12,-1,5,50,0,0,0,0,0"
Misspelled=#ff0000
39 changes: 39 additions & 0 deletions resources/themes/oldschool.theme
@@ -0,0 +1,39 @@
[General]
LoadColor=#000000

[Background]
Color=#000000
ImageFile=
Type=0

[Foreground]
Color=#000000
Margin=65
Opacity=0
Padding=10
Position=1
Rounding=0
RoundingDisabled=10
Width=700

[ForegroundBlur]
Enabled=false
Radius=32

[ForegroundShadow]
Color=#000000
Enabled=false
Offset=2
Radius=8

[Spacings]
IndentFirstLine=false
LineSpacing=100
ParagraphAbove=0
ParagraphBelow=0
TabWidth=48

[Text]
Color=#0cf155
Font="Courier New,12,-1,5,50,0,0,0,0,0"
Misspelled=#0d5322
5 changes: 5 additions & 0 deletions resources/themes/preview.txt
@@ -0,0 +1,5 @@
In the beginning was the Word, and the Word was with God, and the Word was God. He was with God in the beginning. Through him all things were made; without him nothing was made that has been made. In him was life, and that life was the light of all mankind. The light shines in the darkness, and the darkness has not overcome[a] it.
There was a man sent from God whose name was John. He came as a witness to testify concerning that light, so that through him all might believe. He himself was not the light; he came only as a witness to the light.
The true light that gives light to everyone was coming into the world. He was in the world, and though the world was made through him, the world did not recognize him. He came to that which was his own, but his own did not receive him. Yet to all who did receive him, to those who believed in his name, he gave the right to become children of God— children born not of natural descent, nor of human decision or a husband’s will, but born of God.
The Word became flesh and made his dwelling among us. We have seen his glory, the glory of the one and only Son, who came from the Father, full of grace and truth.
(John testified concerning him. He cried out, saying, “This is the one I spoke about when I said, ‘He who comes after me has surpassed me because he was before me.’”) Out of his fullness we have all received grace in place of grace already given. For the law was given through Moses; grace and truth came through Jesus Christ. No one has ever seen God, but the one and only Son, who is himself God and[b] is in closest relationship with the Father, has made him known.
39 changes: 39 additions & 0 deletions resources/themes/spacedreams.theme
@@ -0,0 +1,39 @@
[General]
LoadColor=#5d3e3d

[Background]
Color=#000000
ImageFile=spacedreams.jpg
Type=5

[Foreground]
Color=#beaf9b
Margin=65
Opacity=50
Padding=10
Position=1
Rounding=10
RoundingDisabled=0
Width=700

[ForegroundBlur]
Enabled=true
Radius=32

[ForegroundShadow]
Color=#000000
Enabled=true
Offset=2
Radius=16

[Spacings]
IndentFirstLine=false
LineSpacing=100
ParagraphAbove=0
ParagraphBelow=0
TabWidth=48

[Text]
Color=#000000
Font="Times New Roman,12,-1,5,50,0,0,0,0,0"
Misspelled=#ff0000
39 changes: 39 additions & 0 deletions resources/themes/writingdesk.theme
@@ -0,0 +1,39 @@
[General]
LoadColor=#985a20

[Background]
Color=#985a20
ImageFile=writingdesk.jpg
Type=5

[Foreground]
Color=#fffdf6
Margin=65
Opacity=100
Padding=10
Position=1
Rounding=0
RoundingDisabled=10
Width=700

[ForegroundBlur]
Enabled=false
Radius=32

[ForegroundShadow]
Color=#000000
Enabled=true
Offset=1
Radius=4

[Spacings]
IndentFirstLine=false
LineSpacing=100
ParagraphAbove=0
ParagraphBelow=0
TabWidth=48

[Text]
Color=#000000
Font="Times New Roman,12,-1,5,50,0,0,0,0,0"
Misspelled=#ff0000
38 changes: 21 additions & 17 deletions src/functions.py
Expand Up @@ -135,26 +135,30 @@ def colorifyPixmap(pixmap, color):
p.fillRect(pixmap.rect(), color)
return pixmap

def appPath():
return os.path.realpath(os.path.join(os.path.split(__file__)[0], ".."))
def appPath(suffix=None):
p = os.path.realpath(os.path.join(os.path.split(__file__)[0], ".."))
if suffix:
p = os.path.join(p, suffix)
return p

def writablePath():
return QStandardPaths.writableLocation(QStandardPaths.AppLocalDataLocation)
def writablePath(suffix=None):
p = QStandardPaths.writableLocation(QStandardPaths.AppLocalDataLocation)
if suffix:
p = os.path.join(p, suffix)
return p

def allPaths(suffix=None):
paths = []
# src directory
paths.append(appPath())
paths.append(appPath(suffix))
# user writable directory
paths.append(writablePath())

if suffix:
paths2 = []
for p in paths:
p2 = os.path.join(p, suffix)
paths2.append(p2)
if not os.path.exists(p2):
os.makedirs(p2)
paths = paths2

return paths
paths.append(writablePath(suffix))
return paths

def findBackground(filename):
paths = allPaths("resources/backgrounds")
for p in paths:
lst = os.listdir(p)
for l in lst:
if l == filename:
return os.path.join(p, l)

0 comments on commit 915b9ac

Please sign in to comment.