diff --git a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp index efd54bbe5..3e57a34ee 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -56,15 +56,15 @@ TopBarWidget::TopBarWidget( not_null controller) : RpWidget(parent) , _controller(controller) -, _clear(this, tr::lng_selected_clear(), st::topBarClearButton) -, _forward(this, tr::lng_selected_forward(), st::defaultActiveButton) -, _sendNow(this, tr::lng_selected_send_now(), st::defaultActiveButton) -, _delete(this, tr::lng_selected_delete(), st::defaultActiveButton) -, _back(this, st::historyTopBarBack) -, _call(this, st::topBarCall) -, _search(this, st::topBarSearch) -, _infoToggle(this, st::topBarInfo) -, _menuToggle(this, st::topBarMenuToggle) +, _clear(this, tr::lng_selected_clear(), st::ktgTopBarClearButton) +, _forward(this, tr::lng_selected_forward(), st::ktgTopBarActiveButton) +, _sendNow(this, tr::lng_selected_send_now(), st::ktgTopBarActiveButton) +, _delete(this, tr::lng_selected_delete(), st::ktgTopBarActiveButton) +, _back(this, st::ktgHistoryTopBarBack) +, _call(this, st::ktgTopBarCall) +, _search(this, st::ktgTopBarSearch) +, _infoToggle(this, st::ktgTopBarInfo) +, _menuToggle(this, st::ktgTopBarMenuToggle) , _titlePeerText(st::windowMinWidth / 3) , _onlineUpdater([=] { updateOnlineDisplay(); }) { subscribe(Lang::Current().updated(), [=] { refreshLang(); }); @@ -318,7 +318,7 @@ void TopBarWidget::paintEvent(QPaintEvent *e) { auto hasSelected = (_selectedCount > 0); auto selectedButtonsTop = countSelectedButtonsTop(_selectedShown.value(hasSelected ? 1. : 0.)); - p.fillRect(QRect(0, 0, width(), st::topBarHeight), st::topBarBg); + p.fillRect(QRect(0, 0, width(), st::topBarHeight), st::ktgTopBarBg); if (selectedButtonsTop < 0) { p.translate(0, selectedButtonsTop + st::topBarHeight); paintTopBar(p); @@ -349,7 +349,7 @@ void TopBarWidget::paintTopBar(Painter &p) { if (availableWidth < textWidth) { text = st::historySavedFont->elided(text, availableWidth); } - p.setPen(st::dialogsNameFg); + p.setPen(st::ktgTopBarNameFg); p.setFont(st::historySavedFont); p.drawTextLeft( nameleft, @@ -359,7 +359,7 @@ void TopBarWidget::paintTopBar(Painter &p) { } else if (_section == Section::Scheduled) { auto text = tr::lng_scheduled_messages(tr::now); - p.setPen(st::dialogsNameFg); + p.setPen(st::ktgTopBarNameFg); if (history) { const auto textWidth = st::msgNameFont->width(text); @@ -374,7 +374,7 @@ void TopBarWidget::paintTopBar(Painter &p) { text); auto nameText = history->peer->topBarNameText().toString(); - p.setPen(st::historyStatusFg); + p.setPen(st::ktgTopBarStatusFg); Ui::Text::String nameTextStr; nameTextStr.setText(st::dialogsTextStyle, nameText, Ui::NameTextOptions()); @@ -410,7 +410,7 @@ void TopBarWidget::paintTopBar(Painter &p) { badgeStyle); const auto namewidth = availableWidth - badgeWidth; - p.setPen(st::dialogsNameFg); + p.setPen(st::ktgTopBarNameFg); peer->topBarNameText().drawElided( p, nameleft, @@ -426,7 +426,7 @@ void TopBarWidget::paintTopBar(Painter &p) { statustop, availableWidth, width(), - st::historyStatusFgTyping, + st::ktgTopBarStatusFgActive, crl::now())) { return; } else { @@ -453,7 +453,7 @@ bool TopBarWidget::paintConnectingState( left += st::topBarConnectingPosition.x() + st::topBarConnectingAnimation.size.width() + st::topBarConnectingSkip; - p.setPen(st::historyStatusFg); + p.setPen(st::ktgTopBarStatusFg); p.drawTextLeft(left, top, outerWidth, tr::lng_status_connecting(tr::now)); return true; } @@ -465,8 +465,8 @@ void TopBarWidget::paintStatus( int availableWidth, int outerWidth) { p.setPen(_titlePeerTextOnline - ? st::historyStatusFgActive - : st::historyStatusFg); + ? st::ktgTopBarStatusFgActive + : st::ktgTopBarStatusFg); _titlePeerText.drawLeftElided(p, left, top, availableWidth, outerWidth); } @@ -852,10 +852,10 @@ void TopBarWidget::updateInfoToggleActive() { && (Core::App().settings().thirdSectionInfoEnabled() || Core::App().settings().tabbedReplacedWithInfo()); auto iconOverride = infoThirdActive - ? &st::topBarInfoActive + ? &st::ktgTopBarInfoActive : nullptr; auto rippleOverride = infoThirdActive - ? &st::lightButtonBgOver + ? &st::ktgTopBarIconBgActiveRipple : nullptr; _infoToggle->setIconOverride(iconOverride, iconOverride); _infoToggle->setRippleColorOverride(rippleOverride); diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index 6df3dd78c..b317784ab 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -833,3 +833,76 @@ separatePanelBack: IconButton(separatePanelClose) { icon: infoTopBarBackIcon; iconOver: infoTopBarBackIconOver; } + +ktgHistoryTopBarBack: IconButton(historyTopBarBack) { + icon: icon {{ "info_back", ktgTopBarBackIconFg }}; + iconOver: icon {{ "info_back", ktgTopBarBackIconFgOver }}; + + ripple: RippleAnimation(defaultRippleAnimation) { + color: ktgTopBarBackIconBgRipple; + } +} + +ktgTopBarCall: IconButton(topBarCall) { + icon: icon {{ "top_bar_call", ktgTopBarIconFg }}; + iconOver: icon {{ "top_bar_call", ktgTopBarIconFgOver }}; + + ripple: RippleAnimation(defaultRippleAnimation) { + color: ktgTopBarIconBgRipple; + } +} + +ktgTopBarSearch: IconButton(topBarSearch) { + icon: icon {{ "top_bar_search", ktgTopBarIconFg }}; + iconOver: icon {{ "top_bar_search", ktgTopBarIconFgOver }}; + + ripple: RippleAnimation(defaultRippleAnimation) { + color: ktgTopBarIconBgRipple; + } +} + +ktgTopBarInfo: IconButton(topBarInfo) { + icon: icon {{ "top_bar_profile", ktgTopBarIconFg }}; + iconOver: icon {{ "top_bar_profile", ktgTopBarIconFgOver }}; + + ripple: RippleAnimation(defaultRippleAnimation) { + color: ktgTopBarIconBgRipple; + } +} + +ktgTopBarInfoActive: icon {{ "top_bar_profile", ktgTopBarIconFgActive }}; + +ktgTopBarMenuToggle: IconButton(topBarMenuToggle) { + icon: icon {{ "title_menu_dots", ktgTopBarIconFg }}; + iconOver: icon {{ "title_menu_dots", ktgTopBarIconFgOver }}; + + ripple: RippleAnimation(defaultRippleAnimation) { + color: ktgTopBarIconBgRipple; + } +} + +ktgTopBarActiveButton: RoundButton(defaultActiveButton) { + textFg: ktgTopBarActiveButtonFg; + textFgOver: ktgTopBarActiveButtonFgOver; + numbersTextFg: ktgTopBarActiveButtonSecondaryFg; + numbersTextFgOver: ktgTopBarActiveButtonSecondaryFgOver; + textBg: ktgTopBarActiveButtonBg; + textBgOver: ktgTopBarActiveButtonBgOver; + + ripple: RippleAnimation(defaultRippleAnimation) { + color: ktgTopBarActiveButtonBgRipple; + } +} + +ktgTopBarClearButton: RoundButton(topBarClearButton) { + textFg: ktgTopBarClearButtonFg; + textFgOver: ktgTopBarClearButtonFgOver; + numbersTextFg: ktgTopBarClearButtonFg; + numbersTextFgOver: ktgTopBarClearButtonFgOver; + textBg: ktgTopBarClearButtonBg; + textBgOver: ktgTopBarClearButtonBgOver; + + ripple: RippleAnimation(defaultRippleAnimation) { + color: ktgTopBarClearButtonBgRipple; + } +} diff --git a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp index f16d87a81..52fdac2cd 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp @@ -479,14 +479,14 @@ void Generator::paintHistoryBackground() { } void Generator::paintTopBar() { - _p->fillRect(_topBar, st::topBarBg[_palette]); + _p->fillRect(_topBar, st::ktgTopBarBg[_palette]); auto right = st::topBarMenuToggle.width; - st::topBarMenuToggle.icon[_palette].paint(*_p, _topBar.x() + _topBar.width() - right + st::topBarMenuToggle.iconPosition.x(), _topBar.y() + st::topBarMenuToggle.iconPosition.y(), _rect.width()); + st::ktgTopBarMenuToggle.icon[_palette].paint(*_p, _topBar.x() + _topBar.width() - right + st::topBarMenuToggle.iconPosition.x(), _topBar.y() + st::topBarMenuToggle.iconPosition.y(), _rect.width()); right += st::topBarSearch.width; - st::topBarSearch.icon[_palette].paint(*_p, _topBar.x() + _topBar.width() - right + st::topBarSearch.iconPosition.x(), _topBar.y() + st::topBarSearch.iconPosition.y(), _rect.width()); + st::ktgTopBarSearch.icon[_palette].paint(*_p, _topBar.x() + _topBar.width() - right + st::topBarSearch.iconPosition.x(), _topBar.y() + st::topBarSearch.iconPosition.y(), _rect.width()); right += st::topBarCallSkip + st::topBarCall.width; - st::topBarCall.icon[_palette].paint(*_p, _topBar.x() + _topBar.width() - right + st::topBarCall.iconPosition.x(), _topBar.y() + st::topBarCall.iconPosition.y(), _rect.width()); + st::ktgTopBarCall.icon[_palette].paint(*_p, _topBar.x() + _topBar.width() - right + st::topBarCall.iconPosition.x(), _topBar.y() + st::topBarCall.iconPosition.y(), _rect.width()); auto decreaseWidth = st::topBarCall.width + st::topBarCallSkip + st::topBarSearch.width + st::topBarMenuToggle.width; auto nameleft = _topBar.x() + st::topBarArrowPadding.right(); @@ -494,10 +494,10 @@ void Generator::paintTopBar() { auto statustop = _topBar.y() + st::topBarHeight - st::topBarArrowPadding.bottom() - st::dialogsTextFont->height; auto namewidth = _topBar.x() + _topBar.width() - decreaseWidth - nameleft - st::topBarArrowPadding.right(); _p->setFont(st::dialogsTextFont); - _p->setPen(_topBarStatusActive ? st::historyStatusFgActive[_palette] : st::historyStatusFg[_palette]); + _p->setPen(_topBarStatusActive ? st::ktgTopBarStatusFgActive[_palette] : st::ktgTopBarStatusFg[_palette]); _p->drawText(nameleft, statustop + st::dialogsTextFont->ascent, _topBarStatus); - _p->setPen(st::dialogsNameFg[_palette]); + _p->setPen(st::ktgTopBarNameFg[_palette]); _topBarName.drawElided(*_p, nameleft, nametop, namewidth); } diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 58c35e9dc..c279e4b0b 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 58c35e9dcc24198332958d5f874d318f5cea77ec +Subproject commit c279e4b0be5964838ce9d52dc53ac6960e628dfe