Skip to content

Commit

Permalink
Client: Added the default UI style package
Browse files Browse the repository at this point in the history
Ultimately "defaultstyle.pack" will contain all the elements of the UI
style, including images.
  • Loading branch information
skyjake committed May 12, 2013
1 parent 7281fcd commit 8b76925
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
6 changes: 6 additions & 0 deletions doomsday/build/scripts/packres.py
Expand Up @@ -72,6 +72,12 @@ def process_dir(path, dest_path):
('client/data', 'data') ] )
p.create('doomsday.pk3')

# defaultstyle.pack
p = Pack()
p.add_files(
[ ('client/data/defaultstyle.pack', '') ] )
p.create('defaultstyle.pack')

# libdoom.pk3
p = Pack()
p.add_files(
Expand Down
4 changes: 4 additions & 0 deletions doomsday/client/data/defaultstyle.pack/Info
@@ -0,0 +1,4 @@
# Default UI style for Doomsday.

name: Doomsday Default UI Style
labels: style
23 changes: 23 additions & 0 deletions doomsday/client/data/defaultstyle.pack/fonts.dei
@@ -0,0 +1,23 @@
# Fonts for the default UI style
#
# - size can be "pt" or "px", defaults to "pt"
# - weight: normal bold light
# - style: normal italic

script { import Version, gui }

group font {
condition: Version.OS == 'macx'

font default {
family: Lucida Grande
size: 16pt
weight: normal
style: normal
}
}

font "font.title" inherits font.default {
size $: gui.scale(__this__.size, 1.5)
weight: bold
}
8 changes: 7 additions & 1 deletion doomsday/client/src/ui/windowsystem.cpp
Expand Up @@ -21,6 +21,8 @@
#include "ui/clientwindow.h"
#include "clientapp.h"

#include <de/FontBank>

#include <QMap>

using namespace de;
Expand All @@ -30,8 +32,12 @@ DENG2_PIMPL(WindowSystem)
typedef QMap<String, ClientWindow *> Windows;
Windows windows;

FontBank fonts;

Instance(Public *i) : Base(i)
{}
{
fonts.readInfo(App::fileSystem().find("defaultstyle.pack/fonts.dei"));
}

~Instance()
{
Expand Down

0 comments on commit 8b76925

Please sign in to comment.