made PanelWidget class more portable and modular
This commit is contained in:
@@ -22,14 +22,19 @@
|
||||
|
||||
#include <QPainter>
|
||||
|
||||
#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);
|
||||
|
||||
Reference in New Issue
Block a user