Allow twice as dark toasts for quizes.

This commit is contained in:
John Preston 2020-04-21 14:03:54 +04:00
parent 6d26132685
commit 40084cab95
3 changed files with 6 additions and 0 deletions

View file

@ -29,6 +29,7 @@ struct Config {
int maxWidth = 0;
int maxLines = 16;
bool multiline = false;
bool dark = false;
ClickHandlerFilter filter;
};
void SetDefaultParent(not_null<QWidget*> parent);

View file

@ -19,6 +19,7 @@ Widget::Widget(QWidget *parent, const Config &config)
: TWidget(parent)
, _roundRect(ImageRoundRadius::Large, st::toastBg)
, _multiline(config.multiline)
, _dark(config.dark)
, _maxWidth((config.maxWidth > 0) ? config.maxWidth : st::toastMaxWidth)
, _padding((config.padding.left() > 0) ? config.padding : st::toastPadding)
, _maxTextWidth(widthWithoutPadding(_maxWidth))
@ -69,6 +70,9 @@ void Widget::paintEvent(QPaintEvent *e) {
p.setOpacity(_shownLevel);
_roundRect.paint(p, rect());
if (_dark) {
_roundRect.paint(p, rect());
}
p.setTextPalette(st::toastTextPalette);

View file

@ -41,6 +41,7 @@ private:
float64 _shownLevel = 0;
bool _multiline = false;
bool _dark = false;
int _maxWidth = 0;
QMargins _padding;