Added ability to set background color to BoxContentDivider.
This commit is contained in:
parent
01d10cbdbf
commit
e0339b7da1
2 changed files with 20 additions and 3 deletions
|
|
@ -18,13 +18,21 @@ BoxContentDivider::BoxContentDivider(QWidget *parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
BoxContentDivider::BoxContentDivider(QWidget *parent, int height)
|
BoxContentDivider::BoxContentDivider(QWidget *parent, int height)
|
||||||
: RpWidget(parent) {
|
: BoxContentDivider(parent, height, st::boxDividerBg) {
|
||||||
|
}
|
||||||
|
|
||||||
|
BoxContentDivider::BoxContentDivider(
|
||||||
|
QWidget *parent,
|
||||||
|
int height,
|
||||||
|
const style::color &bg)
|
||||||
|
: RpWidget(parent)
|
||||||
|
, _bg(bg) {
|
||||||
resize(width(), height);
|
resize(width(), height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoxContentDivider::paintEvent(QPaintEvent *e) {
|
void BoxContentDivider::paintEvent(QPaintEvent *e) {
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
p.fillRect(e->rect(), st::boxDividerBg);
|
p.fillRect(e->rect(), _bg);
|
||||||
const auto dividerFillTop = QRect(
|
const auto dividerFillTop = QRect(
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,20 @@ namespace Ui {
|
||||||
class BoxContentDivider : public Ui::RpWidget {
|
class BoxContentDivider : public Ui::RpWidget {
|
||||||
public:
|
public:
|
||||||
BoxContentDivider(QWidget *parent);
|
BoxContentDivider(QWidget *parent);
|
||||||
BoxContentDivider(QWidget *parent, int height);
|
BoxContentDivider(
|
||||||
|
QWidget *parent,
|
||||||
|
int height);
|
||||||
|
BoxContentDivider(
|
||||||
|
QWidget *parent,
|
||||||
|
int height,
|
||||||
|
const style::color &bg);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *e) override;
|
void paintEvent(QPaintEvent *e) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
const style::color &_bg;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue