mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02:00
Use separate styles for group call boxes.
This commit is contained in:
parent
e66ad89a2a
commit
d40768f6b0
34 changed files with 300 additions and 182 deletions
|
@ -153,74 +153,6 @@ contactsAboutFg: windowSubTextFgOver;
|
||||||
contactsAboutTop: 60px;
|
contactsAboutTop: 60px;
|
||||||
contactsAboutBottom: 19px;
|
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;
|
contactsMarginTop: 4px;
|
||||||
contactsMarginBottom: 4px;
|
contactsMarginBottom: 4px;
|
||||||
membersMarginTop: 10px;
|
membersMarginTop: 10px;
|
||||||
|
@ -241,7 +173,7 @@ peerListBox: PeerList(defaultPeerList) {
|
||||||
button: OutlineButton(defaultPeerListButton) {
|
button: OutlineButton(defaultPeerListButton) {
|
||||||
textBg: contactsBg;
|
textBg: contactsBg;
|
||||||
textBgOver: contactsBgOver;
|
textBgOver: contactsBgOver;
|
||||||
ripple: contactsRipple;
|
ripple: defaultRippleAnimation;
|
||||||
}
|
}
|
||||||
statusFg: contactsStatusFg;
|
statusFg: contactsStatusFg;
|
||||||
statusFgOver: contactsStatusFgOver;
|
statusFgOver: contactsStatusFgOver;
|
||||||
|
@ -282,7 +214,7 @@ localStorageLimitMargin: margins(22px, 5px, 20px, 10px);
|
||||||
shareRowsTop: 12px;
|
shareRowsTop: 12px;
|
||||||
shareRowHeight: 108px;
|
shareRowHeight: 108px;
|
||||||
sharePhotoTop: 6px;
|
sharePhotoTop: 6px;
|
||||||
sharePhotoCheckbox: RoundImageCheckbox(contactsPhotoCheckbox) {
|
sharePhotoCheckbox: RoundImageCheckbox(defaultPeerListCheckbox) {
|
||||||
imageRadius: 28px;
|
imageRadius: 28px;
|
||||||
imageSmallRadius: 24px;
|
imageSmallRadius: 24px;
|
||||||
}
|
}
|
||||||
|
@ -697,10 +629,10 @@ muteChatTitle: FlatLabel(boxLabel) {
|
||||||
}
|
}
|
||||||
muteChatTitleLeft: 50px;
|
muteChatTitleLeft: 50px;
|
||||||
|
|
||||||
groupStickersRemove: contactsSearchCancel;
|
groupStickersRemove: defaultMultiSelectSearchCancel;
|
||||||
groupStickersRemovePosition: point(6px, 6px);
|
groupStickersRemovePosition: point(6px, 6px);
|
||||||
groupStickersFieldPadding: margins(8px, 6px, 8px, 6px);
|
groupStickersFieldPadding: margins(8px, 6px, 8px, 6px);
|
||||||
groupStickersField: InputField(contactsSearchField) {
|
groupStickersField: InputField(defaultMultiSelectSearchField) {
|
||||||
placeholderFont: boxTextFont;
|
placeholderFont: boxTextFont;
|
||||||
font: boxTextFont;
|
font: boxTextFont;
|
||||||
placeholderMargins: margins(0px, 0px, 0px, 0px);
|
placeholderMargins: margins(0px, 0px, 0px, 0px);
|
||||||
|
@ -960,7 +892,7 @@ pollResultsVotesCount: FlatLabel(defaultFlatLabel) {
|
||||||
textFg: windowSubTextFg;
|
textFg: windowSubTextFg;
|
||||||
}
|
}
|
||||||
pollResultsHeaderPadding: margins(22px, 22px, 22px, 8px);
|
pollResultsHeaderPadding: margins(22px, 22px, 22px, 8px);
|
||||||
pollResultsShowMore: SettingsButton {
|
pollResultsShowMore: SettingsButton(defaultSettingsButton) {
|
||||||
textFg: lightButtonFg;
|
textFg: lightButtonFg;
|
||||||
textFgOver: lightButtonFgOver;
|
textFgOver: lightButtonFgOver;
|
||||||
textBg: windowBg;
|
textBg: windowBg;
|
||||||
|
|
|
@ -91,7 +91,7 @@ QString StateDescription(const DictState &state) {
|
||||||
auto CreateMultiSelect(QWidget *parent) {
|
auto CreateMultiSelect(QWidget *parent) {
|
||||||
const auto result = Ui::CreateChild<Ui::MultiSelect>(
|
const auto result = Ui::CreateChild<Ui::MultiSelect>(
|
||||||
parent,
|
parent,
|
||||||
st::contactsMultiSelect,
|
st::defaultMultiSelect,
|
||||||
tr::lng_participant_filter());
|
tr::lng_participant_filter());
|
||||||
|
|
||||||
result->resizeToWidth(st::boxWidth);
|
result->resizeToWidth(st::boxWidth);
|
||||||
|
|
|
@ -423,10 +423,10 @@ object_ptr<Ui::RpWidget> EditFilterChatsListController::prepareTypesList() {
|
||||||
&session(),
|
&session(),
|
||||||
_options,
|
_options,
|
||||||
_selected);
|
_selected);
|
||||||
|
controller->setStyleOverrides(&st::windowFilterSmallList);
|
||||||
const auto content = result->add(object_ptr<PeerListContent>(
|
const auto content = result->add(object_ptr<PeerListContent>(
|
||||||
container,
|
container,
|
||||||
controller,
|
controller));
|
||||||
st::windowFilterSmallList));
|
|
||||||
delegate->setContent(content);
|
delegate->setContent(content);
|
||||||
controller->setDelegate(delegate);
|
controller->setDelegate(delegate);
|
||||||
for (const auto flag : kAllTypes) {
|
for (const auto flag : kAllTypes) {
|
||||||
|
|
|
@ -880,7 +880,7 @@ void Content::setupContent(
|
||||||
const auto inner = wrap->entity();
|
const auto inner = wrap->entity();
|
||||||
inner->add(object_ptr<Ui::FixedHeightWidget>(
|
inner->add(object_ptr<Ui::FixedHeightWidget>(
|
||||||
inner,
|
inner,
|
||||||
st::boxVerticalMargin));
|
st::defaultBox.margin.top()));
|
||||||
const auto rows = inner->add(object_ptr<Rows>(
|
const auto rows = inner->add(object_ptr<Rows>(
|
||||||
inner,
|
inner,
|
||||||
list,
|
list,
|
||||||
|
@ -888,7 +888,7 @@ void Content::setupContent(
|
||||||
areOfficial));
|
areOfficial));
|
||||||
inner->add(object_ptr<Ui::FixedHeightWidget>(
|
inner->add(object_ptr<Ui::FixedHeightWidget>(
|
||||||
inner,
|
inner,
|
||||||
st::boxVerticalMargin));
|
st::defaultBox.margin.top()));
|
||||||
|
|
||||||
rows->isEmpty() | rpl::start_with_next([=](bool empty) {
|
rows->isEmpty() | rpl::start_with_next([=](bool empty) {
|
||||||
wrap->toggle(!empty, anim::type::instant);
|
wrap->toggle(!empty, anim::type::instant);
|
||||||
|
@ -1153,7 +1153,7 @@ void LanguageBox::setInnerFocus() {
|
||||||
not_null<Ui::MultiSelect*> LanguageBox::createMultiSelect() {
|
not_null<Ui::MultiSelect*> LanguageBox::createMultiSelect() {
|
||||||
const auto result = Ui::CreateChild<Ui::MultiSelect>(
|
const auto result = Ui::CreateChild<Ui::MultiSelect>(
|
||||||
this,
|
this,
|
||||||
st::contactsMultiSelect,
|
st::defaultMultiSelect,
|
||||||
tr::lng_participant_filter());
|
tr::lng_participant_filter());
|
||||||
result->resizeToWidth(st::boxWidth);
|
result->resizeToWidth(st::boxWidth);
|
||||||
result->moveToLeft(0, 0);
|
result->moveToLeft(0, 0);
|
||||||
|
|
|
@ -360,7 +360,7 @@ void LocalStorageBox::clearByTag(uint16 tag) {
|
||||||
void LocalStorageBox::setupControls() {
|
void LocalStorageBox::setupControls() {
|
||||||
const auto container = setInnerWidget(
|
const auto container = setInnerWidget(
|
||||||
object_ptr<Ui::VerticalLayout>(this),
|
object_ptr<Ui::VerticalLayout>(this),
|
||||||
st::contactsMultiSelect.scroll);
|
st::defaultMultiSelect.scroll);
|
||||||
const auto createRow = [&](
|
const auto createRow = [&](
|
||||||
uint16 tag,
|
uint16 tag,
|
||||||
Fn<QString(size_type)> title,
|
Fn<QString(size_type)> title,
|
||||||
|
|
|
@ -67,7 +67,9 @@ void PeerListBox::createMultiSelect() {
|
||||||
|
|
||||||
auto entity = object_ptr<Ui::MultiSelect>(
|
auto entity = object_ptr<Ui::MultiSelect>(
|
||||||
this,
|
this,
|
||||||
st::contactsMultiSelect,
|
(_controller->selectSt()
|
||||||
|
? *_controller->selectSt()
|
||||||
|
: st::defaultMultiSelect),
|
||||||
tr::lng_participant_filter());
|
tr::lng_participant_filter());
|
||||||
_select.create(this, std::move(entity));
|
_select.create(this, std::move(entity));
|
||||||
_select->heightValue(
|
_select->heightValue(
|
||||||
|
@ -117,8 +119,7 @@ void PeerListBox::prepare() {
|
||||||
setContent(setInnerWidget(
|
setContent(setInnerWidget(
|
||||||
object_ptr<PeerListContent>(
|
object_ptr<PeerListContent>(
|
||||||
this,
|
this,
|
||||||
_controller.get(),
|
_controller.get()),
|
||||||
st::peerListBox),
|
|
||||||
st::boxScroll));
|
st::boxScroll));
|
||||||
content()->resizeToWidth(_controller->contentWidth());
|
content()->resizeToWidth(_controller->contentWidth());
|
||||||
|
|
||||||
|
@ -178,8 +179,12 @@ void PeerListBox::resizeEvent(QResizeEvent *e) {
|
||||||
|
|
||||||
void PeerListBox::paintEvent(QPaintEvent *e) {
|
void PeerListBox::paintEvent(QPaintEvent *e) {
|
||||||
Painter p(this);
|
Painter p(this);
|
||||||
|
|
||||||
|
const auto &bg = (_controller->listSt()
|
||||||
|
? *_controller->listSt()
|
||||||
|
: st::peerListBox).bg;
|
||||||
for (const auto rect : e->region()) {
|
for (const auto rect : e->region()) {
|
||||||
p.fillRect(rect, st::contactsBg);
|
p.fillRect(rect, bg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,6 +253,14 @@ PeerListController::PeerListController(std::unique_ptr<PeerListSearchController>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 {
|
bool PeerListController::hasComplexSearch() const {
|
||||||
return (_searchController != nullptr);
|
return (_searchController != nullptr);
|
||||||
}
|
}
|
||||||
|
@ -279,7 +292,8 @@ void PeerListController::setDescriptionText(const QString &text) {
|
||||||
if (text.isEmpty()) {
|
if (text.isEmpty()) {
|
||||||
setDescription(nullptr);
|
setDescription(nullptr);
|
||||||
} else {
|
} else {
|
||||||
setDescription(object_ptr<Ui::FlatLabel>(nullptr, text, st::membersAbout));
|
const auto &st = _listSt ? *_listSt : st::peerListBox;
|
||||||
|
setDescription(object_ptr<Ui::FlatLabel>(nullptr, text, computeListSt().about));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,17 +367,20 @@ void PeerListBox::addSelectItem(
|
||||||
createMultiSelect();
|
createMultiSelect();
|
||||||
_select->hide(anim::type::instant);
|
_select->hide(anim::type::instant);
|
||||||
}
|
}
|
||||||
|
const auto &activeBg = (_controller->selectSt()
|
||||||
|
? *_controller->selectSt()
|
||||||
|
: st::defaultMultiSelect).item.textActiveBg;
|
||||||
if (animated == anim::type::instant) {
|
if (animated == anim::type::instant) {
|
||||||
_select->entity()->addItemInBunch(
|
_select->entity()->addItemInBunch(
|
||||||
itemId,
|
itemId,
|
||||||
text,
|
text,
|
||||||
st::activeButtonBg,
|
activeBg,
|
||||||
std::move(paintUserpic));
|
std::move(paintUserpic));
|
||||||
} else {
|
} else {
|
||||||
_select->entity()->addItem(
|
_select->entity()->addItem(
|
||||||
itemId,
|
itemId,
|
||||||
text,
|
text,
|
||||||
st::activeButtonBg,
|
activeBg,
|
||||||
std::move(paintUserpic));
|
std::move(paintUserpic));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -606,21 +623,21 @@ void PeerListRow::paintDisabledCheckUserpic(
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int outerWidth) const {
|
int outerWidth) const {
|
||||||
auto userpicRadius = st::contactsPhotoCheckbox.imageSmallRadius;
|
auto userpicRadius = st.checkbox.imageSmallRadius;
|
||||||
auto userpicShift = st::contactsPhotoCheckbox.imageRadius - userpicRadius;
|
auto userpicShift = st.checkbox.imageRadius - userpicRadius;
|
||||||
auto userpicDiameter = st::contactsPhotoCheckbox.imageRadius * 2;
|
auto userpicDiameter = st.checkbox.imageRadius * 2;
|
||||||
auto userpicLeft = x + userpicShift;
|
auto userpicLeft = x + userpicShift;
|
||||||
auto userpicTop = y + userpicShift;
|
auto userpicTop = y + userpicShift;
|
||||||
auto userpicEllipse = style::rtlrect(x, y, userpicDiameter, userpicDiameter, outerWidth);
|
auto userpicEllipse = style::rtlrect(x, y, userpicDiameter, userpicDiameter, outerWidth);
|
||||||
auto userpicBorderPen = st::contactsPhotoDisabledCheckFg->p;
|
auto userpicBorderPen = st.disabledCheckFg->p;
|
||||||
userpicBorderPen.setWidth(st::contactsPhotoCheckbox.selectWidth);
|
userpicBorderPen.setWidth(st.checkbox.selectWidth);
|
||||||
|
|
||||||
auto iconDiameter = st::contactsPhotoCheckbox.check.size;
|
auto iconDiameter = st.checkbox.check.size;
|
||||||
auto iconLeft = x + userpicDiameter + st::contactsPhotoCheckbox.selectWidth - iconDiameter;
|
auto iconLeft = x + userpicDiameter + st.checkbox.selectWidth - iconDiameter;
|
||||||
auto iconTop = y + userpicDiameter + st::contactsPhotoCheckbox.selectWidth - iconDiameter;
|
auto iconTop = y + userpicDiameter + st.checkbox.selectWidth - iconDiameter;
|
||||||
auto iconEllipse = style::rtlrect(iconLeft, iconTop, iconDiameter, iconDiameter, outerWidth);
|
auto iconEllipse = style::rtlrect(iconLeft, iconTop, iconDiameter, iconDiameter, outerWidth);
|
||||||
auto iconBorderPen = st::contactsPhotoCheckbox.check.border->p;
|
auto iconBorderPen = st.checkbox.check.border->p;
|
||||||
iconBorderPen.setWidth(st::contactsPhotoCheckbox.selectWidth);
|
iconBorderPen.setWidth(st.checkbox.selectWidth);
|
||||||
|
|
||||||
if (_isSavedMessagesChat) {
|
if (_isSavedMessagesChat) {
|
||||||
Ui::EmptyUserpic::PaintSavedMessages(p, userpicLeft, userpicTop, outerWidth, userpicRadius * 2);
|
Ui::EmptyUserpic::PaintSavedMessages(p, userpicLeft, userpicTop, outerWidth, userpicRadius * 2);
|
||||||
|
@ -638,11 +655,11 @@ void PeerListRow::paintDisabledCheckUserpic(
|
||||||
p.drawEllipse(userpicEllipse);
|
p.drawEllipse(userpicEllipse);
|
||||||
|
|
||||||
p.setPen(iconBorderPen);
|
p.setPen(iconBorderPen);
|
||||||
p.setBrush(st::contactsPhotoDisabledCheckFg);
|
p.setBrush(st.disabledCheckFg);
|
||||||
p.drawEllipse(iconEllipse);
|
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) {
|
void PeerListRow::setStatusText(const QString &text) {
|
||||||
|
@ -679,10 +696,9 @@ void PeerListRow::setCheckedInternal(bool checked, anim::type animated) {
|
||||||
|
|
||||||
PeerListContent::PeerListContent(
|
PeerListContent::PeerListContent(
|
||||||
QWidget *parent,
|
QWidget *parent,
|
||||||
not_null<PeerListController*> controller,
|
not_null<PeerListController*> controller)
|
||||||
const style::PeerList &st)
|
|
||||||
: RpWidget(parent)
|
: RpWidget(parent)
|
||||||
, _st(st)
|
, _st(controller->computeListSt())
|
||||||
, _controller(controller)
|
, _controller(controller)
|
||||||
, _rowHeight(_st.item.height) {
|
, _rowHeight(_st.item.height) {
|
||||||
_controller->session().downloaderTaskFinished(
|
_controller->session().downloaderTaskFinished(
|
||||||
|
|
|
@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
namespace style {
|
namespace style {
|
||||||
struct PeerList;
|
struct PeerList;
|
||||||
struct PeerListItem;
|
struct PeerListItem;
|
||||||
|
struct MultiSelect;
|
||||||
} // namespace style
|
} // namespace style
|
||||||
|
|
||||||
namespace Main {
|
namespace Main {
|
||||||
|
@ -371,6 +372,21 @@ public:
|
||||||
prepare();
|
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 prepare() = 0;
|
||||||
virtual void rowClicked(not_null<PeerListRow*> row) = 0;
|
virtual void rowClicked(not_null<PeerListRow*> row) = 0;
|
||||||
virtual Main::Session &session() const = 0;
|
virtual Main::Session &session() const = 0;
|
||||||
|
@ -457,6 +473,9 @@ private:
|
||||||
PeerListDelegate *_delegate = nullptr;
|
PeerListDelegate *_delegate = nullptr;
|
||||||
std::unique_ptr<PeerListSearchController> _searchController = nullptr;
|
std::unique_ptr<PeerListSearchController> _searchController = nullptr;
|
||||||
|
|
||||||
|
const style::PeerList *_listSt = nullptr;
|
||||||
|
const style::MultiSelect *_selectSt = nullptr;
|
||||||
|
|
||||||
rpl::lifetime _lifetime;
|
rpl::lifetime _lifetime;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -478,8 +497,7 @@ class PeerListContent
|
||||||
public:
|
public:
|
||||||
PeerListContent(
|
PeerListContent(
|
||||||
QWidget *parent,
|
QWidget *parent,
|
||||||
not_null<PeerListController*> controller,
|
not_null<PeerListController*> controller);
|
||||||
const style::PeerList &st);
|
|
||||||
|
|
||||||
void selectSkip(int direction);
|
void selectSkip(int direction);
|
||||||
void selectSkipPage(int height, int direction);
|
void selectSkipPage(int height, int direction);
|
||||||
|
|
|
@ -166,7 +166,7 @@ ShareBox::ShareBox(
|
||||||
, _filterCallback(std::move(filterCallback))
|
, _filterCallback(std::move(filterCallback))
|
||||||
, _select(
|
, _select(
|
||||||
this,
|
this,
|
||||||
st::contactsMultiSelect,
|
st::defaultMultiSelect,
|
||||||
tr::lng_participant_filter())
|
tr::lng_participant_filter())
|
||||||
, _comment(
|
, _comment(
|
||||||
this,
|
this,
|
||||||
|
|
|
@ -21,11 +21,15 @@ SingleChoiceBox::SingleChoiceBox(
|
||||||
rpl::producer<QString> title,
|
rpl::producer<QString> title,
|
||||||
const std::vector<QString> &optionTexts,
|
const std::vector<QString> &optionTexts,
|
||||||
int initialSelection,
|
int initialSelection,
|
||||||
Fn<void(int)> callback)
|
Fn<void(int)> callback,
|
||||||
|
const style::Checkbox *st,
|
||||||
|
const style::Radio *radioSt)
|
||||||
: _title(std::move(title))
|
: _title(std::move(title))
|
||||||
, _optionTexts(optionTexts)
|
, _optionTexts(optionTexts)
|
||||||
, _initialSelection(initialSelection)
|
, _initialSelection(initialSelection)
|
||||||
, _callback(callback) {
|
, _callback(callback)
|
||||||
|
, _st(st ? *st : st::defaultBoxCheckbox)
|
||||||
|
, _radioSt(radioSt ? *radioSt : st::defaultRadio) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SingleChoiceBox::prepare() {
|
void SingleChoiceBox::prepare() {
|
||||||
|
@ -47,7 +51,8 @@ void SingleChoiceBox::prepare() {
|
||||||
group,
|
group,
|
||||||
i,
|
i,
|
||||||
text,
|
text,
|
||||||
st::defaultBoxCheckbox),
|
_st,
|
||||||
|
_radioSt),
|
||||||
QMargins(
|
QMargins(
|
||||||
st::boxPadding.left() + st::boxOptionListPadding.left(),
|
st::boxPadding.left() + st::boxOptionListPadding.left(),
|
||||||
0,
|
0,
|
||||||
|
|
|
@ -14,6 +14,10 @@ namespace Ui {
|
||||||
class Radiobutton;
|
class Radiobutton;
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
|
namespace style {
|
||||||
|
struct Checkbox;
|
||||||
|
} // namespace style
|
||||||
|
|
||||||
class SingleChoiceBox : public Ui::BoxContent {
|
class SingleChoiceBox : public Ui::BoxContent {
|
||||||
public:
|
public:
|
||||||
SingleChoiceBox(
|
SingleChoiceBox(
|
||||||
|
@ -21,7 +25,9 @@ public:
|
||||||
rpl::producer<QString> title,
|
rpl::producer<QString> title,
|
||||||
const std::vector<QString> &optionTexts,
|
const std::vector<QString> &optionTexts,
|
||||||
int initialSelection,
|
int initialSelection,
|
||||||
Fn<void(int)> callback);
|
Fn<void(int)> callback,
|
||||||
|
const style::Checkbox *st = nullptr,
|
||||||
|
const style::Radio *radioSt = nullptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void prepare() override;
|
void prepare() override;
|
||||||
|
@ -31,6 +37,8 @@ private:
|
||||||
std::vector<QString> _optionTexts;
|
std::vector<QString> _optionTexts;
|
||||||
int _initialSelection = 0;
|
int _initialSelection = 0;
|
||||||
Fn<void(int)> _callback;
|
Fn<void(int)> _callback;
|
||||||
|
const style::Checkbox &_st;
|
||||||
|
const style::Radio &_radioSt;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1436,7 +1436,7 @@ void StickersBox::Inner::setPressed(SelectedRow pressed) {
|
||||||
auto &set = _rows[pressedIndex];
|
auto &set = _rows[pressedIndex];
|
||||||
auto rippleMask = Ui::RippleAnimation::rectMask(QSize(width(), _rowHeight));
|
auto rippleMask = Ui::RippleAnimation::rectMask(QSize(width(), _rowHeight));
|
||||||
if (!set->ripple) {
|
if (!set->ripple) {
|
||||||
set->ripple = std::make_unique<Ui::RippleAnimation>(st::contactsRipple, std::move(rippleMask), [this, pressedIndex] {
|
set->ripple = std::make_unique<Ui::RippleAnimation>(st::defaultRippleAnimation, std::move(rippleMask), [this, pressedIndex] {
|
||||||
update(0, _itemsTop + pressedIndex * _rowHeight, width(), _rowHeight);
|
update(0, _itemsTop + pressedIndex * _rowHeight, width(), _rowHeight);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
using "ui/basic.style";
|
using "ui/basic.style";
|
||||||
|
|
||||||
using "ui/widgets/widgets.style";
|
using "ui/widgets/widgets.style";
|
||||||
|
using "ui/layers/layers.style";
|
||||||
using "window/window.style";
|
using "window/window.style";
|
||||||
|
|
||||||
CallSignalBars {
|
CallSignalBars {
|
||||||
|
@ -408,8 +409,7 @@ groupCallHeight: 580px;
|
||||||
groupCallRipple: RippleAnimation(defaultRippleAnimation) {
|
groupCallRipple: RippleAnimation(defaultRippleAnimation) {
|
||||||
color: groupCallMembersRipple;
|
color: groupCallMembersRipple;
|
||||||
}
|
}
|
||||||
groupCallMembersList: PeerList(defaultPeerList) {
|
groupCallMembersListItem: PeerListItem(defaultPeerListItem) {
|
||||||
item: PeerListItem(defaultPeerListItem) {
|
|
||||||
button: OutlineButton(defaultPeerListButton) {
|
button: OutlineButton(defaultPeerListButton) {
|
||||||
textBg: groupCallMembersBg;
|
textBg: groupCallMembersBg;
|
||||||
textBgOver: groupCallMembersBg;
|
textBgOver: groupCallMembersBg;
|
||||||
|
@ -422,6 +422,15 @@ groupCallMembersList: PeerList(defaultPeerList) {
|
||||||
|
|
||||||
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;
|
height: 52px;
|
||||||
photoPosition: point(12px, 6px);
|
photoPosition: point(12px, 6px);
|
||||||
namePosition: point(68px, 7px);
|
namePosition: point(68px, 7px);
|
||||||
|
@ -433,7 +442,43 @@ groupCallMembersList: PeerList(defaultPeerList) {
|
||||||
statusFgOver: groupCallMemberInactiveStatus;
|
statusFgOver: groupCallMemberInactiveStatus;
|
||||||
statusFgActive: groupCallMemberActiveStatus;
|
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;
|
groupCallMembersHeader: 47px;
|
||||||
groupCallMembersMargin: margins(16px, 16px, 16px, 28px);
|
groupCallMembersMargin: margins(16px, 16px, 16px, 28px);
|
||||||
groupCallAddMember: IconButton(defaultIconButton) {
|
groupCallAddMember: IconButton(defaultIconButton) {
|
||||||
|
@ -505,3 +550,76 @@ groupCallTopBarJoin: RoundButton(defaultActiveButton) {
|
||||||
height: 28px;
|
height: 28px;
|
||||||
textTop: 5px;
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -733,10 +733,11 @@ void GroupMembers::setupButtons(not_null<GroupCall*> call) {
|
||||||
|
|
||||||
void GroupMembers::setupList() {
|
void GroupMembers::setupList() {
|
||||||
auto topSkip = _header ? _header->height() : 0;
|
auto topSkip = _header ? _header->height() : 0;
|
||||||
|
|
||||||
|
_listController->setStyleOverrides(&st::groupCallMembersList);
|
||||||
_list = _scroll->setOwnedWidget(object_ptr<ListWidget>(
|
_list = _scroll->setOwnedWidget(object_ptr<ListWidget>(
|
||||||
this,
|
this,
|
||||||
_listController.get(),
|
_listController.get()));
|
||||||
st::groupCallMembersList));
|
|
||||||
|
|
||||||
sizeValue(
|
sizeValue(
|
||||||
) | rpl::start_with_next([=](QSize size) {
|
) | rpl::start_with_next([=](QSize size) {
|
||||||
|
|
|
@ -173,16 +173,18 @@ void LeaveGroupCallBox(
|
||||||
bool discardChecked,
|
bool discardChecked,
|
||||||
BoxContext context) {
|
BoxContext context) {
|
||||||
box->setTitle(tr::lng_group_call_leave_title());
|
box->setTitle(tr::lng_group_call_leave_title());
|
||||||
|
const auto inCall = (context == BoxContext::GroupCallPanel);
|
||||||
box->addRow(object_ptr<Ui::FlatLabel>(
|
box->addRow(object_ptr<Ui::FlatLabel>(
|
||||||
box.get(),
|
box.get(),
|
||||||
tr::lng_group_call_leave_sure(),
|
tr::lng_group_call_leave_sure(),
|
||||||
st::boxLabel));
|
(inCall ? st::groupCallBoxLabel : st::boxLabel)));
|
||||||
const auto discard = call->channel()->canManageCall()
|
const auto discard = call->channel()->canManageCall()
|
||||||
? box->addRow(object_ptr<Ui::Checkbox>(
|
? box->addRow(object_ptr<Ui::Checkbox>(
|
||||||
box.get(),
|
box.get(),
|
||||||
tr::lng_group_call_end(),
|
tr::lng_group_call_end(),
|
||||||
discardChecked,
|
discardChecked,
|
||||||
st::defaultBoxCheckbox),
|
(inCall ? st::groupCallCheckbox : st::defaultBoxCheckbox),
|
||||||
|
(inCall ? st::groupCallCheck : st::defaultCheck)),
|
||||||
style::margins(
|
style::margins(
|
||||||
st::boxRowPadding.left(),
|
st::boxRowPadding.left(),
|
||||||
st::boxRowPadding.left(),
|
st::boxRowPadding.left(),
|
||||||
|
@ -224,6 +226,8 @@ GroupPanel::GroupPanel(not_null<GroupCall*> call)
|
||||||
.type = Ui::CallMuteButtonType::Connecting,
|
.type = Ui::CallMuteButtonType::Connecting,
|
||||||
}))
|
}))
|
||||||
, _hangup(widget(), st::callHangup) {
|
, _hangup(widget(), st::callHangup) {
|
||||||
|
_layerBg->setStyleOverrides(&st::groupCallBox, &st::groupCallLayerBox);
|
||||||
|
|
||||||
initWindow();
|
initWindow();
|
||||||
initWidget();
|
initWidget();
|
||||||
initControls();
|
initControls();
|
||||||
|
@ -412,6 +416,10 @@ void GroupPanel::addMembers() {
|
||||||
_channel,
|
_channel,
|
||||||
std::move(alreadyIn),
|
std::move(alreadyIn),
|
||||||
real->fullCount());
|
real->fullCount());
|
||||||
|
controller->setStyleOverrides(
|
||||||
|
&st::groupCallInviteMembersList,
|
||||||
|
&st::groupCallMultiSelect);
|
||||||
|
|
||||||
const auto weak = base::make_weak(_call);
|
const auto weak = base::make_weak(_call);
|
||||||
auto initBox = [=, controller = controller.get()](
|
auto initBox = [=, controller = controller.get()](
|
||||||
not_null<PeerListBox*> box) {
|
not_null<PeerListBox*> box) {
|
||||||
|
|
|
@ -89,7 +89,9 @@ void GroupCallSettingsBox(
|
||||||
? box->addRow(object_ptr<Ui::Checkbox>(
|
? box->addRow(object_ptr<Ui::Checkbox>(
|
||||||
box.get(),
|
box.get(),
|
||||||
tr::lng_group_call_new_muted(),
|
tr::lng_group_call_new_muted(),
|
||||||
joinMuted))
|
joinMuted,
|
||||||
|
st::groupCallCheckbox,
|
||||||
|
st::groupCallCheck))
|
||||||
: nullptr;
|
: nullptr;
|
||||||
if (muteJoined) {
|
if (muteJoined) {
|
||||||
AddSkip(layout);
|
AddSkip(layout);
|
||||||
|
@ -107,13 +109,13 @@ void GroupCallSettingsBox(
|
||||||
) | rpl::then(
|
) | rpl::then(
|
||||||
state->outputNameStream.events()
|
state->outputNameStream.events()
|
||||||
),
|
),
|
||||||
st::settingsButton
|
st::groupCallSettingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
box->getDelegate()->show(ChooseAudioInputBox(crl::guard(box, [=](
|
box->getDelegate()->show(ChooseAudioInputBox(crl::guard(box, [=](
|
||||||
const QString &id,
|
const QString &id,
|
||||||
const QString &name) {
|
const QString &name) {
|
||||||
state->outputNameStream.fire_copy(name);
|
state->outputNameStream.fire_copy(name);
|
||||||
})));
|
}), &st::groupCallCheckbox, &st::groupCallRadio));
|
||||||
});
|
});
|
||||||
|
|
||||||
AddButtonWithLabel(
|
AddButtonWithLabel(
|
||||||
|
@ -124,20 +126,20 @@ void GroupCallSettingsBox(
|
||||||
) | rpl::then(
|
) | rpl::then(
|
||||||
state->inputNameStream.events()
|
state->inputNameStream.events()
|
||||||
),
|
),
|
||||||
st::settingsButton
|
st::groupCallSettingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
box->getDelegate()->show(ChooseAudioInputBox(crl::guard(box, [=](
|
box->getDelegate()->show(ChooseAudioInputBox(crl::guard(box, [=](
|
||||||
const QString &id,
|
const QString &id,
|
||||||
const QString &name) {
|
const QString &name) {
|
||||||
state->inputNameStream.fire_copy(name);
|
state->inputNameStream.fire_copy(name);
|
||||||
state->micTester->setDeviceId(id);
|
state->micTester->setDeviceId(id);
|
||||||
})));
|
}), &st::groupCallCheckbox, &st::groupCallRadio));
|
||||||
});
|
});
|
||||||
|
|
||||||
state->micTestLevel = box->addRow(
|
state->micTestLevel = box->addRow(
|
||||||
object_ptr<Ui::LevelMeter>(
|
object_ptr<Ui::LevelMeter>(
|
||||||
box.get(),
|
box.get(),
|
||||||
st::defaultLevelMeter),
|
st::groupCallLevelMeter),
|
||||||
st::settingsLevelMeterPadding);
|
st::settingsLevelMeterPadding);
|
||||||
state->micTestLevel->resize(QSize(0, st::defaultLevelMeter.height));
|
state->micTestLevel->resize(QSize(0, st::defaultLevelMeter.height));
|
||||||
|
|
||||||
|
@ -174,7 +176,7 @@ void GroupCallSettingsBox(
|
||||||
AddButton(
|
AddButton(
|
||||||
layout,
|
layout,
|
||||||
tr::lng_group_call_share(),
|
tr::lng_group_call_share(),
|
||||||
st::settingsButton
|
st::groupCallSettingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
if (!copyLink() && !state->generatingLink) {
|
if (!copyLink() && !state->generatingLink) {
|
||||||
state->generatingLink = true;
|
state->generatingLink = true;
|
||||||
|
@ -195,7 +197,7 @@ void GroupCallSettingsBox(
|
||||||
AddButton(
|
AddButton(
|
||||||
layout,
|
layout,
|
||||||
tr::lng_group_call_end(),
|
tr::lng_group_call_end(),
|
||||||
st::settingsAttentionButton
|
st::groupCallSettingsAttentionButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
if (const auto call = weakCall.get()) {
|
if (const auto call = weakCall.get()) {
|
||||||
box->getDelegate()->show(Box(
|
box->getDelegate()->show(Box(
|
||||||
|
|
|
@ -231,9 +231,9 @@ inlineBotsScroll: ScrollArea(defaultSolidScroll) {
|
||||||
deltab: stickerPanPadding;
|
deltab: stickerPanPadding;
|
||||||
}
|
}
|
||||||
|
|
||||||
gifsSearchField: contactsSearchField;
|
gifsSearchField: defaultMultiSelectSearchField;
|
||||||
gifsSearchFieldPosition: point(42px, 7px);
|
gifsSearchFieldPosition: point(42px, 7px);
|
||||||
gifsSearchCancel: contactsSearchCancel;
|
gifsSearchCancel: defaultMultiSelectSearchCancel;
|
||||||
gifsSearchCancelPosition: point(1px, 1px);
|
gifsSearchCancelPosition: point(1px, 1px);
|
||||||
gifsSearchIcon: boxFieldSearchIcon;
|
gifsSearchIcon: boxFieldSearchIcon;
|
||||||
gifsSearchIconPosition: point(6px, 7px);
|
gifsSearchIconPosition: point(6px, 7px);
|
||||||
|
|
|
@ -221,7 +221,7 @@ void Inner::setupContent() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Row::Row(QWidget *widget, not_null<Main::Session*> session, const Set &set)
|
Row::Row(QWidget *widget, not_null<Main::Session*> session, const Set &set)
|
||||||
: RippleButton(widget, st::contactsRipple)
|
: RippleButton(widget, st::defaultRippleAnimation)
|
||||||
, _session(session)
|
, _session(session)
|
||||||
, _id(set.id)
|
, _id(set.id)
|
||||||
, _state(Available{ set.size }) {
|
, _state(Available{ set.size }) {
|
||||||
|
|
|
@ -180,9 +180,6 @@ void GroupCall::reload() {
|
||||||
void GroupCall::applyParticipantsSlice(
|
void GroupCall::applyParticipantsSlice(
|
||||||
const QVector<MTPGroupCallParticipant> &list,
|
const QVector<MTPGroupCallParticipant> &list,
|
||||||
ApplySliceSource sliceSource) {
|
ApplySliceSource sliceSource) {
|
||||||
if (sliceSource != ApplySliceSource::UnknownLoaded) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
auto changedCount = _fullCount.current();
|
auto changedCount = _fullCount.current();
|
||||||
for (const auto &participant : list) {
|
for (const auto &participant : list) {
|
||||||
participant.match([&](const MTPDgroupCallParticipant &data) {
|
participant.match([&](const MTPDgroupCallParticipant &data) {
|
||||||
|
|
|
@ -213,10 +213,10 @@ int InnerWidget::desiredHeight() const {
|
||||||
object_ptr<InnerWidget::ListWidget> InnerWidget::setupList(
|
object_ptr<InnerWidget::ListWidget> InnerWidget::setupList(
|
||||||
RpWidget *parent,
|
RpWidget *parent,
|
||||||
not_null<PeerListController*> controller) const {
|
not_null<PeerListController*> controller) const {
|
||||||
|
controller->setStyleOverrides(&st::infoCommonGroupsList);
|
||||||
auto result = object_ptr<ListWidget>(
|
auto result = object_ptr<ListWidget>(
|
||||||
parent,
|
parent,
|
||||||
controller,
|
controller);
|
||||||
st::infoCommonGroupsList);
|
|
||||||
result->scrollToRequests(
|
result->scrollToRequests(
|
||||||
) | rpl::start_with_next([this](Ui::ScrollToRequest request) {
|
) | rpl::start_with_next([this](Ui::ScrollToRequest request) {
|
||||||
auto addmin = (request.ymin < 0)
|
auto addmin = (request.ymin < 0)
|
||||||
|
|
|
@ -44,14 +44,14 @@ infoScroll: ScrollArea(defaultScrollArea) {
|
||||||
infoMediaSearch: SearchFieldRow {
|
infoMediaSearch: SearchFieldRow {
|
||||||
height: 44px;
|
height: 44px;
|
||||||
padding: margins(8px, 6px, 8px, 6px);
|
padding: margins(8px, 6px, 8px, 6px);
|
||||||
field: contactsSearchField;
|
field: defaultMultiSelectSearchField;
|
||||||
fieldIcon: icon {{
|
fieldIcon: icon {{
|
||||||
"box_search-flip_horizontal",
|
"box_search-flip_horizontal",
|
||||||
menuIconFg,
|
menuIconFg,
|
||||||
point(6px, 8px)
|
point(6px, 8px)
|
||||||
}};
|
}};
|
||||||
fieldIconSkip: 36px;
|
fieldIconSkip: 36px;
|
||||||
fieldCancel: contactsSearchCancel;
|
fieldCancel: defaultMultiSelectSearchCancel;
|
||||||
fieldCancelSkip: 40px;
|
fieldCancelSkip: 40px;
|
||||||
}
|
}
|
||||||
infoLayerMediaSearch: SearchFieldRow(infoMediaSearch) {
|
infoLayerMediaSearch: SearchFieldRow(infoMediaSearch) {
|
||||||
|
@ -62,7 +62,7 @@ infoLayerMediaSearch: SearchFieldRow(infoMediaSearch) {
|
||||||
point(9px, 9px)
|
point(9px, 9px)
|
||||||
}};
|
}};
|
||||||
fieldIconSkip: 34px;
|
fieldIconSkip: 34px;
|
||||||
fieldCancel: CrossButton(contactsSearchCancel) {
|
fieldCancel: CrossButton(defaultMultiSelectSearchCancel) {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
cross: CrossAnimation {
|
cross: CrossAnimation {
|
||||||
size: 38px;
|
size: 38px;
|
||||||
|
@ -77,7 +77,7 @@ infoLayerMediaSearch: SearchFieldRow(infoMediaSearch) {
|
||||||
infoTopBarSearchRow: SearchFieldRow(infoLayerMediaSearch) {
|
infoTopBarSearchRow: SearchFieldRow(infoLayerMediaSearch) {
|
||||||
height: 52px;
|
height: 52px;
|
||||||
padding: margins(0px, 12px, 8px, 10px);
|
padding: margins(0px, 12px, 8px, 10px);
|
||||||
fieldCancel: CrossButton(contactsSearchCancel) {
|
fieldCancel: CrossButton(defaultMultiSelectSearchCancel) {
|
||||||
width: 51px;
|
width: 51px;
|
||||||
height: 52px;
|
height: 52px;
|
||||||
cross: CrossAnimation {
|
cross: CrossAnimation {
|
||||||
|
@ -402,7 +402,7 @@ infoProfileToggle: Toggle(defaultToggle) {
|
||||||
infoProfileToggleOver: Toggle(infoProfileToggle) {
|
infoProfileToggleOver: Toggle(infoProfileToggle) {
|
||||||
untoggledFg: menuIconFgOver;
|
untoggledFg: menuIconFgOver;
|
||||||
}
|
}
|
||||||
infoProfileButton: SettingsButton {
|
infoProfileButton: SettingsButton(defaultSettingsButton) {
|
||||||
textFg: windowBoldFg;
|
textFg: windowBoldFg;
|
||||||
textFgOver: windowBoldFgOver;
|
textFgOver: windowBoldFgOver;
|
||||||
textBg: windowBg;
|
textBg: windowBg;
|
||||||
|
@ -496,7 +496,7 @@ infoMembersSearchActiveLayer: icon {
|
||||||
infoMembersButtonIconPosition
|
infoMembersButtonIconPosition
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
infoMembersSearchField: InputField(contactsSearchField) {
|
infoMembersSearchField: InputField(defaultMultiSelectSearchField) {
|
||||||
}
|
}
|
||||||
infoMembersCancelSearch: CrossButton {
|
infoMembersCancelSearch: CrossButton {
|
||||||
width: 44px;
|
width: 44px;
|
||||||
|
|
|
@ -501,10 +501,10 @@ ListController *CreateAnswerRows(
|
||||||
container,
|
container,
|
||||||
st::boxLittleSkip));
|
st::boxLittleSkip));
|
||||||
|
|
||||||
|
controller->setStyleOverrides(&st::infoCommonGroupsList);
|
||||||
const auto content = container->add(object_ptr<PeerListContent>(
|
const auto content = container->add(object_ptr<PeerListContent>(
|
||||||
container,
|
container,
|
||||||
controller,
|
controller));
|
||||||
st::infoCommonGroupsList));
|
|
||||||
delegate->setContent(content);
|
delegate->setContent(content);
|
||||||
controller->setDelegate(delegate);
|
controller->setDelegate(delegate);
|
||||||
|
|
||||||
|
|
|
@ -212,10 +212,10 @@ void Members::setupButtons() {
|
||||||
|
|
||||||
void Members::setupList() {
|
void Members::setupList() {
|
||||||
auto topSkip = _header ? _header->height() : 0;
|
auto topSkip = _header ? _header->height() : 0;
|
||||||
|
_listController->setStyleOverrides(&st::infoMembersList);
|
||||||
_list = object_ptr<ListWidget>(
|
_list = object_ptr<ListWidget>(
|
||||||
this,
|
this,
|
||||||
_listController.get(),
|
_listController.get());
|
||||||
st::infoMembersList);
|
|
||||||
_list->scrollToRequests(
|
_list->scrollToRequests(
|
||||||
) | rpl::start_with_next([this](Ui::ScrollToRequest request) {
|
) | rpl::start_with_next([this](Ui::ScrollToRequest request) {
|
||||||
auto addmin = (request.ymin < 0 || !_header)
|
auto addmin = (request.ymin < 0 || !_header)
|
||||||
|
|
|
@ -47,7 +47,7 @@ overviewCheck: RoundCheckbox(defaultRoundCheckbox) {
|
||||||
sizeSmall: 0.3;
|
sizeSmall: 0.3;
|
||||||
check: icon {{ "overview_photo_check", overviewCheckFgActive, point(4px, 8px) }};
|
check: icon {{ "overview_photo_check", overviewCheckFgActive, point(4px, 8px) }};
|
||||||
}
|
}
|
||||||
overviewSmallCheck: RoundCheckbox(contactsPhotoCheck) {
|
overviewSmallCheck: RoundCheckbox(defaultPeerListCheck) {
|
||||||
border: overviewCheckBorder;
|
border: overviewCheckBorder;
|
||||||
}
|
}
|
||||||
overviewCheckSkip: 5px;
|
overviewCheckSkip: 5px;
|
||||||
|
|
|
@ -123,7 +123,7 @@ passportRowTitleFg: windowFg;
|
||||||
passportRowDescriptionFg: windowSubTextFg;
|
passportRowDescriptionFg: windowSubTextFg;
|
||||||
|
|
||||||
passportScansHeaderPadding: margins(22px, 10px, 22px, 10px);
|
passportScansHeaderPadding: margins(22px, 10px, 22px, 10px);
|
||||||
passportUploadButton: SettingsButton {
|
passportUploadButton: SettingsButton(defaultSettingsButton) {
|
||||||
textFg: windowActiveTextFg;
|
textFg: windowActiveTextFg;
|
||||||
textFgOver: windowActiveTextFg;
|
textFgOver: windowActiveTextFg;
|
||||||
textBg: windowBg;
|
textBg: windowBg;
|
||||||
|
|
|
@ -25,11 +25,6 @@ settingsSectionSkip: 9px;
|
||||||
settingsSectionIconLeft: 22px;
|
settingsSectionIconLeft: 22px;
|
||||||
settingsSeparatorPadding: margins(22px, infoProfileSkip, 0px, infoProfileSkip);
|
settingsSeparatorPadding: margins(22px, infoProfileSkip, 0px, infoProfileSkip);
|
||||||
settingsButtonRightSkip: 28px;
|
settingsButtonRightSkip: 28px;
|
||||||
settingsButtonRight: FlatLabel(defaultFlatLabel) {
|
|
||||||
textFg: windowActiveTextFg;
|
|
||||||
style: boxTextStyle;
|
|
||||||
maxHeight: 20px;
|
|
||||||
}
|
|
||||||
settingsScalePadding: margins(79px, 10px, 28px, 8px);
|
settingsScalePadding: margins(79px, 10px, 28px, 8px);
|
||||||
settingsBigScalePadding: margins(22px, 10px, 22px, 8px);
|
settingsBigScalePadding: margins(22px, 10px, 22px, 8px);
|
||||||
settingsSlider: SettingsSlider(defaultSettingsSlider) {
|
settingsSlider: SettingsSlider(defaultSettingsSlider) {
|
||||||
|
|
|
@ -327,7 +327,9 @@ QString CurrentAudioInputName() {
|
||||||
}
|
}
|
||||||
|
|
||||||
object_ptr<SingleChoiceBox> ChooseAudioOutputBox(
|
object_ptr<SingleChoiceBox> ChooseAudioOutputBox(
|
||||||
Fn<void(QString id, QString name)> chosen) {
|
Fn<void(QString id, QString name)> chosen,
|
||||||
|
const style::Checkbox *st,
|
||||||
|
const style::Radio *radioSt) {
|
||||||
const auto &devices = Webrtc::GetAudioOutputList();
|
const auto &devices = Webrtc::GetAudioOutputList();
|
||||||
const auto options = ranges::view::concat(
|
const auto options = ranges::view::concat(
|
||||||
ranges::view::single(tr::lng_settings_call_device_default(tr::now)),
|
ranges::view::single(tr::lng_settings_call_device_default(tr::now)),
|
||||||
|
@ -351,11 +353,15 @@ object_ptr<SingleChoiceBox> ChooseAudioOutputBox(
|
||||||
tr::lng_settings_call_output_device(),
|
tr::lng_settings_call_output_device(),
|
||||||
options,
|
options,
|
||||||
currentOption,
|
currentOption,
|
||||||
save);
|
save,
|
||||||
|
st,
|
||||||
|
radioSt);
|
||||||
}
|
}
|
||||||
|
|
||||||
object_ptr<SingleChoiceBox> ChooseAudioInputBox(
|
object_ptr<SingleChoiceBox> ChooseAudioInputBox(
|
||||||
Fn<void(QString id, QString name)> chosen) {
|
Fn<void(QString id, QString name)> chosen,
|
||||||
|
const style::Checkbox *st,
|
||||||
|
const style::Radio *radioSt) {
|
||||||
const auto devices = Webrtc::GetAudioInputList();
|
const auto devices = Webrtc::GetAudioInputList();
|
||||||
const auto options = ranges::view::concat(
|
const auto options = ranges::view::concat(
|
||||||
ranges::view::single(tr::lng_settings_call_device_default(tr::now)),
|
ranges::view::single(tr::lng_settings_call_device_default(tr::now)),
|
||||||
|
@ -379,7 +385,9 @@ object_ptr<SingleChoiceBox> ChooseAudioInputBox(
|
||||||
tr::lng_settings_call_input_device(),
|
tr::lng_settings_call_input_device(),
|
||||||
options,
|
options,
|
||||||
currentOption,
|
currentOption,
|
||||||
save);
|
save,
|
||||||
|
st,
|
||||||
|
radioSt);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Settings
|
} // namespace Settings
|
||||||
|
|
|
@ -11,6 +11,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/effects/animations.h"
|
#include "ui/effects/animations.h"
|
||||||
#include "base/timer.h"
|
#include "base/timer.h"
|
||||||
|
|
||||||
|
namespace style {
|
||||||
|
struct Checkbox;
|
||||||
|
struct Radio;
|
||||||
|
} // namespace style
|
||||||
|
|
||||||
namespace Calls {
|
namespace Calls {
|
||||||
class Call;
|
class Call;
|
||||||
} // namespace Calls
|
} // namespace Calls
|
||||||
|
@ -57,9 +62,13 @@ inline constexpr auto kMicTestAnimationDuration = crl::time(200);
|
||||||
[[nodiscard]] QString CurrentAudioOutputName();
|
[[nodiscard]] QString CurrentAudioOutputName();
|
||||||
[[nodiscard]] QString CurrentAudioInputName();
|
[[nodiscard]] QString CurrentAudioInputName();
|
||||||
[[nodiscard]] object_ptr<SingleChoiceBox> ChooseAudioOutputBox(
|
[[nodiscard]] object_ptr<SingleChoiceBox> ChooseAudioOutputBox(
|
||||||
Fn<void(QString id, QString name)> chosen);
|
Fn<void(QString id, QString name)> chosen,
|
||||||
|
const style::Checkbox *st = nullptr,
|
||||||
|
const style::Radio *radioSt = nullptr);
|
||||||
[[nodiscard]] object_ptr<SingleChoiceBox> ChooseAudioInputBox(
|
[[nodiscard]] object_ptr<SingleChoiceBox> ChooseAudioInputBox(
|
||||||
Fn<void(QString id, QString name)> chosen);
|
Fn<void(QString id, QString name)> chosen,
|
||||||
|
const style::Checkbox *st = nullptr,
|
||||||
|
const style::Radio *radioSt = nullptr);
|
||||||
|
|
||||||
} // namespace Settings
|
} // namespace Settings
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ void CreateRightLabel(
|
||||||
rpl::producer<QString> buttonText) {
|
rpl::producer<QString> buttonText) {
|
||||||
const auto name = Ui::CreateChild<Ui::FlatLabel>(
|
const auto name = Ui::CreateChild<Ui::FlatLabel>(
|
||||||
button.get(),
|
button.get(),
|
||||||
st::settingsButtonRight);
|
st.rightLabel);
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
button->widthValue(),
|
button->widthValue(),
|
||||||
std::move(buttonText),
|
std::move(buttonText),
|
||||||
|
|
|
@ -148,12 +148,12 @@ void CountryInput::setText(const QString &newText) {
|
||||||
}
|
}
|
||||||
|
|
||||||
CountrySelectBox::CountrySelectBox(QWidget*)
|
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)
|
CountrySelectBox::CountrySelectBox(QWidget*, const QString &iso, Type type)
|
||||||
: _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)) {
|
if (Data::CountriesByISO2().contains(iso)) {
|
||||||
LastValidISO = iso;
|
LastValidISO = iso;
|
||||||
}
|
}
|
||||||
|
|
|
@ -650,9 +650,9 @@ Editor::Editor(
|
||||||
: _window(window)
|
: _window(window)
|
||||||
, _cloud(cloud)
|
, _cloud(cloud)
|
||||||
, _scroll(this, st::themesScroll)
|
, _scroll(this, st::themesScroll)
|
||||||
, _close(this, st::contactsMultiSelect.fieldCancel)
|
, _close(this, st::defaultMultiSelect.fieldCancel)
|
||||||
, _menuToggle(this, st::themesMenuToggle)
|
, _menuToggle(this, st::themesMenuToggle)
|
||||||
, _select(this, st::contactsMultiSelect, tr::lng_country_ph())
|
, _select(this, st::defaultMultiSelect, tr::lng_country_ph())
|
||||||
, _leftShadow(this)
|
, _leftShadow(this)
|
||||||
, _topShadow(this)
|
, _topShadow(this)
|
||||||
, _save(this, tr::lng_theme_editor_save_button(tr::now).toUpper(), st::dialogsUpdateButton) {
|
, _save(this, tr::lng_theme_editor_save_button(tr::now).toUpper(), st::dialogsUpdateButton) {
|
||||||
|
|
|
@ -233,7 +233,7 @@ windowOutdatedClose: IconButton(defaultIconButton) {
|
||||||
iconPosition: point(-1px, -1px);
|
iconPosition: point(-1px, -1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
createThemeImportButton: SettingsButton {
|
createThemeImportButton: SettingsButton(defaultSettingsButton) {
|
||||||
textFg: lightButtonFg;
|
textFg: lightButtonFg;
|
||||||
textFgOver: lightButtonFgOver;
|
textFgOver: lightButtonFgOver;
|
||||||
textBg: windowBg;
|
textBg: windowBg;
|
||||||
|
|
|
@ -208,7 +208,8 @@ QSize MediaPreviewWidget::currentDimensions() const {
|
||||||
QSize result, box;
|
QSize result, box;
|
||||||
if (_photo) {
|
if (_photo) {
|
||||||
result = QSize(_photo->width(), _photo->height());
|
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 {
|
} else {
|
||||||
result = _document->dimensions;
|
result = _document->dimensions;
|
||||||
if (result.isEmpty()) {
|
if (result.isEmpty()) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 41bae1eba67801eb8768887100c17b7e84e7daf7
|
Subproject commit 7287e235e0205fd878cd35329d08aa1aa1c218fa
|
Loading…
Add table
Reference in a new issue