mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-26 23:43:06 +02:00
Added ability to provide max width to about label in premium top bar.
This commit is contained in:
parent
50d74fcf25
commit
8e3100acdd
3 changed files with 9 additions and 2 deletions
|
@ -33,6 +33,7 @@ PremiumCover {
|
||||||
titlePadding: margins;
|
titlePadding: margins;
|
||||||
titleFont: font;
|
titleFont: font;
|
||||||
about: FlatLabel;
|
about: FlatLabel;
|
||||||
|
aboutMaxWidth: pixels;
|
||||||
additionalShadowForDarkThemes: bool;
|
additionalShadowForDarkThemes: bool;
|
||||||
}
|
}
|
||||||
ComposePremiumRequired {
|
ComposePremiumRequired {
|
||||||
|
@ -64,6 +65,7 @@ defaultPremiumCover: PremiumCover {
|
||||||
textFg: premiumButtonFg;
|
textFg: premiumButtonFg;
|
||||||
minWidth: 190px;
|
minWidth: 190px;
|
||||||
}
|
}
|
||||||
|
aboutMaxWidth: 0px;
|
||||||
additionalShadowForDarkThemes: true;
|
additionalShadowForDarkThemes: true;
|
||||||
}
|
}
|
||||||
userPremiumCoverAbout: FlatLabel(boxDividerLabel) {
|
userPremiumCoverAbout: FlatLabel(boxDividerLabel) {
|
||||||
|
|
|
@ -107,6 +107,7 @@ TopBar::TopBar(
|
||||||
, _logo(descriptor.logo)
|
, _logo(descriptor.logo)
|
||||||
, _titleFont(st.titleFont)
|
, _titleFont(st.titleFont)
|
||||||
, _titlePadding(st.titlePadding)
|
, _titlePadding(st.titlePadding)
|
||||||
|
, _aboutMaxWidth(st.aboutMaxWidth)
|
||||||
, _about(this, std::move(descriptor.about), st.about)
|
, _about(this, std::move(descriptor.about), st.about)
|
||||||
, _ministars(this, descriptor.optimizeMinistars, MiniStars::Type::BiStars) {
|
, _ministars(this, descriptor.optimizeMinistars, MiniStars::Type::BiStars) {
|
||||||
std::move(
|
std::move(
|
||||||
|
@ -212,8 +213,11 @@ void TopBar::resizeEvent(QResizeEvent *e) {
|
||||||
const auto aboutTop = titleTop
|
const auto aboutTop = titleTop
|
||||||
+ titlePathRect.height()
|
+ titlePathRect.height()
|
||||||
+ _titlePadding.bottom();
|
+ _titlePadding.bottom();
|
||||||
_about->resizeToWidth(availableWidth);
|
_about->resizeToWidth(_aboutMaxWidth ? _aboutMaxWidth : availableWidth);
|
||||||
_about->moveToLeft(padding.left(), aboutTop);
|
_about->moveToLeft(
|
||||||
|
padding.left()
|
||||||
|
+ (_aboutMaxWidth ? (availableWidth - _about->width()) / 2 : 0),
|
||||||
|
aboutTop);
|
||||||
_about->setOpacity(_progress.body);
|
_about->setOpacity(_progress.body);
|
||||||
|
|
||||||
RpWidget::resizeEvent(e);
|
RpWidget::resizeEvent(e);
|
||||||
|
|
|
@ -92,6 +92,7 @@ private:
|
||||||
const QString _logo;
|
const QString _logo;
|
||||||
const style::font &_titleFont;
|
const style::font &_titleFont;
|
||||||
const style::margins &_titlePadding;
|
const style::margins &_titlePadding;
|
||||||
|
const int _aboutMaxWidth = 0;
|
||||||
object_ptr<FlatLabel> _about;
|
object_ptr<FlatLabel> _about;
|
||||||
ColoredMiniStars _ministars;
|
ColoredMiniStars _ministars;
|
||||||
QSvgRenderer _star;
|
QSvgRenderer _star;
|
||||||
|
|
Loading…
Add table
Reference in a new issue