diff --git a/app/widget/panel/panel.cpp b/app/widget/panel/panel.cpp index 55c0a9996..7fd84de82 100644 --- a/app/widget/panel/panel.cpp +++ b/app/widget/panel/panel.cpp @@ -22,14 +22,19 @@ #include -#include "panel/panelfocusmanager.h" - PanelWidget::PanelWidget(QWidget *parent) : - QDockWidget(parent) + QDockWidget(parent), + border_visible_(false) { setFocusPolicy(Qt::ClickFocus); } +void PanelWidget::SetBorderVisible(bool enabled) +{ + border_visible_ = enabled; + update(); +} + void PanelWidget::SetTitle(const QString &t) { title_ = t; @@ -48,7 +53,7 @@ void PanelWidget::paintEvent(QPaintEvent *event) QDockWidget::paintEvent(event); // Check if this panel (or a child of it) has focus using PanelFocusManager - if (olive::panel_focus_manager->CurrentlyFocused() == this) { + if (border_visible_) { // Draw a highlight border if so QPainter p(this); diff --git a/app/widget/panel/panel.h b/app/widget/panel/panel.h index def33cbe5..742850899 100644 --- a/app/widget/panel/panel.h +++ b/app/widget/panel/panel.h @@ -41,6 +41,13 @@ public: * MainWindow. */ PanelWidget(QWidget* parent); + + /** + * @brief Set visibility of panel's highlighted border, mostly used for showing panel focus + * + * @param enabled + */ + void SetBorderVisible(bool enabled); protected: /** * @brief Set panel's title @@ -92,6 +99,11 @@ private: * @brief Internal subtitle string */ QString subtitle_; + + /** + * @brief Internal border visibility value + */ + bool border_visible_; }; #endif // PANEL_WIDGET_H