diff --git a/doomsday/sdk/libappfw/include/de/framework/guiwidget.h b/doomsday/sdk/libappfw/include/de/framework/guiwidget.h index cf09584f6b..b0d4782ba9 100644 --- a/doomsday/sdk/libappfw/include/de/framework/guiwidget.h +++ b/doomsday/sdk/libappfw/include/de/framework/guiwidget.h @@ -170,31 +170,38 @@ class LIBAPPFW_PUBLIC GuiWidget : public QObject, public Widget enum Attribute { /** - * Enables or disables automatic state serialization for widgets derived from - * IPersistent. State serialization occurs when the widget is gl(De)Init'd. + * Enables or disables automatic state serialization for widgets + * derived from IPersistent. State serialization occurs when the widget + * is gl(De)Init'd. */ RetainStatePersistently = 0x1, AnimateOpacityWhenEnabledOrDisabled = 0x2, /** - * Widget will not automatically change opacity depending on state (e.g., when - * disabled). + * Widget will not automatically change opacity depending on state + * (e.g., when disabled). */ ManualOpacity = 0x10, /** - * Prevents the drawing of the widget contents even if it visible. The texture - * containing the blurred background is updated regardless. + * Prevents the drawing of the widget contents even if it visible. The + * texture containing the blurred background is updated regardless. */ DontDrawContent = 0x4, /** - * Visible opacity determined solely by the widget itself, not affected by - * ancestors. + * Visible opacity determined solely by the widget itself, not affected + * by ancestors. */ IndependentOpacity = 0x8, + /** + * When focused, don't show the normal focus indicator. The assumption + * is that the widget will indicate focused state on its own. + */ + FocusHidden = 0x20, + DefaultAttributes = RetainStatePersistently | AnimateOpacityWhenEnabledOrDisabled }; Q_DECLARE_FLAGS(Attributes, Attribute) diff --git a/doomsday/sdk/libappfw/src/guirootwidget.cpp b/doomsday/sdk/libappfw/src/guirootwidget.cpp index 3c1e70f42f..373b1fde87 100644 --- a/doomsday/sdk/libappfw/src/guirootwidget.cpp +++ b/doomsday/sdk/libappfw/src/guirootwidget.cpp @@ -185,6 +185,10 @@ DENG2_PIMPL(GuiRootWidget) { focusIndicator->rule().setRect(w->rule()); focusIndicator->startFlashing(); + if(w->attributes().testFlag(GuiWidget::FocusHidden)) + { + focusIndicator->hide(); + } } else { diff --git a/doomsday/sdk/libappfw/src/widgets/focuswidget.cpp b/doomsday/sdk/libappfw/src/widgets/focuswidget.cpp index f2adde58d2..c457939d1a 100644 --- a/doomsday/sdk/libappfw/src/widgets/focuswidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/focuswidget.cpp @@ -63,10 +63,10 @@ FocusWidget::FocusWidget(String const &name) void FocusWidget::startFlashing() { + show(); if(!d->flashing.isActive()) { setOpacity(0); - show(); d->flashing.start(); } } diff --git a/doomsday/sdk/libappfw/src/widgets/lineeditwidget.cpp b/doomsday/sdk/libappfw/src/widgets/lineeditwidget.cpp index c2e86007f1..2abadeae90 100644 --- a/doomsday/sdk/libappfw/src/widgets/lineeditwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/lineeditwidget.cpp @@ -236,6 +236,7 @@ LineEditWidget::LineEditWidget(String const &name) d(new Instance(this)) { setBehavior(ContentClipping | Focusable); + setAttribute(FocusHidden); // The widget's height is tied to the number of lines. rule().setInput(Rule::Height, *d->height);