diff options
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 66 |
1 files changed, 40 insertions, 26 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index b2500e7..61025a2 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -1798,32 +1798,6 @@ void Fluxbox::load_rc(void) { | |||
1798 | } else | 1798 | } else |
1799 | resource.tabs = true; | 1799 | resource.tabs = true; |
1800 | 1800 | ||
1801 | if (XrmGetResource(database, "session.tab.width", "Session.Tab.Width", | ||
1802 | &value_type, &value)) { | ||
1803 | if (sscanf(value.addr, "%d", &resource.tabwidth) != 1) | ||
1804 | resource.tabwidth = 64; // default tab width | ||
1805 | else { | ||
1806 | if (resource.tabwidth < 5) // are these values sane? | ||
1807 | resource.tabwidth = 5; | ||
1808 | if (resource.tabwidth > 256) | ||
1809 | resource.tabwidth = 256; | ||
1810 | } | ||
1811 | } else | ||
1812 | resource.tabwidth = 64; // default tab width | ||
1813 | |||
1814 | if (XrmGetResource(database, "session.tab.height", "Session.Tab.Height", | ||
1815 | &value_type, &value)) { | ||
1816 | if (sscanf(value.addr, "%d", &resource.tabheight) != 1) | ||
1817 | resource.tabheight = 16; // default tab height | ||
1818 | else { | ||
1819 | if (resource.tabheight < 5) // are these values sane? | ||
1820 | resource.tabheight = 5; | ||
1821 | if (resource.tabheight > 50) | ||
1822 | resource.tabheight = 50; | ||
1823 | } | ||
1824 | } else | ||
1825 | resource.tabheight = 16; // default tab height | ||
1826 | |||
1827 | if (XrmGetResource(database, "session.colorsPerChannel", | 1801 | if (XrmGetResource(database, "session.colorsPerChannel", |
1828 | "Session.ColorsPerChannel", &value_type, &value)) { | 1802 | "Session.ColorsPerChannel", &value_type, &value)) { |
1829 | if (sscanf(value.addr, "%d", &resource.colors_per_channel) != 1) | 1803 | if (sscanf(value.addr, "%d", &resource.colors_per_channel) != 1) |
@@ -2324,6 +2298,46 @@ void Fluxbox::load_rc(BScreen *screen) { | |||
2324 | } else | 2298 | } else |
2325 | screen->saveOpaqueMove(False); | 2299 | screen->saveOpaqueMove(False); |
2326 | 2300 | ||
2301 | sprintf(name_lookup, "session.screen%d.tab.width", screen_number); | ||
2302 | sprintf(class_lookup, "Session.Screen%d.Tab.Width", screen_number); | ||
2303 | if (XrmGetResource(database, name_lookup, class_lookup, | ||
2304 | &value_type, &value)) { | ||
2305 | unsigned int tmp_val; | ||
2306 | |||
2307 | if (sscanf(value.addr, "%d", &tmp_val) != 1) | ||
2308 | screen->saveTabWidth(64); // default tab width | ||
2309 | else { | ||
2310 | //TODO: should we remove checks for max/min? | ||
2311 | if (tmp_val > 512) | ||
2312 | screen->saveTabWidth(512); | ||
2313 | else if (tmp_val < 5) | ||
2314 | screen->saveTabWidth(5); | ||
2315 | else | ||
2316 | screen->saveTabWidth(tmp_val); | ||
2317 | } | ||
2318 | } else | ||
2319 | screen->saveTabWidth(64); // default tab width | ||
2320 | |||
2321 | sprintf(name_lookup, "session.screen%d.tab.height", screen_number); | ||
2322 | sprintf(class_lookup, "Session.Screen%d.Tab.Height", screen_number); | ||
2323 | if (XrmGetResource(database, name_lookup, class_lookup, | ||
2324 | &value_type, &value)) { | ||
2325 | unsigned int tmp_val; | ||
2326 | |||
2327 | if (sscanf(value.addr, "%d", &tmp_val) != 1) | ||
2328 | screen->saveTabHeight(16); // default tab height | ||
2329 | else { | ||
2330 | //TODO: should we remove checks for max/min? | ||
2331 | if (tmp_val > 50) | ||
2332 | screen->saveTabHeight(50); | ||
2333 | else if (tmp_val < 5) | ||
2334 | screen->saveTabHeight(5); | ||
2335 | else | ||
2336 | screen->saveTabHeight(tmp_val); | ||
2337 | } | ||
2338 | } else | ||
2339 | screen->saveTabHeight(16); // default tab height | ||
2340 | |||
2327 | sprintf(name_lookup, "session.screen%d.tab.placement", screen_number); | 2341 | sprintf(name_lookup, "session.screen%d.tab.placement", screen_number); |
2328 | sprintf(class_lookup, "Session.Screen%d.Tab.Placement", screen_number); | 2342 | sprintf(class_lookup, "Session.Screen%d.Tab.Placement", screen_number); |
2329 | if (XrmGetResource(database, name_lookup, class_lookup, | 2343 | if (XrmGetResource(database, name_lookup, class_lookup, |