aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ToolbarHandler.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ToolbarHandler.cc b/src/ToolbarHandler.cc
index b84520b..f94c6a7 100644
--- a/src/ToolbarHandler.cc
+++ b/src/ToolbarHandler.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: ToolbarHandler.cc,v 1.6 2003/04/15 13:38:57 rathnor Exp $ 23// $Id: ToolbarHandler.cc,v 1.7 2003/04/16 13:30:55 fluxgen Exp $
24 24
25/** 25/**
26 * The ToolbarHandler class acts as a rough interface to the toolbar. 26 * The ToolbarHandler class acts as a rough interface to the toolbar.
@@ -101,7 +101,9 @@ ToolbarHandler::ToolbarHandler(BScreen &screen, ToolbarMode mode)
101} 101}
102 102
103void ToolbarHandler::setMode(ToolbarMode mode, bool initialise) { 103void ToolbarHandler::setMode(ToolbarMode mode, bool initialise) {
104 if (mode < 0 || mode >= LASTMODE || (mode == m_mode && initialise)) return; 104 if (mode < 0 || mode >= LASTMODE || (mode == m_mode && initialise))
105 return;
106
105 if (mode == OFF) { 107 if (mode == OFF) {
106 m_mode = mode; 108 m_mode = mode;
107 m_toolbarmenu.removeAll(); 109 m_toolbarmenu.removeAll();
@@ -109,14 +111,15 @@ void ToolbarHandler::setMode(ToolbarMode mode, bool initialise) {
109 m_toolbarmenu.insert("Mode...", &m_modemenu); 111 m_toolbarmenu.insert("Mode...", &m_modemenu);
110 m_toolbar.reset(0); 112 m_toolbar.reset(0);
111 m_toolbarmenu.update(); 113 m_toolbarmenu.update();
114
112 return; 115 return;
113 } else if (!m_toolbar.get()) { 116 } else if (!m_toolbar.get()) {
114 m_toolbarmenu.removeAll(); 117 m_toolbarmenu.removeAll();
115 118
116 m_toolbarmenu.insert("Mode...", &m_modemenu);
117 m_toolbar.reset(new Toolbar(m_screen, 119 m_toolbar.reset(new Toolbar(m_screen,
118 *m_screen.layerManager().getLayer(m_screen.getToolbarLayerNum()), m_toolbarmenu)); 120 *m_screen.layerManager().getLayer(m_screen.getToolbarLayerNum()), m_toolbarmenu));
119 121 m_toolbarmenu.insert("Mode...", &m_modemenu);
122 m_toolbarmenu.update();
120 } 123 }
121 124
122 125