Allow twice as dark toasts for quizes.
This commit is contained in:
parent
6d26132685
commit
40084cab95
3 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ private:
|
|||
|
||||
float64 _shownLevel = 0;
|
||||
bool _multiline = false;
|
||||
bool _dark = false;
|
||||
int _maxWidth = 0;
|
||||
QMargins _padding;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue