Mercurial > octave-nkf
changeset 15585:81ff500bfb4e
fix indication of terminal widget visibility in window menu
* terminal_dock_widget.cc: added handler closeEvent (),
moved implementation of handle_visibility_changed () here
* terminal_dock_widget.h: added handler closeEvent (),
moved implemenatiotn of handle_visibility_changed () to .cc
author | Torsten <ttl@justmail.de> |
---|---|
date | Sat, 27 Oct 2012 11:20:31 +0200 |
parents | ed6385e23420 |
children | 9b70d27d306e |
files | libgui/src/terminal-dockwidget.cc libgui/src/terminal-dockwidget.h |
diffstat | 2 files changed, 19 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/terminal-dockwidget.cc Fri Oct 26 10:46:17 2012 -0400 +++ b/libgui/src/terminal-dockwidget.cc Sat Oct 27 11:20:31 2012 +0200 @@ -39,6 +39,20 @@ connect (this, SIGNAL (topLevelChanged(bool)), this, SLOT(top_level_changed(bool))); } +void +terminal_dock_widget::closeEvent (QCloseEvent *e) +{ + emit active_changed (false); + QDockWidget::closeEvent (e); +} + +void +terminal_dock_widget::handle_visibility_changed (bool visible) +{ + if (visible) + emit active_changed (true); +} + // slot for signal that is emitted when floating property changes void terminal_dock_widget::top_level_changed (bool floating)
--- a/libgui/src/terminal-dockwidget.h Fri Oct 26 10:46:17 2012 -0400 +++ b/libgui/src/terminal-dockwidget.h Sat Oct 27 11:20:31 2012 +0200 @@ -36,13 +36,13 @@ void active_changed (bool active); public slots: - void handle_visibility_changed (bool visible) - { - if (visible) - emit active_changed (true); - } + void handle_visibility_changed (bool visible); /** Slot when floating property changes */ void top_level_changed (bool floating); + +protected: + void closeEvent (QCloseEvent *event); }; + #endif // TERMINALDOCKWIDGET_H