aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextTheme.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2007-12-28 04:39:31 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2007-12-28 04:39:31 (GMT)
commit00ceefd8846bda6f4dc43a5a990086545ea28727 (patch)
treea87c37dbb853e3604b52198e6a64e8d45711fb27 /src/FbTk/TextTheme.cc
parentb5c354b994bc06667abe35e2d528c0f025703c4e (diff)
downloadfluxbox-00ceefd8846bda6f4dc43a5a990086545ea28727.zip
fluxbox-00ceefd8846bda6f4dc43a5a990086545ea28727.tar.bz2
moved BorderTheme and TextTheme to FbTk
Diffstat (limited to 'src/FbTk/TextTheme.cc')
-rw-r--r--src/FbTk/TextTheme.cc48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/FbTk/TextTheme.cc b/src/FbTk/TextTheme.cc
new file mode 100644
index 0000000..848ee01
--- /dev/null
+++ b/src/FbTk/TextTheme.cc
@@ -0,0 +1,48 @@
1// TextTheme.cc
2// Copyright (c) 2003 - 2006 Henrik Kinnunen (fluxgen at fluxbox dot org)
3// and Simon Bowden (rathnor at users.sourceforge.net)
4//
5// Permission is hereby granted, free of charge, to any person obtaining a
6// copy of this software and associated documentation files (the "Software"),
7// to deal in the Software without restriction, including without limitation
8// the rights to use, copy, modify, merge, publish, distribute, sublicense,
9// and/or sell copies of the Software, and to permit persons to whom the
10// Software is furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE.
22
23#include "TextTheme.hh"
24
25#include "App.hh"
26
27#include <X11/Xlib.h>
28
29namespace FbTk {
30
31TextTheme::TextTheme(Theme &theme,
32 const std::string &name, const std::string &altname):
33 m_font(theme, name + ".font", altname + ".Font"),
34 m_text_color(theme, name + ".textColor", altname + ".TextColor"),
35 m_justify(theme, name + ".justify", altname + ".Justify"),
36 m_text_gc(RootWindow(App::instance()->display(), theme.screenNum())) {
37 *m_justify = LEFT;
38 // set default values
39 m_text_color->setFromString("white", theme.screenNum());
40
41 update();
42}
43
44void TextTheme::update() {
45 m_text_gc.setForeground(*m_text_color);
46}
47
48}; // end namespace FbTk