From 4e447a6096cb07fa919ab72f073401e667b36b3c Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sat, 18 Jun 2016 19:10:41 +0200 Subject: [PATCH] Improved status bar text updating at window change --- ChangeLog | 3 +++ src/fdialog.cpp | 32 ++++++++++++++++++++++---------- test/ui.cpp | 2 ++ 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8e5ef39..7ea309f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2016-06-18 Markus Gans + * Improved status bar text updating at window change + 2016-06-16 Markus Gans * Bug fix in FTerm updateVTerm() for updates from vdesktop * Bug fix in FDialog onWindowActive() for combined setFocus() diff --git a/src/fdialog.cpp b/src/fdialog.cpp index da57937c..4ccb03a6 100644 --- a/src/fdialog.cpp +++ b/src/fdialog.cpp @@ -527,6 +527,7 @@ void FDialog::onMouseDown (FMouseEvent* ev) { FWidget* old_focus = FWidget::getFocusWidget(); setActiveWindow(this); + if ( focus_widget ) { focus_widget->setFocus(); @@ -536,6 +537,9 @@ void FDialog::onMouseDown (FMouseEvent* ev) } else if ( old_focus && focusFirstChild() ) old_focus->redraw(); + + if ( statusBar() ) + statusBar()->drawMessage(); updateTerminal(); } if ( has_raised ) @@ -580,9 +584,12 @@ void FDialog::onMouseDown (FMouseEvent* ev) if ( old_focus ) old_focus->redraw(); } - else if ( focusFirstChild() ) - if ( old_focus ) - old_focus->redraw(); + else if ( old_focus && focusFirstChild() ) + old_focus->redraw(); + + if ( statusBar() ) + statusBar()->drawMessage(); + updateTerminal(); } } } @@ -605,12 +612,14 @@ void FDialog::onMouseDown (FMouseEvent* ev) if ( old_focus ) old_focus->redraw(); } - else if ( focusFirstChild() ) - if ( old_focus ) - old_focus->redraw(); - }; + else if ( old_focus && focusFirstChild() ) + old_focus->redraw(); - if ( has_lowered ) + if ( statusBar() ) + statusBar()->drawMessage(); + updateTerminal(); + } + else if ( has_lowered ) updateTerminal(); } } @@ -730,12 +739,15 @@ void FDialog::onWindowActive (FEvent*) { focus_widget->setFocus(); focus_widget->redraw(); - if ( statusBar() ) - statusBar()->drawMessage(); } else focusFirstChild(); } + + if ( statusBar() ) + statusBar()->drawMessage(); + + updateTerminal(); } //---------------------------------------------------------------------- diff --git a/test/ui.cpp b/test/ui.cpp index 47c77a38..4d21e0f2 100644 --- a/test/ui.cpp +++ b/test/ui.cpp @@ -52,12 +52,14 @@ ProgressDialog::ProgressDialog (FWidget* parent) reset = new FButton(this); reset->setText("&Reset"); + reset->setStatusbarMessage ("Reset the progress bar"); reset->setGeometry(2, 6, 8, 1, false); reset->setShadow(); reset->setDisable(); more = new FButton(this); more->setText("&More"); + more->setStatusbarMessage ("Increases the progress bar position"); more->setGeometry(15, 6, 8, 1, false); more->setShadow(); more->setDisable();