diff options
author | rathnor <rathnor> | 2003-04-16 16:18:06 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2003-04-16 16:18:06 (GMT) |
commit | e48f7836fdaca03e0626b3e7ac4d37c99dd35dc9 (patch) | |
tree | dd5421ed6b26c0d882dd34a91dfc01eb1ae3ee85 /src/Screen.cc | |
parent | 9163668e98e1683b95fb5cc44c19b3695c7857c4 (diff) | |
download | fluxbox-e48f7836fdaca03e0626b3e7ac4d37c99dd35dc9.zip fluxbox-e48f7836fdaca03e0626b3e7ac4d37c99dd35dc9.tar.bz2 |
fix saving of various slit params (Simon)
Diffstat (limited to 'src/Screen.cc')
-rw-r--r-- | src/Screen.cc | 91 |
1 files changed, 89 insertions, 2 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index c25de83..196170e 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.cc,v 1.125 2003/04/16 14:43:01 rathnor Exp $ | 25 | // $Id: Screen.cc,v 1.126 2003/04/16 16:17:56 rathnor Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -193,6 +193,29 @@ setFromString(const char *strval) { | |||
193 | } | 193 | } |
194 | 194 | ||
195 | template<> | 195 | template<> |
196 | void Resource<Slit::Placement>:: | ||
197 | setFromString(const char *strval) { | ||
198 | if (strcasecmp(strval, "TopLeft")==0) | ||
199 | m_value = Slit::TOPLEFT; | ||
200 | else if (strcasecmp(strval, "CenterLeft")==0) | ||
201 | m_value = Slit::CENTERLEFT; | ||
202 | else if (strcasecmp(strval, "BottomLeft")==0) | ||
203 | m_value = Slit::BOTTOMLEFT; | ||
204 | else if (strcasecmp(strval, "TopCenter")==0) | ||
205 | m_value = Slit::TOPCENTER; | ||
206 | else if (strcasecmp(strval, "BottomCenter")==0) | ||
207 | m_value = Slit::BOTTOMCENTER; | ||
208 | else if (strcasecmp(strval, "TopRight")==0) | ||
209 | m_value = Slit::TOPRIGHT; | ||
210 | else if (strcasecmp(strval, "CenterRight")==0) | ||
211 | m_value = Slit::CENTERRIGHT; | ||
212 | else if (strcasecmp(strval, "BottomRight")==0) | ||
213 | m_value = Slit::BOTTOMRIGHT; | ||
214 | else | ||
215 | setDefaultValue(); | ||
216 | } | ||
217 | |||
218 | template<> | ||
196 | void Resource<ToolbarHandler::ToolbarMode>:: | 219 | void Resource<ToolbarHandler::ToolbarMode>:: |
197 | setFromString(const char *strval) { | 220 | setFromString(const char *strval) { |
198 | if (strcasecmp(strval, "Off") == 0) | 221 | if (strcasecmp(strval, "Off") == 0) |
@@ -212,6 +235,16 @@ setFromString(const char *strval) { | |||
212 | } | 235 | } |
213 | 236 | ||
214 | template<> | 237 | template<> |
238 | void Resource<Slit::Direction>:: | ||
239 | setFromString(const char *strval) { | ||
240 | if (strcasecmp(strval, "Vertical") == 0) | ||
241 | m_value = Slit::VERTICAL; | ||
242 | else if (strcasecmp(strval, "Horizontal") == 0) | ||
243 | m_value = Slit::HORIZONTAL; | ||
244 | else | ||
245 | setDefaultValue(); | ||
246 | } | ||
247 | |||
215 | string Resource<Toolbar::Placement>:: | 248 | string Resource<Toolbar::Placement>:: |
216 | getString() { | 249 | getString() { |
217 | switch (m_value) { | 250 | switch (m_value) { |
@@ -256,6 +289,39 @@ getString() { | |||
256 | return string("BottomCenter"); | 289 | return string("BottomCenter"); |
257 | } | 290 | } |
258 | 291 | ||
292 | |||
293 | string Resource<Slit::Placement>:: | ||
294 | getString() { | ||
295 | switch (m_value) { | ||
296 | case Slit::TOPLEFT: | ||
297 | return string("TopLeft"); | ||
298 | break; | ||
299 | case Slit::CENTERLEFT: | ||
300 | return string("CenterLeft"); | ||
301 | break; | ||
302 | case Slit::BOTTOMLEFT: | ||
303 | return string("BottomLeft"); | ||
304 | break; | ||
305 | case Slit::TOPCENTER: | ||
306 | return string("TopCenter"); | ||
307 | break; | ||
308 | case Slit::BOTTOMCENTER: | ||
309 | return string("BottomCenter"); | ||
310 | break; | ||
311 | case Slit::TOPRIGHT: | ||
312 | return string("TopRight"); | ||
313 | break; | ||
314 | case Slit::CENTERRIGHT: | ||
315 | return string("CenterRight"); | ||
316 | break; | ||
317 | case Slit::BOTTOMRIGHT: | ||
318 | return string("BottomRight"); | ||
319 | break; | ||
320 | } | ||
321 | //default string | ||
322 | return string("BottomRight"); | ||
323 | } | ||
324 | |||
259 | template<> | 325 | template<> |
260 | string Resource<ToolbarHandler::ToolbarMode>:: | 326 | string Resource<ToolbarHandler::ToolbarMode>:: |
261 | getString() { | 327 | getString() { |
@@ -284,6 +350,22 @@ getString() { | |||
284 | return string("Icons"); | 350 | return string("Icons"); |
285 | } | 351 | } |
286 | 352 | ||
353 | template<> | ||
354 | string Resource<Slit::Direction>:: | ||
355 | getString() { | ||
356 | switch (m_value) { | ||
357 | case Slit::VERTICAL: | ||
358 | return string("Vertical"); | ||
359 | break; | ||
360 | case Slit::HORIZONTAL: | ||
361 | return string("Horizontal"); | ||
362 | break; | ||
363 | } | ||
364 | // default string | ||
365 | return string("Vertical"); | ||
366 | } | ||
367 | |||
368 | |||
287 | namespace { | 369 | namespace { |
288 | 370 | ||
289 | class AddWorkspaceCmd:public FbTk::Command { | 371 | class AddWorkspaceCmd:public FbTk::Command { |
@@ -400,7 +482,12 @@ BScreen::ScreenResource::ScreenResource(ResourceManager &rm, | |||
400 | toolbar_mode(rm, ToolbarHandler::ICONS, scrname+".toolbar.mode", altscrname+".Toolbar.Mode"), | 482 | toolbar_mode(rm, ToolbarHandler::ICONS, scrname+".toolbar.mode", altscrname+".Toolbar.Mode"), |
401 | toolbar_on_head(rm, 0, scrname+".toolbar.onhead", altscrname+".Toolbar.onHead"), | 483 | toolbar_on_head(rm, 0, scrname+".toolbar.onhead", altscrname+".Toolbar.onHead"), |
402 | toolbar_placement(rm, Toolbar::BOTTOMCENTER, | 484 | toolbar_placement(rm, Toolbar::BOTTOMCENTER, |
403 | scrname+".toolbar.placement", altscrname+".Toolbar.Placement") | 485 | scrname+".toolbar.placement", altscrname+".Toolbar.Placement"), |
486 | slit_auto_hide(rm, false, scrname+".slit.autoHide", altscrname+".Slit.AutoHide"), | ||
487 | slit_placement(rm, Slit::BOTTOMRIGHT, | ||
488 | scrname+".slit.placement", altscrname+".Slit.Placement"), | ||
489 | slit_direction(rm, Slit::VERTICAL, scrname+".slit.direction", altscrname+".Slit.Direction") | ||
490 | |||
404 | { | 491 | { |
405 | 492 | ||
406 | }; | 493 | }; |