From 8ffa221e5f315ad28e4d7ff4857357d1128bf955 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 19 Jun 2016 23:18:53 +0200 Subject: [PATCH] Fixes some status bar update issues and focus problems --- src/fbuttongroup.cpp | 9 ++++++--- src/fwidget.cpp | 6 +----- src/fwidget.h | 4 ++-- test/ui.cpp | 4 ++++ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp index d3a689f5..211ae33e 100644 --- a/src/fbuttongroup.cpp +++ b/src/fbuttongroup.cpp @@ -477,7 +477,8 @@ void FButtonGroup::onFocusIn (FFocusEvent* in_ev) in_ev->ignore(); FWidget* prev_element = getFocusWidget(); (*iter)->setFocus(); - prev_element->redraw(); + if ( prev_element ) + prev_element->redraw(); (*iter)->redraw(); } break; @@ -492,7 +493,8 @@ void FButtonGroup::onFocusIn (FFocusEvent* in_ev) in_ev->ignore(); FWidget* prev_element = getFocusWidget(); focusFirstChild(); - prev_element->redraw(); + if ( prev_element ) + prev_element->redraw(); getFocusWidget()->redraw(); } else if ( in_ev->getFocusType() == fc::FocusPreviousWidget ) @@ -500,7 +502,8 @@ void FButtonGroup::onFocusIn (FFocusEvent* in_ev) in_ev->ignore(); FWidget* prev_element = getFocusWidget(); focusLastChild(); - prev_element->redraw(); + if ( prev_element ) + prev_element->redraw(); getFocusWidget()->redraw(); } } diff --git a/src/fwidget.cpp b/src/fwidget.cpp index d47b045b..c026e140 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -1459,7 +1459,7 @@ bool FWidget::focusLastChild() } //---------------------------------------------------------------------- -bool FWidget::setFocus(bool on) +bool FWidget::setFocus (bool on) { FWindow* window; @@ -1483,10 +1483,6 @@ bool FWidget::setFocus(bool on) } } - // unset widget focus - if ( ! on && focus ) - FWidget::setFocusWidget(0); - window = FWindow::getWindowWidget(this); // set window focus diff --git a/src/fwidget.h b/src/fwidget.h index c1bc0ad3..a7f36911 100644 --- a/src/fwidget.h +++ b/src/fwidget.h @@ -379,7 +379,7 @@ class FWidget : public FObject, public FTerm virtual bool focusFirstChild(); virtual bool focusLastChild(); - virtual bool setFocus(bool); + virtual bool setFocus (bool); virtual bool setFocus(); virtual bool unsetFocus(); bool hasFocus() const; @@ -387,7 +387,7 @@ class FWidget : public FObject, public FTerm void setFocusable(); void unsetFocusable(); - bool ignorePadding(bool); + bool ignorePadding (bool); bool ignorePadding(); bool acceptPadding(); diff --git a/test/ui.cpp b/test/ui.cpp index 4d21e0f2..f781ecf4 100644 --- a/test/ui.cpp +++ b/test/ui.cpp @@ -130,6 +130,10 @@ void ProgressDialog::onTimer (FTimerEvent*) more->setEnable(); quit->setEnable(); redraw(); + if ( statusBar() ) + statusBar()->drawMessage(); + updateTerminal(); + flush_out(); } }