fixed autohide bug
fluxgen fluxgen
1 files changed,
17 insertions(+),
11 deletions(-)
jump to
M
src/Toolbar.cc
→
src/Toolbar.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.133 2003/12/19 03:57:40 fluxgen Exp $ +// $Id: Toolbar.cc,v 1.134 2003/12/20 19:05:42 fluxgen Exp $ #include "Toolbar.hh"@@ -353,7 +353,10 @@ }
void Toolbar::reconfigure() { updateVisibleState(); - + + if (!doAutoHide() && isHidden()) + toggleHidden(); + m_tool_factory.updateThemes(); // parse resource tools and determine if we need to rebuild toolbar@@ -501,10 +504,12 @@ else if (re.button == 5) //mousewheel scroll down
screen().prevWorkspace(1); } - void Toolbar::enterNotifyEvent(XCrossingEvent ¬_used) { - if (! doAutoHide()) + if (! doAutoHide()) { + if (isHidden()) + toggleHidden(); return; + } if (isHidden()) { if (! m_hide_timer.isTiming())@@ -515,8 +520,12 @@ m_hide_timer.stop();
} } -void Toolbar::leaveNotifyEvent(XCrossingEvent ¬_used) { +void Toolbar::leaveNotifyEvent(XCrossingEvent &event) { if (! doAutoHide()) + return; + // still inside? + if (event.x_root > x() && event.x_root <= (int)(x() + width()) && + event.y_root > y() && event.y_root <= (int)(y() + height())) return; if (isHidden()) {@@ -529,15 +538,12 @@ }
void Toolbar::exposeEvent(XExposeEvent &ee) { - if (ee.window == frame.window) + if (ee.window == frame.window) { frame.window.clearArea(ee.x, ee.y, ee.width, ee.height); + } } - -void Toolbar::keyPressEvent(XKeyEvent &ke) { - -} void Toolbar::handleEvent(XEvent &event) { if (event.type == ConfigureNotify &&@@ -721,7 +727,7 @@ *m_rc_visible ? frame.window.show() : frame.window.hide();
} void Toolbar::toggleHidden() { - m_hide_timer.fireOnce(true); + // toggle hidden m_hidden = ! m_hidden;