mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added ability to set background color for premium top bar via styles.
This commit is contained in:
parent
0293700e0f
commit
b56b9b1fb9
2 changed files with 4 additions and 2 deletions
|
@ -27,6 +27,7 @@ PremiumBubble {
|
||||||
font: font;
|
font: font;
|
||||||
}
|
}
|
||||||
PremiumCover {
|
PremiumCover {
|
||||||
|
bg: color;
|
||||||
starSize: size;
|
starSize: size;
|
||||||
starTopSkip: pixels;
|
starTopSkip: pixels;
|
||||||
titlePadding: margins;
|
titlePadding: margins;
|
||||||
|
@ -41,6 +42,7 @@ premiumAboutTextStyle: TextStyle(defaultTextStyle) {
|
||||||
lineHeight: 18px;
|
lineHeight: 18px;
|
||||||
}
|
}
|
||||||
defaultPremiumCover: PremiumCover {
|
defaultPremiumCover: PremiumCover {
|
||||||
|
bg: boxBg;
|
||||||
starSize: size(84px, 81px);
|
starSize: size(84px, 81px);
|
||||||
starTopSkip: 37px;
|
starTopSkip: 37px;
|
||||||
titlePadding: margins(0px, 18px, 0px, 11px);
|
titlePadding: margins(0px, 18px, 0px, 11px);
|
||||||
|
|
|
@ -120,7 +120,7 @@ void TopBarAbstract::paintEdges(QPainter &p, const QBrush &brush) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TopBarAbstract::paintEdges(QPainter &p) const {
|
void TopBarAbstract::paintEdges(QPainter &p) const {
|
||||||
paintEdges(p, st::boxBg);
|
paintEdges(p, st().bg);
|
||||||
if (isDark() && st().additionalShadowForDarkThemes) {
|
if (isDark() && st().additionalShadowForDarkThemes) {
|
||||||
paintEdges(p, st::shadowFg);
|
paintEdges(p, st::shadowFg);
|
||||||
paintEdges(p, st::shadowFg);
|
paintEdges(p, st::shadowFg);
|
||||||
|
@ -144,7 +144,7 @@ bool TopBarAbstract::isDark() const {
|
||||||
|
|
||||||
void TopBarAbstract::computeIsDark() {
|
void TopBarAbstract::computeIsDark() {
|
||||||
const auto contrast = CountContrast(
|
const auto contrast = CountContrast(
|
||||||
st::boxBg->c,
|
st().bg->c,
|
||||||
st::premiumButtonFg->c);
|
st::premiumButtonFg->c);
|
||||||
_isDark = (contrast > kMinAcceptableContrast);
|
_isDark = (contrast > kMinAcceptableContrast);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue