diff options
Diffstat (limited to 'src/Screen.cc')
-rw-r--r-- | src/Screen.cc | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index c95b96b..ba5e0d5 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.247 2003/12/10 23:08:03 fluxgen Exp $ | 25 | // $Id: Screen.cc,v 1.248 2003/12/12 18:18:12 fluxgen Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -154,7 +154,31 @@ private: | |||
154 | 154 | ||
155 | }; // End anonymous namespace | 155 | }; // End anonymous namespace |
156 | 156 | ||
157 | template <> | ||
158 | void FbTk::Resource<FbTk::MenuTheme::MenuMode>::setDefaultValue() { | ||
159 | *(*this) = FbTk::MenuTheme::DELAY_OPEN; | ||
160 | } | ||
161 | |||
162 | template <> | ||
163 | string FbTk::Resource<FbTk::MenuTheme::MenuMode>::getString() { | ||
164 | switch (*(*this)) { | ||
165 | case FbTk::MenuTheme::DELAY_OPEN: | ||
166 | return string("Delay"); | ||
167 | case FbTk::MenuTheme::CLICK_OPEN: | ||
168 | return string("Click"); | ||
169 | } | ||
170 | return string("Delay"); | ||
171 | } | ||
157 | 172 | ||
173 | template <> | ||
174 | void FbTk::Resource<FbTk::MenuTheme::MenuMode>::setFromString(const char *str) { | ||
175 | if (strcasecmp(str, "Delay") == 0) | ||
176 | *(*this) = FbTk::MenuTheme::DELAY_OPEN; | ||
177 | else if (strcasecmp(str, "Click") == 0) | ||
178 | *(*this) = FbTk::MenuTheme::CLICK_OPEN; | ||
179 | else | ||
180 | setDefaultValue(); | ||
181 | } | ||
158 | 182 | ||
159 | namespace { | 183 | namespace { |
160 | 184 | ||
@@ -222,7 +246,10 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, | |||
222 | focus_model(rm, Fluxbox::CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"), | 246 | focus_model(rm, Fluxbox::CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"), |
223 | workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), | 247 | workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), |
224 | edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), | 248 | edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), |
225 | menu_alpha(rm, 255, scrname+".menuAlpha", altscrname+".MenuAlpha") { | 249 | menu_alpha(rm, 255, scrname+".menuAlpha", altscrname+".MenuAlpha"), |
250 | menu_delay(rm, 0, scrname + ".menuDelay", altscrname+".MenuDelay"), | ||
251 | menu_delay_close(rm, 0, scrname + ".menuDelayClose", altscrname+".MenuDelayClose"), | ||
252 | menu_mode(rm, FbTk::MenuTheme::DELAY_OPEN, scrname+".menuMode", altscrname+".MenuMode") { | ||
226 | 253 | ||
227 | }; | 254 | }; |
228 | 255 | ||
@@ -307,6 +334,9 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
307 | 334 | ||
308 | 335 | ||
309 | m_menutheme->setAlpha(*resource.menu_alpha); | 336 | m_menutheme->setAlpha(*resource.menu_alpha); |
337 | m_menutheme->setMenuMode(*resource.menu_mode); | ||
338 | m_menutheme->setDelayOpen(*resource.menu_delay); | ||
339 | m_menutheme->setDelayClose(*resource.menu_delay_close); | ||
310 | 340 | ||
311 | imageControl().setDither(*resource.image_dither); | 341 | imageControl().setDither(*resource.image_dither); |
312 | 342 | ||
@@ -570,6 +600,10 @@ FbTk::Menu *BScreen::createMenu(const std::string &label) { | |||
570 | 600 | ||
571 | void BScreen::reconfigure() { | 601 | void BScreen::reconfigure() { |
572 | m_menutheme->setAlpha(*resource.menu_alpha); | 602 | m_menutheme->setAlpha(*resource.menu_alpha); |
603 | m_menutheme->setMenuMode(*resource.menu_mode); | ||
604 | m_menutheme->setDelayOpen(*resource.menu_delay); | ||
605 | m_menutheme->setDelayClose(*resource.menu_delay_close); | ||
606 | |||
573 | Fluxbox::instance()->loadRootCommand(*this); | 607 | Fluxbox::instance()->loadRootCommand(*this); |
574 | 608 | ||
575 | // setup windowtheme, toolbartheme for antialias | 609 | // setup windowtheme, toolbartheme for antialias |