diff --git a/Telegram/SourceFiles/boxes/boxes.style b/Telegram/SourceFiles/boxes/boxes.style index e52f6e7a82..82d7dfda61 100644 --- a/Telegram/SourceFiles/boxes/boxes.style +++ b/Telegram/SourceFiles/boxes/boxes.style @@ -153,74 +153,6 @@ contactsAboutFg: windowSubTextFgOver; contactsAboutTop: 60px; contactsAboutBottom: 19px; -contactsSearchField: InputField(defaultInputField) { - textBg: transparent; - textMargins: margins(2px, 7px, 2px, 0px); - - placeholderFg: placeholderFg; - placeholderFgActive: placeholderFgActive; - placeholderFgError: placeholderFgActive; - placeholderMargins: margins(2px, 0px, 2px, 0px); - placeholderScale: 0.; - placeholderFont: normalFont; - - border: 0px; - borderActive: 0px; - - heightMin: 32px; - - font: normalFont; -} -contactsSearchCancel: CrossButton { - width: 44px; - height: 44px; - - cross: CrossAnimation { - size: 36px; - skip: 12px; - stroke: 2px; - minScale: 0.3; - } - crossFg: boxTitleCloseFg; - crossFgOver: boxTitleCloseFgOver; - crossPosition: point(4px, 4px); - - duration: 150; - loadingPeriod: 1000; - ripple: RippleAnimation(defaultRippleAnimation) { - color: windowBgOver; - } -} -contactsMultiSelect: MultiSelect { - bg: boxSearchBg; - padding: margins(8px, 6px, 8px, 6px); - maxHeight: 104px; - scroll: ScrollArea(defaultSolidScroll) { - deltat: 3px; - deltab: 3px; - round: 1px; - width: 8px; - deltax: 3px; - hiding: 1000; - } - - item: defaultMultiSelectItem; - itemSkip: 8px; - - field: contactsSearchField; - fieldMinWidth: 42px; - fieldIcon: boxFieldSearchIcon; - fieldIconSkip: 36px; - - fieldCancel: contactsSearchCancel; - fieldCancelSkip: 40px; -} -contactsPhotoCheckIcon: defaultPeerListCheckIcon; -contactsPhotoCheck: defaultPeerListCheck; -contactsPhotoCheckbox: defaultPeerListCheckbox; -contactsPhotoDisabledCheckFg: menuIconFg; -contactsRipple: defaultRippleAnimation; - contactsMarginTop: 4px; contactsMarginBottom: 4px; membersMarginTop: 10px; @@ -241,7 +173,7 @@ peerListBox: PeerList(defaultPeerList) { button: OutlineButton(defaultPeerListButton) { textBg: contactsBg; textBgOver: contactsBgOver; - ripple: contactsRipple; + ripple: defaultRippleAnimation; } statusFg: contactsStatusFg; statusFgOver: contactsStatusFgOver; @@ -282,7 +214,7 @@ localStorageLimitMargin: margins(22px, 5px, 20px, 10px); shareRowsTop: 12px; shareRowHeight: 108px; sharePhotoTop: 6px; -sharePhotoCheckbox: RoundImageCheckbox(contactsPhotoCheckbox) { +sharePhotoCheckbox: RoundImageCheckbox(defaultPeerListCheckbox) { imageRadius: 28px; imageSmallRadius: 24px; } @@ -697,10 +629,10 @@ muteChatTitle: FlatLabel(boxLabel) { } muteChatTitleLeft: 50px; -groupStickersRemove: contactsSearchCancel; +groupStickersRemove: defaultMultiSelectSearchCancel; groupStickersRemovePosition: point(6px, 6px); groupStickersFieldPadding: margins(8px, 6px, 8px, 6px); -groupStickersField: InputField(contactsSearchField) { +groupStickersField: InputField(defaultMultiSelectSearchField) { placeholderFont: boxTextFont; font: boxTextFont; placeholderMargins: margins(0px, 0px, 0px, 0px); @@ -960,7 +892,7 @@ pollResultsVotesCount: FlatLabel(defaultFlatLabel) { textFg: windowSubTextFg; } pollResultsHeaderPadding: margins(22px, 22px, 22px, 8px); -pollResultsShowMore: SettingsButton { +pollResultsShowMore: SettingsButton(defaultSettingsButton) { textFg: lightButtonFg; textFgOver: lightButtonFgOver; textBg: windowBg; diff --git a/Telegram/SourceFiles/boxes/dictionaries_manager.cpp b/Telegram/SourceFiles/boxes/dictionaries_manager.cpp index 5bf50e8096..e8caa84046 100644 --- a/Telegram/SourceFiles/boxes/dictionaries_manager.cpp +++ b/Telegram/SourceFiles/boxes/dictionaries_manager.cpp @@ -91,7 +91,7 @@ QString StateDescription(const DictState &state) { auto CreateMultiSelect(QWidget *parent) { const auto result = Ui::CreateChild( parent, - st::contactsMultiSelect, + st::defaultMultiSelect, tr::lng_participant_filter()); result->resizeToWidth(st::boxWidth); diff --git a/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp b/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp index 427a803fba..33ff95351b 100644 --- a/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp +++ b/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.cpp @@ -423,10 +423,10 @@ object_ptr EditFilterChatsListController::prepareTypesList() { &session(), _options, _selected); + controller->setStyleOverrides(&st::windowFilterSmallList); const auto content = result->add(object_ptr( container, - controller, - st::windowFilterSmallList)); + controller)); delegate->setContent(content); controller->setDelegate(delegate); for (const auto flag : kAllTypes) { diff --git a/Telegram/SourceFiles/boxes/language_box.cpp b/Telegram/SourceFiles/boxes/language_box.cpp index 53ba3f53eb..80d7dc7f4a 100644 --- a/Telegram/SourceFiles/boxes/language_box.cpp +++ b/Telegram/SourceFiles/boxes/language_box.cpp @@ -880,7 +880,7 @@ void Content::setupContent( const auto inner = wrap->entity(); inner->add(object_ptr( inner, - st::boxVerticalMargin)); + st::defaultBox.margin.top())); const auto rows = inner->add(object_ptr( inner, list, @@ -888,7 +888,7 @@ void Content::setupContent( areOfficial)); inner->add(object_ptr( inner, - st::boxVerticalMargin)); + st::defaultBox.margin.top())); rows->isEmpty() | rpl::start_with_next([=](bool empty) { wrap->toggle(!empty, anim::type::instant); @@ -1153,7 +1153,7 @@ void LanguageBox::setInnerFocus() { not_null LanguageBox::createMultiSelect() { const auto result = Ui::CreateChild( this, - st::contactsMultiSelect, + st::defaultMultiSelect, tr::lng_participant_filter()); result->resizeToWidth(st::boxWidth); result->moveToLeft(0, 0); diff --git a/Telegram/SourceFiles/boxes/local_storage_box.cpp b/Telegram/SourceFiles/boxes/local_storage_box.cpp index 389208dfc3..82fafb9722 100644 --- a/Telegram/SourceFiles/boxes/local_storage_box.cpp +++ b/Telegram/SourceFiles/boxes/local_storage_box.cpp @@ -360,7 +360,7 @@ void LocalStorageBox::clearByTag(uint16 tag) { void LocalStorageBox::setupControls() { const auto container = setInnerWidget( object_ptr(this), - st::contactsMultiSelect.scroll); + st::defaultMultiSelect.scroll); const auto createRow = [&]( uint16 tag, Fn title, diff --git a/Telegram/SourceFiles/boxes/peer_list_box.cpp b/Telegram/SourceFiles/boxes/peer_list_box.cpp index 8754a149e9..5a957773bf 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_box.cpp @@ -67,7 +67,9 @@ void PeerListBox::createMultiSelect() { auto entity = object_ptr( this, - st::contactsMultiSelect, + (_controller->selectSt() + ? *_controller->selectSt() + : st::defaultMultiSelect), tr::lng_participant_filter()); _select.create(this, std::move(entity)); _select->heightValue( @@ -117,8 +119,7 @@ void PeerListBox::prepare() { setContent(setInnerWidget( object_ptr( this, - _controller.get(), - st::peerListBox), + _controller.get()), st::boxScroll)); content()->resizeToWidth(_controller->contentWidth()); @@ -178,8 +179,12 @@ void PeerListBox::resizeEvent(QResizeEvent *e) { void PeerListBox::paintEvent(QPaintEvent *e) { Painter p(this); + + const auto &bg = (_controller->listSt() + ? *_controller->listSt() + : st::peerListBox).bg; for (const auto rect : e->region()) { - p.fillRect(rect, st::contactsBg); + p.fillRect(rect, bg); } } @@ -248,6 +253,14 @@ PeerListController::PeerListController(std::unique_ptr } } +const style::PeerList &PeerListController::computeListSt() const { + return _listSt ? *_listSt : st::peerListBox; +} + +const style::MultiSelect &PeerListController::computeSelectSt() const { + return _selectSt ? *_selectSt : st::defaultMultiSelect; +} + bool PeerListController::hasComplexSearch() const { return (_searchController != nullptr); } @@ -279,7 +292,8 @@ void PeerListController::setDescriptionText(const QString &text) { if (text.isEmpty()) { setDescription(nullptr); } else { - setDescription(object_ptr(nullptr, text, st::membersAbout)); + const auto &st = _listSt ? *_listSt : st::peerListBox; + setDescription(object_ptr(nullptr, text, computeListSt().about)); } } @@ -353,17 +367,20 @@ void PeerListBox::addSelectItem( createMultiSelect(); _select->hide(anim::type::instant); } + const auto &activeBg = (_controller->selectSt() + ? *_controller->selectSt() + : st::defaultMultiSelect).item.textActiveBg; if (animated == anim::type::instant) { _select->entity()->addItemInBunch( itemId, text, - st::activeButtonBg, + activeBg, std::move(paintUserpic)); } else { _select->entity()->addItem( itemId, text, - st::activeButtonBg, + activeBg, std::move(paintUserpic)); } } @@ -606,21 +623,21 @@ void PeerListRow::paintDisabledCheckUserpic( int x, int y, int outerWidth) const { - auto userpicRadius = st::contactsPhotoCheckbox.imageSmallRadius; - auto userpicShift = st::contactsPhotoCheckbox.imageRadius - userpicRadius; - auto userpicDiameter = st::contactsPhotoCheckbox.imageRadius * 2; + auto userpicRadius = st.checkbox.imageSmallRadius; + auto userpicShift = st.checkbox.imageRadius - userpicRadius; + auto userpicDiameter = st.checkbox.imageRadius * 2; auto userpicLeft = x + userpicShift; auto userpicTop = y + userpicShift; auto userpicEllipse = style::rtlrect(x, y, userpicDiameter, userpicDiameter, outerWidth); - auto userpicBorderPen = st::contactsPhotoDisabledCheckFg->p; - userpicBorderPen.setWidth(st::contactsPhotoCheckbox.selectWidth); + auto userpicBorderPen = st.disabledCheckFg->p; + userpicBorderPen.setWidth(st.checkbox.selectWidth); - auto iconDiameter = st::contactsPhotoCheckbox.check.size; - auto iconLeft = x + userpicDiameter + st::contactsPhotoCheckbox.selectWidth - iconDiameter; - auto iconTop = y + userpicDiameter + st::contactsPhotoCheckbox.selectWidth - iconDiameter; + auto iconDiameter = st.checkbox.check.size; + auto iconLeft = x + userpicDiameter + st.checkbox.selectWidth - iconDiameter; + auto iconTop = y + userpicDiameter + st.checkbox.selectWidth - iconDiameter; auto iconEllipse = style::rtlrect(iconLeft, iconTop, iconDiameter, iconDiameter, outerWidth); - auto iconBorderPen = st::contactsPhotoCheckbox.check.border->p; - iconBorderPen.setWidth(st::contactsPhotoCheckbox.selectWidth); + auto iconBorderPen = st.checkbox.check.border->p; + iconBorderPen.setWidth(st.checkbox.selectWidth); if (_isSavedMessagesChat) { Ui::EmptyUserpic::PaintSavedMessages(p, userpicLeft, userpicTop, outerWidth, userpicRadius * 2); @@ -638,11 +655,11 @@ void PeerListRow::paintDisabledCheckUserpic( p.drawEllipse(userpicEllipse); p.setPen(iconBorderPen); - p.setBrush(st::contactsPhotoDisabledCheckFg); + p.setBrush(st.disabledCheckFg); p.drawEllipse(iconEllipse); } - st::contactsPhotoCheckbox.check.check.paint(p, iconEllipse.topLeft(), outerWidth); + st.checkbox.check.check.paint(p, iconEllipse.topLeft(), outerWidth); } void PeerListRow::setStatusText(const QString &text) { @@ -679,10 +696,9 @@ void PeerListRow::setCheckedInternal(bool checked, anim::type animated) { PeerListContent::PeerListContent( QWidget *parent, - not_null controller, - const style::PeerList &st) + not_null controller) : RpWidget(parent) -, _st(st) +, _st(controller->computeListSt()) , _controller(controller) , _rowHeight(_st.item.height) { _controller->session().downloaderTaskFinished( diff --git a/Telegram/SourceFiles/boxes/peer_list_box.h b/Telegram/SourceFiles/boxes/peer_list_box.h index fa263606fe..f5cedcbbce 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.h +++ b/Telegram/SourceFiles/boxes/peer_list_box.h @@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace style { struct PeerList; struct PeerListItem; +struct MultiSelect; } // namespace style namespace Main { @@ -371,6 +372,21 @@ public: prepare(); } + void setStyleOverrides( + const style::PeerList *listSt, + const style::MultiSelect *selectSt = nullptr) { + _listSt = listSt; + _selectSt = selectSt; + } + const style::PeerList *listSt() const { + return _listSt; + } + const style::MultiSelect *selectSt() const { + return _selectSt; + } + const style::PeerList &computeListSt() const; + const style::MultiSelect &computeSelectSt() const; + virtual void prepare() = 0; virtual void rowClicked(not_null row) = 0; virtual Main::Session &session() const = 0; @@ -457,6 +473,9 @@ private: PeerListDelegate *_delegate = nullptr; std::unique_ptr _searchController = nullptr; + const style::PeerList *_listSt = nullptr; + const style::MultiSelect *_selectSt = nullptr; + rpl::lifetime _lifetime; }; @@ -478,8 +497,7 @@ class PeerListContent public: PeerListContent( QWidget *parent, - not_null controller, - const style::PeerList &st); + not_null controller); void selectSkip(int direction); void selectSkipPage(int height, int direction); diff --git a/Telegram/SourceFiles/boxes/share_box.cpp b/Telegram/SourceFiles/boxes/share_box.cpp index da1dd35fba..1b24f3b068 100644 --- a/Telegram/SourceFiles/boxes/share_box.cpp +++ b/Telegram/SourceFiles/boxes/share_box.cpp @@ -166,7 +166,7 @@ ShareBox::ShareBox( , _filterCallback(std::move(filterCallback)) , _select( this, - st::contactsMultiSelect, + st::defaultMultiSelect, tr::lng_participant_filter()) , _comment( this, diff --git a/Telegram/SourceFiles/boxes/single_choice_box.cpp b/Telegram/SourceFiles/boxes/single_choice_box.cpp index 882b093a11..ea2cf9a105 100644 --- a/Telegram/SourceFiles/boxes/single_choice_box.cpp +++ b/Telegram/SourceFiles/boxes/single_choice_box.cpp @@ -21,11 +21,15 @@ SingleChoiceBox::SingleChoiceBox( rpl::producer title, const std::vector &optionTexts, int initialSelection, - Fn callback) + Fn callback, + const style::Checkbox *st, + const style::Radio *radioSt) : _title(std::move(title)) , _optionTexts(optionTexts) , _initialSelection(initialSelection) -, _callback(callback) { +, _callback(callback) +, _st(st ? *st : st::defaultBoxCheckbox) +, _radioSt(radioSt ? *radioSt : st::defaultRadio) { } void SingleChoiceBox::prepare() { @@ -47,7 +51,8 @@ void SingleChoiceBox::prepare() { group, i, text, - st::defaultBoxCheckbox), + _st, + _radioSt), QMargins( st::boxPadding.left() + st::boxOptionListPadding.left(), 0, diff --git a/Telegram/SourceFiles/boxes/single_choice_box.h b/Telegram/SourceFiles/boxes/single_choice_box.h index a5c93f5a6b..2a83c8e294 100644 --- a/Telegram/SourceFiles/boxes/single_choice_box.h +++ b/Telegram/SourceFiles/boxes/single_choice_box.h @@ -14,6 +14,10 @@ namespace Ui { class Radiobutton; } // namespace Ui +namespace style { +struct Checkbox; +} // namespace style + class SingleChoiceBox : public Ui::BoxContent { public: SingleChoiceBox( @@ -21,7 +25,9 @@ public: rpl::producer title, const std::vector &optionTexts, int initialSelection, - Fn callback); + Fn callback, + const style::Checkbox *st = nullptr, + const style::Radio *radioSt = nullptr); protected: void prepare() override; @@ -31,6 +37,8 @@ private: std::vector _optionTexts; int _initialSelection = 0; Fn _callback; + const style::Checkbox &_st; + const style::Radio &_radioSt; }; diff --git a/Telegram/SourceFiles/boxes/stickers_box.cpp b/Telegram/SourceFiles/boxes/stickers_box.cpp index 5ed95a24b4..37508535fd 100644 --- a/Telegram/SourceFiles/boxes/stickers_box.cpp +++ b/Telegram/SourceFiles/boxes/stickers_box.cpp @@ -1436,7 +1436,7 @@ void StickersBox::Inner::setPressed(SelectedRow pressed) { auto &set = _rows[pressedIndex]; auto rippleMask = Ui::RippleAnimation::rectMask(QSize(width(), _rowHeight)); if (!set->ripple) { - set->ripple = std::make_unique(st::contactsRipple, std::move(rippleMask), [this, pressedIndex] { + set->ripple = std::make_unique(st::defaultRippleAnimation, std::move(rippleMask), [this, pressedIndex] { update(0, _itemsTop + pressedIndex * _rowHeight, width(), _rowHeight); }); } diff --git a/Telegram/SourceFiles/calls/calls.style b/Telegram/SourceFiles/calls/calls.style index eedd87c6b5..77f2fa24ef 100644 --- a/Telegram/SourceFiles/calls/calls.style +++ b/Telegram/SourceFiles/calls/calls.style @@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL using "ui/basic.style"; using "ui/widgets/widgets.style"; +using "ui/layers/layers.style"; using "window/window.style"; CallSignalBars { @@ -408,32 +409,76 @@ groupCallHeight: 580px; groupCallRipple: RippleAnimation(defaultRippleAnimation) { color: groupCallMembersRipple; } -groupCallMembersList: PeerList(defaultPeerList) { - item: PeerListItem(defaultPeerListItem) { - button: OutlineButton(defaultPeerListButton) { - textBg: groupCallMembersBg; - textBgOver: groupCallMembersBg; +groupCallMembersListItem: PeerListItem(defaultPeerListItem) { + button: OutlineButton(defaultPeerListButton) { + textBg: groupCallMembersBg; + textBgOver: groupCallMembersBg; - textFg: groupCallMemberInactiveStatus; - textFgOver: groupCallMemberInactiveStatus; + textFg: groupCallMemberInactiveStatus; + textFgOver: groupCallMemberInactiveStatus; - font: normalFont; - padding: margins(11px, 5px, 11px, 5px); + font: normalFont; + padding: margins(11px, 5px, 11px, 5px); - ripple: groupCallRipple; + ripple: groupCallRipple; + } + disabledCheckFg: groupCallMemberNotJoinedStatus; + checkbox: RoundImageCheckbox(defaultPeerListCheckbox) { + selectFg: groupCallActiveFg; + check: RoundCheckbox(defaultPeerListCheck) { + border: groupCallMembersBg; + bgActive: groupCallActiveFg; + check: icon {{ "default_checkbox_check", groupCallMembersFg, point(3px, 6px) }}; } - height: 52px; - photoPosition: point(12px, 6px); - namePosition: point(68px, 7px); - statusPosition: point(68px, 26px); - photoSize: 40px; - nameFg: groupCallMembersFg; - nameFgChecked: groupCallMembersFg; - statusFg: groupCallMemberInactiveStatus; - statusFgOver: groupCallMemberInactiveStatus; - statusFgActive: groupCallMemberActiveStatus; + } + height: 52px; + photoPosition: point(12px, 6px); + namePosition: point(68px, 7px); + statusPosition: point(68px, 26px); + photoSize: 40px; + nameFg: groupCallMembersFg; + nameFgChecked: groupCallMembersFg; + statusFg: groupCallMemberInactiveStatus; + statusFgOver: groupCallMemberInactiveStatus; + statusFgActive: groupCallMemberActiveStatus; +} +groupCallMembersList: PeerList(defaultPeerList) { + bg: groupCallMembersBg; + about: FlatLabel(defaultPeerListAbout) { + textFg: groupCallMemberInactiveStatus; + } + item: groupCallMembersListItem; +} +groupCallInviteMembersList: PeerList(groupCallMembersList) { + item: PeerListItem(groupCallMembersListItem) { + statusFg: groupCallMemberNotJoinedStatus; + statusFgOver: groupCallMemberNotJoinedStatus; + statusFgActive: groupCallMemberInactiveStatus; } } +groupCallMultiSelect: MultiSelect(defaultMultiSelect) { + bg: groupCallMembersBg; + item: MultiSelectItem(defaultMultiSelectItem) { + textBg: groupCallMembersRipple; + textFg: groupCallMembersFg; + textActiveBg: groupCallActiveFg; + textActiveFg: groupCallMembersFg; + deleteFg: groupCallMembersFg; + } + field: InputField(defaultMultiSelectSearchField) { + textFg: groupCallMembersFg; + placeholderFg: groupCallMemberNotJoinedStatus; + placeholderFgActive: groupCallMemberNotJoinedStatus; + placeholderFgError: groupCallMemberNotJoinedStatus; + } + fieldIcon: icon {{ "box_search", groupCallMemberNotJoinedStatus, point(10px, 9px) }}; + fieldCancel: CrossButton(defaultMultiSelectSearchCancel) { + crossFg: groupCallMemberNotJoinedStatus; + crossFgOver: groupCallMemberNotJoinedStatus; + ripple: groupCallRipple; + } +} + groupCallMembersHeader: 47px; groupCallMembersMargin: margins(16px, 16px, 16px, 28px); groupCallAddMember: IconButton(defaultIconButton) { @@ -505,3 +550,76 @@ groupCallTopBarJoin: RoundButton(defaultActiveButton) { height: 28px; textTop: 5px; } +groupCallBox: Box(defaultBox) { + button: RoundButton(defaultBoxButton) { + textFg: groupCallActiveFg; + textFgOver: groupCallActiveFg; + numbersTextFg: groupCallActiveFg; + numbersTextFgOver: groupCallActiveFg; + textBg: groupCallMembersBg; + textBgOver: groupCallBoxButtonBgOver; + + ripple: RippleAnimation(defaultRippleAnimation) { + color: groupCallBoxButtonBgRipple; + } + } + margin: margins(0px, 56px, 0px, 10px); + bg: groupCallMembersBg; + title: FlatLabel(boxTitle) { + textFg: groupCallMembersFg; + } + titleAdditionalFg: groupCallMemberNotJoinedStatus; +} +groupCallLayerBox: Box(groupCallBox) { + buttonPadding: margins(8px, 8px, 8px, 8px); +} +groupCallLevelMeter: LevelMeter(defaultLevelMeter) { + height: 18px; + lineWidth: 3px; + lineSpacing: 5px; + lineCount: 44; + activeFg: groupCallActiveFg; + inactiveFg: groupCallMemberNotJoinedStatus; +} +groupCallCheckboxIcon: icon {{ "default_checkbox_check", groupCallMembersFg, point(4px, 7px) }}; +groupCallCheck: Check(defaultCheck) { + untoggledFg: groupCallMemberNotJoinedStatus; + toggledFg: groupCallActiveFg; + icon: groupCallCheckboxIcon; +} +groupCallRadio: Radio(defaultRadio) { + untoggledFg: groupCallMemberNotJoinedStatus; + toggledFg: groupCallActiveFg; +} +groupCallCheckbox: Checkbox(defaultBoxCheckbox) { + textFg: groupCallMembersFg; + textFgActive: groupCallMembersFg; + rippleBg: groupCallMembersRipple; + rippleBgActive: groupCallBoxButtonBgRipple; +} + +groupCallSettingsButton: SettingsButton { + textFg: groupCallMembersFg; + textFgOver: groupCallMembersFg; + textBg: groupCallMembersBg; + textBgOver: groupCallBoxButtonBgOver; + + font: boxTextFont; + rightLabel: FlatLabel(defaultSettingsRightLabel) { + textFg: groupCallActiveFg; + } + + height: 20px; + padding: margins(22px, 10px, 22px, 8px); + + ripple: RippleAnimation(defaultRippleAnimation) { + color: groupCallBoxButtonBgRipple; + } +} +groupCallSettingsAttentionButton: SettingsButton(groupCallSettingsButton) { + textFg: attentionButtonFg; + textFgOver: attentionButtonFgOver; +} +groupCallBoxLabel: FlatLabel(boxLabel) { + textFg: groupCallMembersFg; +} diff --git a/Telegram/SourceFiles/calls/calls_group_members.cpp b/Telegram/SourceFiles/calls/calls_group_members.cpp index 6b82e31f52..9531d08705 100644 --- a/Telegram/SourceFiles/calls/calls_group_members.cpp +++ b/Telegram/SourceFiles/calls/calls_group_members.cpp @@ -733,10 +733,11 @@ void GroupMembers::setupButtons(not_null call) { void GroupMembers::setupList() { auto topSkip = _header ? _header->height() : 0; + + _listController->setStyleOverrides(&st::groupCallMembersList); _list = _scroll->setOwnedWidget(object_ptr( this, - _listController.get(), - st::groupCallMembersList)); + _listController.get())); sizeValue( ) | rpl::start_with_next([=](QSize size) { diff --git a/Telegram/SourceFiles/calls/calls_group_panel.cpp b/Telegram/SourceFiles/calls/calls_group_panel.cpp index 143799ba5f..76a5eca1c7 100644 --- a/Telegram/SourceFiles/calls/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_group_panel.cpp @@ -173,16 +173,18 @@ void LeaveGroupCallBox( bool discardChecked, BoxContext context) { box->setTitle(tr::lng_group_call_leave_title()); + const auto inCall = (context == BoxContext::GroupCallPanel); box->addRow(object_ptr( box.get(), tr::lng_group_call_leave_sure(), - st::boxLabel)); + (inCall ? st::groupCallBoxLabel : st::boxLabel))); const auto discard = call->channel()->canManageCall() ? box->addRow(object_ptr( box.get(), tr::lng_group_call_end(), discardChecked, - st::defaultBoxCheckbox), + (inCall ? st::groupCallCheckbox : st::defaultBoxCheckbox), + (inCall ? st::groupCallCheck : st::defaultCheck)), style::margins( st::boxRowPadding.left(), st::boxRowPadding.left(), @@ -224,6 +226,8 @@ GroupPanel::GroupPanel(not_null call) .type = Ui::CallMuteButtonType::Connecting, })) , _hangup(widget(), st::callHangup) { + _layerBg->setStyleOverrides(&st::groupCallBox, &st::groupCallLayerBox); + initWindow(); initWidget(); initControls(); @@ -412,6 +416,10 @@ void GroupPanel::addMembers() { _channel, std::move(alreadyIn), real->fullCount()); + controller->setStyleOverrides( + &st::groupCallInviteMembersList, + &st::groupCallMultiSelect); + const auto weak = base::make_weak(_call); auto initBox = [=, controller = controller.get()]( not_null box) { diff --git a/Telegram/SourceFiles/calls/calls_group_settings.cpp b/Telegram/SourceFiles/calls/calls_group_settings.cpp index 58f78d3b2c..8e86943f6d 100644 --- a/Telegram/SourceFiles/calls/calls_group_settings.cpp +++ b/Telegram/SourceFiles/calls/calls_group_settings.cpp @@ -89,7 +89,9 @@ void GroupCallSettingsBox( ? box->addRow(object_ptr( box.get(), tr::lng_group_call_new_muted(), - joinMuted)) + joinMuted, + st::groupCallCheckbox, + st::groupCallCheck)) : nullptr; if (muteJoined) { AddSkip(layout); @@ -107,13 +109,13 @@ void GroupCallSettingsBox( ) | rpl::then( state->outputNameStream.events() ), - st::settingsButton + st::groupCallSettingsButton )->addClickHandler([=] { box->getDelegate()->show(ChooseAudioInputBox(crl::guard(box, [=]( const QString &id, const QString &name) { state->outputNameStream.fire_copy(name); - }))); + }), &st::groupCallCheckbox, &st::groupCallRadio)); }); AddButtonWithLabel( @@ -124,20 +126,20 @@ void GroupCallSettingsBox( ) | rpl::then( state->inputNameStream.events() ), - st::settingsButton + st::groupCallSettingsButton )->addClickHandler([=] { box->getDelegate()->show(ChooseAudioInputBox(crl::guard(box, [=]( const QString &id, const QString &name) { state->inputNameStream.fire_copy(name); state->micTester->setDeviceId(id); - }))); + }), &st::groupCallCheckbox, &st::groupCallRadio)); }); state->micTestLevel = box->addRow( object_ptr( box.get(), - st::defaultLevelMeter), + st::groupCallLevelMeter), st::settingsLevelMeterPadding); state->micTestLevel->resize(QSize(0, st::defaultLevelMeter.height)); @@ -174,7 +176,7 @@ void GroupCallSettingsBox( AddButton( layout, tr::lng_group_call_share(), - st::settingsButton + st::groupCallSettingsButton )->addClickHandler([=] { if (!copyLink() && !state->generatingLink) { state->generatingLink = true; @@ -195,7 +197,7 @@ void GroupCallSettingsBox( AddButton( layout, tr::lng_group_call_end(), - st::settingsAttentionButton + st::groupCallSettingsAttentionButton )->addClickHandler([=] { if (const auto call = weakCall.get()) { box->getDelegate()->show(Box( diff --git a/Telegram/SourceFiles/chat_helpers/chat_helpers.style b/Telegram/SourceFiles/chat_helpers/chat_helpers.style index 7c3cf04949..8b1f357ad0 100644 --- a/Telegram/SourceFiles/chat_helpers/chat_helpers.style +++ b/Telegram/SourceFiles/chat_helpers/chat_helpers.style @@ -231,9 +231,9 @@ inlineBotsScroll: ScrollArea(defaultSolidScroll) { deltab: stickerPanPadding; } -gifsSearchField: contactsSearchField; +gifsSearchField: defaultMultiSelectSearchField; gifsSearchFieldPosition: point(42px, 7px); -gifsSearchCancel: contactsSearchCancel; +gifsSearchCancel: defaultMultiSelectSearchCancel; gifsSearchCancelPosition: point(1px, 1px); gifsSearchIcon: boxFieldSearchIcon; gifsSearchIconPosition: point(6px, 7px); diff --git a/Telegram/SourceFiles/chat_helpers/emoji_sets_manager.cpp b/Telegram/SourceFiles/chat_helpers/emoji_sets_manager.cpp index c6e37779ec..2fc1331c2d 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_sets_manager.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_sets_manager.cpp @@ -221,7 +221,7 @@ void Inner::setupContent() { } Row::Row(QWidget *widget, not_null session, const Set &set) -: RippleButton(widget, st::contactsRipple) +: RippleButton(widget, st::defaultRippleAnimation) , _session(session) , _id(set.id) , _state(Available{ set.size }) { diff --git a/Telegram/SourceFiles/data/data_group_call.cpp b/Telegram/SourceFiles/data/data_group_call.cpp index 976c6447be..85d58eb32e 100644 --- a/Telegram/SourceFiles/data/data_group_call.cpp +++ b/Telegram/SourceFiles/data/data_group_call.cpp @@ -180,9 +180,6 @@ void GroupCall::reload() { void GroupCall::applyParticipantsSlice( const QVector &list, ApplySliceSource sliceSource) { - if (sliceSource != ApplySliceSource::UnknownLoaded) { - return; - } auto changedCount = _fullCount.current(); for (const auto &participant : list) { participant.match([&](const MTPDgroupCallParticipant &data) { diff --git a/Telegram/SourceFiles/info/common_groups/info_common_groups_inner_widget.cpp b/Telegram/SourceFiles/info/common_groups/info_common_groups_inner_widget.cpp index f1905b0001..fca98f1b6f 100644 --- a/Telegram/SourceFiles/info/common_groups/info_common_groups_inner_widget.cpp +++ b/Telegram/SourceFiles/info/common_groups/info_common_groups_inner_widget.cpp @@ -213,10 +213,10 @@ int InnerWidget::desiredHeight() const { object_ptr InnerWidget::setupList( RpWidget *parent, not_null controller) const { + controller->setStyleOverrides(&st::infoCommonGroupsList); auto result = object_ptr( parent, - controller, - st::infoCommonGroupsList); + controller); result->scrollToRequests( ) | rpl::start_with_next([this](Ui::ScrollToRequest request) { auto addmin = (request.ymin < 0) diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index cfaa8bbe74..d311f6fe10 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -44,14 +44,14 @@ infoScroll: ScrollArea(defaultScrollArea) { infoMediaSearch: SearchFieldRow { height: 44px; padding: margins(8px, 6px, 8px, 6px); - field: contactsSearchField; + field: defaultMultiSelectSearchField; fieldIcon: icon {{ "box_search-flip_horizontal", menuIconFg, point(6px, 8px) }}; fieldIconSkip: 36px; - fieldCancel: contactsSearchCancel; + fieldCancel: defaultMultiSelectSearchCancel; fieldCancelSkip: 40px; } infoLayerMediaSearch: SearchFieldRow(infoMediaSearch) { @@ -62,7 +62,7 @@ infoLayerMediaSearch: SearchFieldRow(infoMediaSearch) { point(9px, 9px) }}; fieldIconSkip: 34px; - fieldCancel: CrossButton(contactsSearchCancel) { + fieldCancel: CrossButton(defaultMultiSelectSearchCancel) { width: 50px; cross: CrossAnimation { size: 38px; @@ -77,7 +77,7 @@ infoLayerMediaSearch: SearchFieldRow(infoMediaSearch) { infoTopBarSearchRow: SearchFieldRow(infoLayerMediaSearch) { height: 52px; padding: margins(0px, 12px, 8px, 10px); - fieldCancel: CrossButton(contactsSearchCancel) { + fieldCancel: CrossButton(defaultMultiSelectSearchCancel) { width: 51px; height: 52px; cross: CrossAnimation { @@ -402,7 +402,7 @@ infoProfileToggle: Toggle(defaultToggle) { infoProfileToggleOver: Toggle(infoProfileToggle) { untoggledFg: menuIconFgOver; } -infoProfileButton: SettingsButton { +infoProfileButton: SettingsButton(defaultSettingsButton) { textFg: windowBoldFg; textFgOver: windowBoldFgOver; textBg: windowBg; @@ -496,7 +496,7 @@ infoMembersSearchActiveLayer: icon { infoMembersButtonIconPosition } }; -infoMembersSearchField: InputField(contactsSearchField) { +infoMembersSearchField: InputField(defaultMultiSelectSearchField) { } infoMembersCancelSearch: CrossButton { width: 44px; diff --git a/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp b/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp index 2a6345fd14..8f1a52fd69 100644 --- a/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp +++ b/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp @@ -501,10 +501,10 @@ ListController *CreateAnswerRows( container, st::boxLittleSkip)); + controller->setStyleOverrides(&st::infoCommonGroupsList); const auto content = container->add(object_ptr( container, - controller, - st::infoCommonGroupsList)); + controller)); delegate->setContent(content); controller->setDelegate(delegate); diff --git a/Telegram/SourceFiles/info/profile/info_profile_members.cpp b/Telegram/SourceFiles/info/profile/info_profile_members.cpp index 0f3d573016..d95ed2d0b4 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_members.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_members.cpp @@ -212,10 +212,10 @@ void Members::setupButtons() { void Members::setupList() { auto topSkip = _header ? _header->height() : 0; + _listController->setStyleOverrides(&st::infoMembersList); _list = object_ptr( this, - _listController.get(), - st::infoMembersList); + _listController.get()); _list->scrollToRequests( ) | rpl::start_with_next([this](Ui::ScrollToRequest request) { auto addmin = (request.ymin < 0 || !_header) diff --git a/Telegram/SourceFiles/overview/overview.style b/Telegram/SourceFiles/overview/overview.style index 818d39ce91..5cdcd40f10 100644 --- a/Telegram/SourceFiles/overview/overview.style +++ b/Telegram/SourceFiles/overview/overview.style @@ -47,7 +47,7 @@ overviewCheck: RoundCheckbox(defaultRoundCheckbox) { sizeSmall: 0.3; check: icon {{ "overview_photo_check", overviewCheckFgActive, point(4px, 8px) }}; } -overviewSmallCheck: RoundCheckbox(contactsPhotoCheck) { +overviewSmallCheck: RoundCheckbox(defaultPeerListCheck) { border: overviewCheckBorder; } overviewCheckSkip: 5px; diff --git a/Telegram/SourceFiles/passport/passport.style b/Telegram/SourceFiles/passport/passport.style index 8e68110902..81b7b1cf65 100644 --- a/Telegram/SourceFiles/passport/passport.style +++ b/Telegram/SourceFiles/passport/passport.style @@ -123,7 +123,7 @@ passportRowTitleFg: windowFg; passportRowDescriptionFg: windowSubTextFg; passportScansHeaderPadding: margins(22px, 10px, 22px, 10px); -passportUploadButton: SettingsButton { +passportUploadButton: SettingsButton(defaultSettingsButton) { textFg: windowActiveTextFg; textFgOver: windowActiveTextFg; textBg: windowBg; diff --git a/Telegram/SourceFiles/settings/settings.style b/Telegram/SourceFiles/settings/settings.style index 509e1e706b..d2582c0c34 100644 --- a/Telegram/SourceFiles/settings/settings.style +++ b/Telegram/SourceFiles/settings/settings.style @@ -25,11 +25,6 @@ settingsSectionSkip: 9px; settingsSectionIconLeft: 22px; settingsSeparatorPadding: margins(22px, infoProfileSkip, 0px, infoProfileSkip); settingsButtonRightSkip: 28px; -settingsButtonRight: FlatLabel(defaultFlatLabel) { - textFg: windowActiveTextFg; - style: boxTextStyle; - maxHeight: 20px; -} settingsScalePadding: margins(79px, 10px, 28px, 8px); settingsBigScalePadding: margins(22px, 10px, 22px, 8px); settingsSlider: SettingsSlider(defaultSettingsSlider) { diff --git a/Telegram/SourceFiles/settings/settings_calls.cpp b/Telegram/SourceFiles/settings/settings_calls.cpp index 06dce8a624..7118f4139d 100644 --- a/Telegram/SourceFiles/settings/settings_calls.cpp +++ b/Telegram/SourceFiles/settings/settings_calls.cpp @@ -327,7 +327,9 @@ QString CurrentAudioInputName() { } object_ptr ChooseAudioOutputBox( - Fn chosen) { + Fn chosen, + const style::Checkbox *st, + const style::Radio *radioSt) { const auto &devices = Webrtc::GetAudioOutputList(); const auto options = ranges::view::concat( ranges::view::single(tr::lng_settings_call_device_default(tr::now)), @@ -351,11 +353,15 @@ object_ptr ChooseAudioOutputBox( tr::lng_settings_call_output_device(), options, currentOption, - save); + save, + st, + radioSt); } object_ptr ChooseAudioInputBox( - Fn chosen) { + Fn chosen, + const style::Checkbox *st, + const style::Radio *radioSt) { const auto devices = Webrtc::GetAudioInputList(); const auto options = ranges::view::concat( ranges::view::single(tr::lng_settings_call_device_default(tr::now)), @@ -379,7 +385,9 @@ object_ptr ChooseAudioInputBox( tr::lng_settings_call_input_device(), options, currentOption, - save); + save, + st, + radioSt); } } // namespace Settings diff --git a/Telegram/SourceFiles/settings/settings_calls.h b/Telegram/SourceFiles/settings/settings_calls.h index 73c8cf9c11..db298f7469 100644 --- a/Telegram/SourceFiles/settings/settings_calls.h +++ b/Telegram/SourceFiles/settings/settings_calls.h @@ -11,6 +11,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/effects/animations.h" #include "base/timer.h" +namespace style { +struct Checkbox; +struct Radio; +} // namespace style + namespace Calls { class Call; } // namespace Calls @@ -57,9 +62,13 @@ inline constexpr auto kMicTestAnimationDuration = crl::time(200); [[nodiscard]] QString CurrentAudioOutputName(); [[nodiscard]] QString CurrentAudioInputName(); [[nodiscard]] object_ptr ChooseAudioOutputBox( - Fn chosen); + Fn chosen, + const style::Checkbox *st = nullptr, + const style::Radio *radioSt = nullptr); [[nodiscard]] object_ptr ChooseAudioInputBox( - Fn chosen); + Fn chosen, + const style::Checkbox *st = nullptr, + const style::Radio *radioSt = nullptr); } // namespace Settings diff --git a/Telegram/SourceFiles/settings/settings_common.cpp b/Telegram/SourceFiles/settings/settings_common.cpp index 0b6dc0390a..43951b443b 100644 --- a/Telegram/SourceFiles/settings/settings_common.cpp +++ b/Telegram/SourceFiles/settings/settings_common.cpp @@ -137,7 +137,7 @@ void CreateRightLabel( rpl::producer buttonText) { const auto name = Ui::CreateChild( button.get(), - st::settingsButtonRight); + st.rightLabel); rpl::combine( button->widthValue(), std::move(buttonText), diff --git a/Telegram/SourceFiles/ui/countryinput.cpp b/Telegram/SourceFiles/ui/countryinput.cpp index 99ae478d8c..446a819f1e 100644 --- a/Telegram/SourceFiles/ui/countryinput.cpp +++ b/Telegram/SourceFiles/ui/countryinput.cpp @@ -148,12 +148,12 @@ void CountryInput::setText(const QString &newText) { } CountrySelectBox::CountrySelectBox(QWidget*) -: _select(this, st::contactsMultiSelect, tr::lng_country_ph()) { +: _select(this, st::defaultMultiSelect, tr::lng_country_ph()) { } CountrySelectBox::CountrySelectBox(QWidget*, const QString &iso, Type type) : _type(type) -, _select(this, st::contactsMultiSelect, tr::lng_country_ph()) { +, _select(this, st::defaultMultiSelect, tr::lng_country_ph()) { if (Data::CountriesByISO2().contains(iso)) { LastValidISO = iso; } diff --git a/Telegram/SourceFiles/ui/widgets/level_meter.h b/Telegram/SourceFiles/ui/widgets/level_meter.h index d279af4a29..4fe15b7f47 100644 --- a/Telegram/SourceFiles/ui/widgets/level_meter.h +++ b/Telegram/SourceFiles/ui/widgets/level_meter.h @@ -14,7 +14,7 @@ namespace Ui { class LevelMeter : public RpWidget { public: - LevelMeter(QWidget *parent, const style::LevelMeter& st); + LevelMeter(QWidget *parent, const style::LevelMeter &st); void setValue(float value); diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor.cpp index ef6e3d3a0f..58fe1adade 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor.cpp @@ -650,9 +650,9 @@ Editor::Editor( : _window(window) , _cloud(cloud) , _scroll(this, st::themesScroll) -, _close(this, st::contactsMultiSelect.fieldCancel) +, _close(this, st::defaultMultiSelect.fieldCancel) , _menuToggle(this, st::themesMenuToggle) -, _select(this, st::contactsMultiSelect, tr::lng_country_ph()) +, _select(this, st::defaultMultiSelect, tr::lng_country_ph()) , _leftShadow(this) , _topShadow(this) , _save(this, tr::lng_theme_editor_save_button(tr::now).toUpper(), st::dialogsUpdateButton) { diff --git a/Telegram/SourceFiles/window/window.style b/Telegram/SourceFiles/window/window.style index 3b3577e080..854c5df4ba 100644 --- a/Telegram/SourceFiles/window/window.style +++ b/Telegram/SourceFiles/window/window.style @@ -233,7 +233,7 @@ windowOutdatedClose: IconButton(defaultIconButton) { iconPosition: point(-1px, -1px); } -createThemeImportButton: SettingsButton { +createThemeImportButton: SettingsButton(defaultSettingsButton) { textFg: lightButtonFg; textFgOver: lightButtonFgOver; textBg: windowBg; diff --git a/Telegram/SourceFiles/window/window_media_preview.cpp b/Telegram/SourceFiles/window/window_media_preview.cpp index bb2c97e1ff..881ed48133 100644 --- a/Telegram/SourceFiles/window/window_media_preview.cpp +++ b/Telegram/SourceFiles/window/window_media_preview.cpp @@ -208,7 +208,8 @@ QSize MediaPreviewWidget::currentDimensions() const { QSize result, box; if (_photo) { result = QSize(_photo->width(), _photo->height()); - box = QSize(width() - 2 * st::boxVerticalMargin, height() - 2 * st::boxVerticalMargin); + const auto skip = st::defaultBox.margin.top(); + box = QSize(width() - 2 * skip, height() - 2 * skip); } else { result = _document->dimensions; if (result.isEmpty()) { diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 41bae1eba6..7287e235e0 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 41bae1eba67801eb8768887100c17b7e84e7daf7 +Subproject commit 7287e235e0205fd878cd35329d08aa1aa1c218fa