aboutsummaryrefslogtreecommitdiff
path: root/src/RootTheme.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-01-20 18:26:55 (GMT)
committermarkt <markt>2007-01-20 18:26:55 (GMT)
commit832dba7d16b77f786b34347cf5dd6c36bd69f586 (patch)
tree36db5da8df26bc8d58253a9c852e8146e0434079 /src/RootTheme.cc
parent9de41b30be9af1266860f6e3c76c4e85bfb9abc8 (diff)
downloadfluxbox-832dba7d16b77f786b34347cf5dd6c36bd69f586.zip
fluxbox-832dba7d16b77f786b34347cf5dd6c36bd69f586.tar.bz2
let styles override rootCommand in init, plus removing some code I accidentally left in
Diffstat (limited to 'src/RootTheme.cc')
-rw-r--r--src/RootTheme.cc33
1 files changed, 2 insertions, 31 deletions
diff --git a/src/RootTheme.cc b/src/RootTheme.cc
index eeb95f9..98d9067 100644
--- a/src/RootTheme.cc
+++ b/src/RootTheme.cc
@@ -85,29 +85,11 @@ public:
85 (mod_y.length() == 2 && (mod_y[1] < '0' || mod_y[1] > '9'))) 85 (mod_y.length() == 2 && (mod_y[1] < '0' || mod_y[1] > '9')))
86 mod_y = "1"; 86 mod_y = "1";
87 87
88 // check if any of our values have changed
89 if (mod_x != m_mod_x) {
90 m_changed = true;
91 m_mod_x = mod_x;
92 }
93 if (mod_y != m_mod_y) {
94 m_changed = true;
95 m_mod_y = mod_y;
96 }
97 // these aren't quite right, but I don't care
98 if (color_name != m_color) {
99 m_changed = true;
100 m_color = color_name;
101 }
102 if (colorto_name != m_color_to) {
103 m_changed = true;
104 m_color_to = colorto_name;
105 }
106
107 // remove whitespace from filename 88 // remove whitespace from filename
108 FbTk::StringUtil::removeFirstWhitespace(pixmap_name); 89 FbTk::StringUtil::removeFirstWhitespace(pixmap_name);
109 FbTk::StringUtil::removeTrailingWhitespace(pixmap_name); 90 FbTk::StringUtil::removeTrailingWhitespace(pixmap_name);
110 91
92 // check if the background has been changed
111 if (mod_x != m_mod_x || mod_y != m_mod_y || pixmap_name != m_filename || 93 if (mod_x != m_mod_x || mod_y != m_mod_y || pixmap_name != m_filename ||
112 color_name != m_color || colorto_name != m_color_to) { 94 color_name != m_color || colorto_name != m_color_to) {
113 m_changed = true; 95 m_changed = true;
@@ -159,12 +141,10 @@ private:
159}; 141};
160 142
161 143
162RootTheme::RootTheme(const std::string &root_command, 144RootTheme::RootTheme(FbTk::ImageControl &image_control):
163 FbTk::ImageControl &image_control):
164 FbTk::Theme(image_control.screenNumber()), 145 FbTk::Theme(image_control.screenNumber()),
165 m_background(new BackgroundItem(*this, "background", "Background")), 146 m_background(new BackgroundItem(*this, "background", "Background")),
166 m_opgc(RootWindow(FbTk::App::instance()->display(), image_control.screenNumber())), 147 m_opgc(RootWindow(FbTk::App::instance()->display(), image_control.screenNumber())),
167 m_root_command(root_command),
168 m_image_ctrl(image_control) { 148 m_image_ctrl(image_control) {
169 149
170 Display *disp = FbTk::App::instance()->display(); 150 Display *disp = FbTk::App::instance()->display();
@@ -207,19 +187,10 @@ void RootTheme::reconfigTheme() {
207 187
208 m_background->setApplied(); 188 m_background->setApplied();
209 189
210 // if user specified background in the config then use it
211 // instead of style background
212 if (!m_root_command.empty()) {
213 FbCommands::ExecuteCmd cmd(m_root_command, screenNum());
214 cmd.execute();
215 return;
216 }
217
218 // style doesn't wish to change the background 190 // style doesn't wish to change the background
219 if (strstr(m_background->options().c_str(), "none") != 0) 191 if (strstr(m_background->options().c_str(), "none") != 0)
220 return; 192 return;
221 193
222
223 // 194 //
224 // Else parse background from style 195 // Else parse background from style
225 // 196 //