mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-22 03:08:48 +00:00
Update submodules to the latest spellcheck.
This commit is contained in:
parent
272f2d937b
commit
d63e50944a
@ -766,7 +766,7 @@ SetupChannelBox::SetupChannelBox(
|
||||
st::defaultBoxCheckbox)
|
||||
, _aboutPublicWidth(st::boxWideWidth
|
||||
- st::boxPadding.left()
|
||||
- st::boxButtonPadding.right()
|
||||
- st::defaultBox.buttonPadding.right()
|
||||
- st::newGroupPadding.left()
|
||||
- st::defaultRadio.diameter
|
||||
- st::defaultBoxCheckbox.textPosition.x())
|
||||
@ -1345,7 +1345,7 @@ void RevokePublicLinkBox::prepare() {
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
}), st::boxLayerScroll, _innerTop);
|
||||
}), st::boxScroll, _innerTop);
|
||||
|
||||
addButton(tr::lng_cancel(), [=] { closeBox(); });
|
||||
|
||||
|
@ -10,8 +10,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "lang/lang_keys.h"
|
||||
#include "main/main_session.h"
|
||||
#include "data/data_session.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "ui/widgets/continuous_sliders.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/wrap/wrap.h"
|
||||
#include "storage/localstorage.h"
|
||||
|
@ -42,7 +42,7 @@ countryRowBgOver: windowBgOver;
|
||||
countryRowCodeFg: windowSubTextFg;
|
||||
countryRowCodeFgOver: windowSubTextFgOver;
|
||||
countriesSkip: 12px;
|
||||
countriesScroll: ScrollArea(boxLayerScroll) {
|
||||
countriesScroll: ScrollArea(boxScroll) {
|
||||
deltat: 9px;
|
||||
deltab: 3px;
|
||||
}
|
||||
@ -352,7 +352,7 @@ membersAbout: FlatLabel(defaultFlatLabel) {
|
||||
style: boxLabelStyle;
|
||||
}
|
||||
|
||||
sessionsScroll: boxLayerScroll;
|
||||
sessionsScroll: boxScroll;
|
||||
sessionsHeight: 350px;
|
||||
sessionHeight: 70px;
|
||||
sessionCurrentPadding: margins(0px, 7px, 0px, 4px);
|
||||
@ -490,7 +490,7 @@ langsRadio: Radio(defaultRadio) {
|
||||
|
||||
backgroundPadding: 10px;
|
||||
backgroundSize: size(108px, 193px);
|
||||
backgroundScroll: ScrollArea(boxLayerScroll) {
|
||||
backgroundScroll: ScrollArea(boxScroll) {
|
||||
deltax: 3px;
|
||||
width: 10px;
|
||||
deltat: 10px;
|
||||
@ -852,7 +852,7 @@ createPollWarningPosition: point(16px, 6px);
|
||||
|
||||
callSettingsButton: IconButton {
|
||||
width: 50px;
|
||||
height: boxLayerTitleHeight;
|
||||
height: boxTitleHeight;
|
||||
icon: icon {{ "menu_settings", boxTitleCloseFg }};
|
||||
iconOver: icon {{ "menu_settings", boxTitleCloseFgOver }};
|
||||
iconPosition: point(8px, -1px);
|
||||
|
@ -56,7 +56,7 @@ ConfirmBox::ConfirmBox(
|
||||
: _confirmText(tr::lng_box_ok(tr::now))
|
||||
, _cancelText(tr::lng_cancel(tr::now))
|
||||
, _confirmStyle(st::defaultBoxButton)
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::defaultBox.buttonPadding.right())
|
||||
, _confirmedCallback(std::move(confirmedCallback))
|
||||
, _cancelledCallback(std::move(cancelledCallback)) {
|
||||
init(text);
|
||||
@ -71,7 +71,7 @@ ConfirmBox::ConfirmBox(
|
||||
: _confirmText(confirmText)
|
||||
, _cancelText(tr::lng_cancel(tr::now))
|
||||
, _confirmStyle(st::defaultBoxButton)
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::defaultBox.buttonPadding.right())
|
||||
, _confirmedCallback(std::move(confirmedCallback))
|
||||
, _cancelledCallback(std::move(cancelledCallback)) {
|
||||
init(text);
|
||||
@ -86,7 +86,7 @@ ConfirmBox::ConfirmBox(
|
||||
: _confirmText(confirmText)
|
||||
, _cancelText(tr::lng_cancel(tr::now))
|
||||
, _confirmStyle(st::defaultBoxButton)
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::defaultBox.buttonPadding.right())
|
||||
, _confirmedCallback(std::move(confirmedCallback))
|
||||
, _cancelledCallback(std::move(cancelledCallback)) {
|
||||
init(text);
|
||||
@ -102,7 +102,7 @@ ConfirmBox::ConfirmBox(
|
||||
: _confirmText(confirmText)
|
||||
, _cancelText(tr::lng_cancel(tr::now))
|
||||
, _confirmStyle(confirmStyle)
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::defaultBox.buttonPadding.right())
|
||||
, _confirmedCallback(std::move(confirmedCallback))
|
||||
, _cancelledCallback(std::move(cancelledCallback)) {
|
||||
init(text);
|
||||
@ -118,7 +118,7 @@ ConfirmBox::ConfirmBox(
|
||||
: _confirmText(confirmText)
|
||||
, _cancelText(cancelText)
|
||||
, _confirmStyle(st::defaultBoxButton)
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::defaultBox.buttonPadding.right())
|
||||
, _confirmedCallback(std::move(confirmedCallback))
|
||||
, _cancelledCallback(std::move(cancelledCallback)) {
|
||||
init(text);
|
||||
@ -135,7 +135,7 @@ ConfirmBox::ConfirmBox(
|
||||
: _confirmText(confirmText)
|
||||
, _cancelText(cancelText)
|
||||
, _confirmStyle(st::defaultBoxButton)
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::defaultBox.buttonPadding.right())
|
||||
, _confirmedCallback(std::move(confirmedCallback))
|
||||
, _cancelledCallback(std::move(cancelledCallback)) {
|
||||
init(text);
|
||||
@ -149,7 +149,7 @@ ConfirmBox::ConfirmBox(
|
||||
: _confirmText(doneText)
|
||||
, _confirmStyle(st::defaultBoxButton)
|
||||
, _informative(true)
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::defaultBox.buttonPadding.right())
|
||||
, _confirmedCallback(generateInformCallback(closedCallback))
|
||||
, _cancelledCallback(generateInformCallback(closedCallback)) {
|
||||
init(text);
|
||||
@ -163,7 +163,7 @@ ConfirmBox::ConfirmBox(
|
||||
: _confirmText(doneText)
|
||||
, _confirmStyle(st::defaultBoxButton)
|
||||
, _informative(true)
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
||||
, _text(st::boxWidth - st::boxPadding.left() - st::defaultBox.buttonPadding.right())
|
||||
, _confirmedCallback(generateInformCallback(closedCallback))
|
||||
, _cancelledCallback(generateInformCallback(closedCallback)) {
|
||||
init(text);
|
||||
@ -220,7 +220,7 @@ void ConfirmBox::setMaxLineCount(int count) {
|
||||
}
|
||||
|
||||
void ConfirmBox::textUpdated() {
|
||||
_textWidth = st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right();
|
||||
_textWidth = st::boxWidth - st::boxPadding.left() - st::defaultBox.buttonPadding.right();
|
||||
_textHeight = _text.countHeight(_textWidth);
|
||||
if (_maxLineCount > 0) {
|
||||
accumulate_min(_textHeight, _maxLineCount * st::boxLabelStyle.lineHeight);
|
||||
@ -324,7 +324,7 @@ InformBox::InformBox(QWidget*, const TextWithEntities &text, const QString &done
|
||||
|
||||
MaxInviteBox::MaxInviteBox(QWidget*, not_null<ChannelData*> channel) : BoxContent()
|
||||
, _channel(channel)
|
||||
, _text(st::boxLabelStyle, tr::lng_participant_invite_sorry(tr::now, lt_count, Global::ChatSizeMax()), _confirmBoxTextOptions, st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right()) {
|
||||
, _text(st::boxLabelStyle, tr::lng_participant_invite_sorry(tr::now, lt_count, Global::ChatSizeMax()), _confirmBoxTextOptions, st::boxWidth - st::boxPadding.left() - st::defaultBox.buttonPadding.right()) {
|
||||
}
|
||||
|
||||
void MaxInviteBox::prepare() {
|
||||
@ -332,7 +332,7 @@ void MaxInviteBox::prepare() {
|
||||
|
||||
addButton(tr::lng_box_ok(), [=] { closeBox(); });
|
||||
|
||||
_textWidth = st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right();
|
||||
_textWidth = st::boxWidth - st::boxPadding.left() - st::defaultBox.buttonPadding.right();
|
||||
_textHeight = qMin(_text.countHeight(_textWidth), 16 * st::boxLabelStyle.lineHeight);
|
||||
setDimensions(st::boxWidth, st::boxPadding.top() + _textHeight + st::boxTextFont->height + st::boxTextFont->height * 2 + st::newGroupLinkPadding.bottom());
|
||||
|
||||
|
@ -756,7 +756,7 @@ void EditCaptionBox::updateBoxSize() {
|
||||
}
|
||||
|
||||
int EditCaptionBox::errorTopSkip() const {
|
||||
return (st::boxButtonPadding.top() / 2);
|
||||
return (st::defaultBox.buttonPadding.top() / 2);
|
||||
}
|
||||
|
||||
void EditCaptionBox::paintEvent(QPaintEvent *e) {
|
||||
|
@ -14,7 +14,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "history/history.h"
|
||||
#include "boxes/peer_list_controllers.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "settings/settings_common.h"
|
||||
#include "settings/settings_privacy_security.h"
|
||||
#include "calls/calls_instance.h"
|
||||
|
@ -336,8 +336,8 @@ void Rows::mousePressEvent(QMouseEvent *e) {
|
||||
QRect Rows::menuToggleArea() const {
|
||||
const auto size = st::topBarSearch.width;
|
||||
const auto top = (DefaultRowHeight() - size) / 2;
|
||||
const auto skip = st::boxLayerScroll.width
|
||||
- st::boxLayerScroll.deltax
|
||||
const auto skip = st::boxScroll.width
|
||||
- st::boxScroll.deltax
|
||||
+ top;
|
||||
const auto left = width() - skip - size;
|
||||
return QRect(left, top, size, size);
|
||||
@ -1072,7 +1072,7 @@ void LanguageBox::prepare() {
|
||||
const auto [recent, official] = PrepareLists();
|
||||
const auto inner = setInnerWidget(
|
||||
object_ptr<Content>(this, recent, official),
|
||||
st::boxLayerScroll,
|
||||
st::boxScroll,
|
||||
select->height());
|
||||
inner->resizeToWidth(st::boxWidth);
|
||||
|
||||
|
@ -231,7 +231,7 @@ int LocalStorageBox::Row::resizeGetHeight(int newWidth) {
|
||||
newWidth);
|
||||
}
|
||||
_clear->moveToRight(
|
||||
st::boxLayerButtonPadding.right(),
|
||||
st::layerBox.buttonPadding.right(),
|
||||
(height - _clear->height()) / 2,
|
||||
newWidth);
|
||||
return height;
|
||||
|
@ -110,7 +110,7 @@ void PeerListBox::prepare() {
|
||||
this,
|
||||
_controller.get(),
|
||||
st::peerListBox),
|
||||
st::boxLayerScroll));
|
||||
st::boxScroll));
|
||||
content()->resizeToWidth(_controller->contentWidth());
|
||||
|
||||
_controller->setDelegate(this);
|
||||
|
@ -11,9 +11,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "data/data_channel.h"
|
||||
#include "data/data_chat.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/text/text_utilities.h" // Ui::Text::ToUpper
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "boxes/peer_list_box.h"
|
||||
#include "boxes/confirm_box.h"
|
||||
#include "boxes/add_contact_box.h"
|
||||
@ -244,7 +244,7 @@ object_ptr<Ui::RpWidget> SetupCreateGroup(
|
||||
Fn<void(ChannelData*)> callback) {
|
||||
Expects(channel->isBroadcast());
|
||||
|
||||
auto result = object_ptr<Info::Profile::Button>(
|
||||
auto result = object_ptr<Ui::SettingsButton>(
|
||||
parent,
|
||||
tr::lng_manage_discussion_group_create(
|
||||
) | Ui::Text::ToUpper(),
|
||||
@ -266,7 +266,7 @@ object_ptr<Ui::RpWidget> SetupUnlink(
|
||||
not_null<QWidget*> parent,
|
||||
not_null<ChannelData*> channel,
|
||||
Fn<void(ChannelData*)> callback) {
|
||||
auto result = object_ptr<Info::Profile::Button>(
|
||||
auto result = object_ptr<Ui::SettingsButton>(
|
||||
parent,
|
||||
(channel->isBroadcast()
|
||||
? tr::lng_manage_discussion_group_unlink
|
||||
|
@ -22,7 +22,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/text_options.h"
|
||||
#include "ui/special_buttons.h"
|
||||
#include "chat_helpers/emoji_suggestions_widget.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "settings/settings_privacy_security.h"
|
||||
#include "boxes/calendar_box.h"
|
||||
#include "boxes/confirm_box.h"
|
||||
|
@ -24,7 +24,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "data/data_peer.h"
|
||||
#include "data/data_session.h"
|
||||
#include "history/admin_log/history_admin_log_section.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "info/profile/info_profile_values.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "mainwidget.h"
|
||||
@ -35,6 +34,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/special_buttons.h"
|
||||
#include "ui/toast/toast.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/box_content_divider.h"
|
||||
@ -93,7 +93,7 @@ void AddButtonWithCount(
|
||||
&icon));
|
||||
}
|
||||
|
||||
object_ptr<Info::Profile::Button> CreateButtonWithText(
|
||||
object_ptr<Ui::SettingsButton> CreateButtonWithText(
|
||||
not_null<QWidget*> parent,
|
||||
rpl::producer<QString> &&text,
|
||||
rpl::producer<QString> &&label,
|
||||
@ -107,7 +107,7 @@ object_ptr<Info::Profile::Button> CreateButtonWithText(
|
||||
nullptr);
|
||||
}
|
||||
|
||||
Info::Profile::Button *AddButtonWithText(
|
||||
Ui::SettingsButton *AddButtonWithText(
|
||||
not_null<Ui::VerticalLayout*> parent,
|
||||
rpl::producer<QString> &&text,
|
||||
rpl::producer<QString> &&label,
|
||||
@ -1478,14 +1478,14 @@ void EditPeerInfoBox::prepare() {
|
||||
std::move(content)));
|
||||
}
|
||||
|
||||
object_ptr<Info::Profile::Button> EditPeerInfoBox::CreateButton(
|
||||
object_ptr<Ui::SettingsButton> EditPeerInfoBox::CreateButton(
|
||||
not_null<QWidget*> parent,
|
||||
rpl::producer<QString> &&text,
|
||||
rpl::producer<QString> &&count,
|
||||
Fn<void()> callback,
|
||||
const style::InfoProfileCountButton &st,
|
||||
const style::SettingsCountButton &st,
|
||||
const style::icon *icon) {
|
||||
auto result = object_ptr<Info::Profile::Button>(
|
||||
auto result = object_ptr<Ui::SettingsButton>(
|
||||
parent,
|
||||
rpl::duplicate(text),
|
||||
st.button);
|
||||
|
@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "boxes/abstract_box.h"
|
||||
|
||||
namespace style {
|
||||
struct InfoProfileCountButton;
|
||||
struct SettingsCountButton;
|
||||
} // namespace style
|
||||
|
||||
namespace Window {
|
||||
@ -20,14 +20,9 @@ class SessionNavigation;
|
||||
|
||||
namespace Ui {
|
||||
class VerticalLayout;
|
||||
class SettingsButton;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Info {
|
||||
namespace Profile {
|
||||
class Button;
|
||||
} // namespace Profile
|
||||
} // namespace Info
|
||||
|
||||
class EditPeerInfoBox : public Ui::BoxContent {
|
||||
public:
|
||||
EditPeerInfoBox(
|
||||
@ -41,12 +36,12 @@ public:
|
||||
|
||||
static bool Available(not_null<PeerData*> peer);
|
||||
|
||||
[[nodiscard]] static object_ptr<Info::Profile::Button> CreateButton(
|
||||
[[nodiscard]] static object_ptr<Ui::SettingsButton> CreateButton(
|
||||
not_null<QWidget*> parent,
|
||||
rpl::producer<QString> &&text,
|
||||
rpl::producer<QString> &&count,
|
||||
Fn<void()> callback,
|
||||
const style::InfoProfileCountButton &st,
|
||||
const style::SettingsCountButton &st,
|
||||
const style::icon *icon = nullptr);
|
||||
|
||||
protected:
|
||||
|
@ -13,10 +13,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/continuous_sliders.h"
|
||||
#include "ui/widgets/box_content_divider.h"
|
||||
#include "ui/toast/toast.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "info/profile/info_profile_icon.h"
|
||||
#include "info/profile/info_profile_values.h"
|
||||
#include "boxes/peers/edit_participants_box.h"
|
||||
|
@ -11,19 +11,14 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "base/timer.h"
|
||||
|
||||
namespace style {
|
||||
struct InfoProfileCountButton;
|
||||
struct SettingsCountButton;
|
||||
} // namespace style
|
||||
|
||||
namespace Ui {
|
||||
class VerticalLayout;
|
||||
class SettingsButton;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Info {
|
||||
namespace Profile {
|
||||
class Button;
|
||||
} // namespace Profile
|
||||
} // namespace Info
|
||||
|
||||
enum class Privacy {
|
||||
HasUsername,
|
||||
NoUsername,
|
||||
|
@ -1436,7 +1436,7 @@ void SendFilesBox::prepareAlbumPreview() {
|
||||
|
||||
const auto wrap = Ui::CreateChild<Ui::ScrollArea>(
|
||||
this,
|
||||
st::boxLayerScroll);
|
||||
st::boxScroll);
|
||||
_albumPreview = wrap->setOwnedWidget(object_ptr<AlbumPreview>(
|
||||
this,
|
||||
_list,
|
||||
|
@ -15,7 +15,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "data/data_session.h"
|
||||
#include "base/unixtime.h"
|
||||
#include "boxes/confirm_box.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "settings/settings_common.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
@ -70,7 +69,7 @@ private:
|
||||
void setupContent();
|
||||
|
||||
QPointer<List> _current;
|
||||
QPointer<Info::Profile::Button> _terminateAll;
|
||||
QPointer<Ui::SettingsButton> _terminateAll;
|
||||
QPointer<List> _incomplete;
|
||||
QPointer<List> _list;
|
||||
|
||||
@ -369,7 +368,7 @@ void SessionsBox::Inner::setupContent() {
|
||||
object_ptr<Ui::VerticalLayout>(content)))->setDuration(0);
|
||||
const auto terminateInner = terminateWrap->entity();
|
||||
_terminateAll = terminateInner->add(
|
||||
object_ptr<Info::Profile::Button>(
|
||||
object_ptr<Ui::SettingsButton>(
|
||||
terminateInner,
|
||||
tr::lng_sessions_terminate_all(),
|
||||
st::terminateSessionsButton));
|
||||
|
@ -769,7 +769,7 @@ void StickersBox::Inner::resizeEvent(QResizeEvent *e) {
|
||||
void StickersBox::Inner::updateControlsGeometry() {
|
||||
if (_megagroupSet) {
|
||||
auto top = st::groupStickersFieldPadding.top();
|
||||
auto fieldLeft = st::boxLayerTitlePosition.x();
|
||||
auto fieldLeft = st::boxTitlePosition.x();
|
||||
_megagroupSetField->setGeometryToLeft(fieldLeft, top, width() - fieldLeft - st::groupStickersFieldPadding.right(), _megagroupSetField->height());
|
||||
top += _megagroupSetField->height() + st::groupStickersFieldPadding.bottom();
|
||||
if (_megagroupSelectedRemove) {
|
||||
@ -780,8 +780,8 @@ void StickersBox::Inner::updateControlsGeometry() {
|
||||
}
|
||||
_megagroupDivider->setGeometryToLeft(0, top, width(), _megagroupDivider->height());
|
||||
top += _megagroupDivider->height();
|
||||
_megagroupSubTitle->resizeToNaturalWidth(width() - 2 * st::boxLayerTitlePosition.x());
|
||||
_megagroupSubTitle->moveToLeft(st::boxLayerTitlePosition.x(), top + st::boxLayerTitlePosition.y());
|
||||
_megagroupSubTitle->resizeToNaturalWidth(width() - 2 * st::boxTitlePosition.x());
|
||||
_megagroupSubTitle->moveToLeft(st::boxTitlePosition.x(), top + st::boxTitlePosition.y());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1913,7 +1913,7 @@ void StickersBox::Inner::readVisibleSets() {
|
||||
}
|
||||
|
||||
void StickersBox::Inner::updateScrollbarWidth() {
|
||||
auto width = (_visibleBottom - _visibleTop < height()) ? (st::boxLayerScroll.width - st::boxLayerScroll.deltax) : 0;
|
||||
auto width = (_visibleBottom - _visibleTop < height()) ? (st::boxScroll.width - st::boxScroll.deltax) : 0;
|
||||
if (_scrollbar != width) {
|
||||
_scrollbar = width;
|
||||
update();
|
||||
|
@ -79,7 +79,7 @@ stickersFeaturedInstalled: icon {{ "send_control_save", lightButtonFg }};
|
||||
stickersMaxHeight: 320px;
|
||||
stickersPadding: margins(19px, 13px, 19px, 13px);
|
||||
stickersSize: size(64px, 64px);
|
||||
stickersScroll: ScrollArea(boxLayerScroll) {
|
||||
stickersScroll: ScrollArea(boxScroll) {
|
||||
deltat: 19px;
|
||||
deltab: 9px;
|
||||
}
|
||||
|
32
Telegram/SourceFiles/core/base_integration.cpp
Normal file
32
Telegram/SourceFiles/core/base_integration.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "core/base_integration.h"
|
||||
|
||||
#include "core/sandbox.h"
|
||||
#include "core/crash_reports.h"
|
||||
|
||||
namespace Core {
|
||||
|
||||
BaseIntegration::BaseIntegration(int argc, char *argv[])
|
||||
: Integration(argc, argv) {
|
||||
}
|
||||
|
||||
void BaseIntegration::enterFromEventLoop(FnMut<void()> &&method) {
|
||||
Core::Sandbox::Instance().customEnterFromEventLoop(
|
||||
std::move(method));
|
||||
}
|
||||
|
||||
void BaseIntegration::logAssertionViolation(const QString &info) {
|
||||
#ifdef LOG
|
||||
LOG(("Assertion Failed! ") + info);
|
||||
#endif // LOG
|
||||
|
||||
CrashReports::SetAnnotation("Assertion", info);
|
||||
}
|
||||
|
||||
} // namespace Core
|
23
Telegram/SourceFiles/core/base_integration.h
Normal file
23
Telegram/SourceFiles/core/base_integration.h
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "base/integration.h"
|
||||
|
||||
namespace Core {
|
||||
|
||||
class BaseIntegration : public base::Integration {
|
||||
public:
|
||||
BaseIntegration(int argc, char *argv[]);
|
||||
|
||||
void enterFromEventLoop(FnMut<void()> &&method) override;
|
||||
void logAssertionViolation(const QString &info) override;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Core
|
@ -57,24 +57,3 @@ void StartCatching(not_null<Core::Launcher*> launcher);
|
||||
void FinishCatching();
|
||||
|
||||
} // namespace CrashReports
|
||||
|
||||
namespace base {
|
||||
namespace assertion {
|
||||
|
||||
inline void log(const char *message, const char *file, int line) {
|
||||
const auto info = QStringLiteral("%1 %2:%3"
|
||||
).arg(message
|
||||
).arg(file
|
||||
).arg(line
|
||||
);
|
||||
const auto entry = QStringLiteral("Assertion Failed! ") + info;
|
||||
|
||||
#ifdef LOG
|
||||
LOG((entry));
|
||||
#endif // LOG
|
||||
|
||||
CrashReports::SetAnnotation("Assertion", info);
|
||||
}
|
||||
|
||||
} // namespace assertion
|
||||
} // namespace base
|
||||
|
@ -235,8 +235,10 @@ Launcher::Launcher(
|
||||
const QString &systemVersion)
|
||||
: _argc(argc)
|
||||
, _argv(argv)
|
||||
, _baseIntegration(_argc, _argv)
|
||||
, _deviceModel(deviceModel)
|
||||
, _systemVersion(systemVersion) {
|
||||
base::Integration::Set(&_baseIntegration);
|
||||
}
|
||||
|
||||
void Launcher::init() {
|
||||
|
@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "core/base_integration.h"
|
||||
|
||||
namespace Core {
|
||||
|
||||
class Launcher {
|
||||
@ -63,6 +65,7 @@ private:
|
||||
int _argc;
|
||||
char **_argv;
|
||||
QStringList _arguments;
|
||||
BaseIntegration _baseIntegration;
|
||||
|
||||
const QString _deviceModel;
|
||||
const QString _systemVersion;
|
||||
|
@ -103,7 +103,7 @@ void SettingsWidget::changeData(Callback &&callback) {
|
||||
void SettingsWidget::setupContent() {
|
||||
const auto scroll = Ui::CreateChild<Ui::ScrollArea>(
|
||||
this,
|
||||
st::boxLayerScroll);
|
||||
st::boxScroll);
|
||||
const auto wrap = scroll->setOwnedWidget(
|
||||
object_ptr<Ui::OverrideMargins>(
|
||||
scroll,
|
||||
@ -406,7 +406,7 @@ not_null<Ui::RpWidget*> SettingsWidget::setupButtons(
|
||||
not_null<Ui::RpWidget*> wrap) {
|
||||
using namespace rpl::mappers;
|
||||
|
||||
const auto buttonsPadding = st::boxButtonPadding;
|
||||
const auto buttonsPadding = st::defaultBox.buttonPadding;
|
||||
const auto buttonsHeight = buttonsPadding.top()
|
||||
+ st::defaultBoxButton.height
|
||||
+ buttonsPadding.bottom();
|
||||
@ -654,8 +654,8 @@ void SettingsWidget::refreshButtons(
|
||||
|
||||
container->sizeValue(
|
||||
) | rpl::start_with_next([=](QSize size) {
|
||||
const auto right = st::boxButtonPadding.right();
|
||||
const auto top = st::boxButtonPadding.top();
|
||||
const auto right = st::defaultBox.buttonPadding.right();
|
||||
const auto top = st::defaultBox.buttonPadding.top();
|
||||
start->moveToRight(right, top);
|
||||
}, start->lifetime());
|
||||
}
|
||||
@ -674,9 +674,9 @@ void SettingsWidget::refreshButtons(
|
||||
container->sizeValue(),
|
||||
start ? start->widthValue() : rpl::single(0)
|
||||
) | rpl::start_with_next([=](QSize size, int width) {
|
||||
const auto right = st::boxButtonPadding.right()
|
||||
+ (width ? width + st::boxButtonPadding.left() : 0);
|
||||
const auto top = st::boxButtonPadding.top();
|
||||
const auto right = st::defaultBox.buttonPadding.right()
|
||||
+ (width ? width + st::defaultBox.buttonPadding.left() : 0);
|
||||
const auto top = st::defaultBox.buttonPadding.top();
|
||||
cancel->moveToRight(right, top);
|
||||
}, cancel->lifetime());
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ infoTopBarDuration: 150;
|
||||
|
||||
infoLayerTopMinimal: 20px;
|
||||
infoLayerTopMaximal: 40px;
|
||||
infoLayerTopBarHeight: boxLayerTitleHeight;
|
||||
infoLayerTopBarHeight: boxTitleHeight;
|
||||
infoLayerTopBarBackIcon: icon {{ "info_back", boxTitleCloseFg }};
|
||||
infoLayerTopBarBackIconOver: icon {{ "info_back", boxTitleCloseFgOver }};
|
||||
infoLayerTopBarBack: IconButton(infoTopBarBack) {
|
||||
@ -256,7 +256,7 @@ infoLayerTopBar: InfoTopBar(infoTopBar) {
|
||||
height: infoLayerTopBarHeight;
|
||||
back: infoLayerTopBarBack;
|
||||
title: boxTitle;
|
||||
titlePosition: boxLayerTitlePosition;
|
||||
titlePosition: boxTitlePosition;
|
||||
bg: boxBg;
|
||||
mediaCancel: infoLayerTopBarMediaCancel;
|
||||
mediaActionsSkip: 6px;
|
||||
@ -402,7 +402,7 @@ infoProfileToggle: Toggle(defaultToggle) {
|
||||
infoProfileToggleOver: Toggle(infoProfileToggle) {
|
||||
untoggledFg: menuIconFgOver;
|
||||
}
|
||||
infoProfileButton: InfoProfileButton {
|
||||
infoProfileButton: SettingsButton {
|
||||
textFg: windowBoldFg;
|
||||
textFgOver: windowBoldFgOver;
|
||||
textBg: windowBg;
|
||||
@ -419,10 +419,10 @@ infoProfileButton: InfoProfileButton {
|
||||
|
||||
ripple: defaultRippleAnimation;
|
||||
}
|
||||
infoNotificationsButton: InfoProfileButton(infoProfileButton) {
|
||||
infoNotificationsButton: SettingsButton(infoProfileButton) {
|
||||
padding: margins(79px, 13px, 8px, 9px);
|
||||
}
|
||||
infoMainButton: InfoProfileButton(infoProfileButton) {
|
||||
infoMainButton: SettingsButton(infoProfileButton) {
|
||||
textFg: lightButtonFg;
|
||||
textFgOver: lightButtonFgOver;
|
||||
font: semiboldFont;
|
||||
@ -431,14 +431,14 @@ infoSharedMediaCoverHeight: 62px;
|
||||
infoSharedMediaButton: infoProfileButton;
|
||||
infoSharedMediaBottomSkip: 12px;
|
||||
|
||||
infoBlockButton: InfoProfileButton(infoProfileButton) {
|
||||
infoBlockButton: SettingsButton(infoProfileButton) {
|
||||
textFg: attentionButtonFg;
|
||||
textFgOver: attentionButtonFgOver;
|
||||
}
|
||||
infoCreateLinkedChatButton: InfoProfileButton(infoMainButton) {
|
||||
infoCreateLinkedChatButton: SettingsButton(infoMainButton) {
|
||||
padding: margins(74px, 10px, 8px, 8px);
|
||||
}
|
||||
infoUnlinkChatButton: InfoProfileButton(infoCreateLinkedChatButton) {
|
||||
infoUnlinkChatButton: SettingsButton(infoCreateLinkedChatButton) {
|
||||
textFg: attentionButtonFg;
|
||||
textFgOver: attentionButtonFgOver;
|
||||
}
|
||||
@ -587,8 +587,8 @@ infoChannelsList: PeerList(infoCommonGroupsList) {
|
||||
}
|
||||
}
|
||||
|
||||
managePeerButton: InfoProfileCountButton {
|
||||
button: InfoProfileButton(infoProfileButton) {
|
||||
managePeerButton: SettingsCountButton {
|
||||
button: SettingsButton(infoProfileButton) {
|
||||
padding: margins(76px, 12px, 76px, 10px);
|
||||
}
|
||||
iconPosition: point(20px, 5px);
|
||||
@ -598,31 +598,31 @@ managePeerButton: InfoProfileCountButton {
|
||||
labelPosition: point(25px, 12px);
|
||||
}
|
||||
|
||||
peerPermissionsButton: InfoProfileCountButton(managePeerButton) {
|
||||
button: InfoProfileButton(infoProfileButton) {
|
||||
peerPermissionsButton: SettingsCountButton(managePeerButton) {
|
||||
button: SettingsButton(infoProfileButton) {
|
||||
padding: margins(24px, 12px, 24px, 10px);
|
||||
}
|
||||
iconPosition: point(24px, 5px);
|
||||
}
|
||||
|
||||
manageGroupButton: InfoProfileCountButton(managePeerButton) {
|
||||
button: InfoProfileButton(infoProfileButton) {
|
||||
manageGroupButton: SettingsCountButton(managePeerButton) {
|
||||
button: SettingsButton(infoProfileButton) {
|
||||
padding: margins(72px, 10px, 24px, 8px);
|
||||
}
|
||||
labelPosition: point(22px, 12px);
|
||||
iconPosition: point(20px, 4px);
|
||||
}
|
||||
|
||||
manageGroupTopButtonWithText: InfoProfileCountButton(manageGroupButton) {
|
||||
button: InfoProfileButton(infoProfileButton) {
|
||||
manageGroupTopButtonWithText: SettingsCountButton(manageGroupButton) {
|
||||
button: SettingsButton(infoProfileButton) {
|
||||
padding: margins(22px, 10px, 24px, 8px);
|
||||
}
|
||||
labelPosition: point(22px, 10px);
|
||||
iconPosition: point(0px, 0px);
|
||||
}
|
||||
|
||||
manageDeleteGroupButton: InfoProfileCountButton(manageGroupTopButtonWithText) {
|
||||
button: InfoProfileButton(infoProfileButton) {
|
||||
manageDeleteGroupButton: SettingsCountButton(manageGroupTopButtonWithText) {
|
||||
button: SettingsButton(infoProfileButton) {
|
||||
padding: margins(25px, 11px, 24px, 8px);
|
||||
textFg: attentionButtonFg;
|
||||
textFgOver: attentionButtonFg;
|
||||
@ -634,7 +634,7 @@ manageDeleteGroupButton: InfoProfileCountButton(manageGroupTopButtonWithText) {
|
||||
editPeerSkip: 7px;
|
||||
editPeerHistoryVisibilityMargins: margins(15px, 0px, 20px, 16px);
|
||||
|
||||
terminateSessionsButton: InfoProfileButton(infoBlockButton) {
|
||||
terminateSessionsButton: SettingsButton(infoBlockButton) {
|
||||
padding: margins(23px, 12px, 23px, 10px);
|
||||
}
|
||||
|
||||
|
@ -13,10 +13,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "storage/storage_shared_media.h"
|
||||
#include "info/info_memento.h"
|
||||
#include "info/info_controller.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "info/profile/info_profile_values.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "window/window_session_controller.h"
|
||||
#include "data/data_channel.h"
|
||||
#include "data/data_user.h"
|
||||
@ -53,7 +53,7 @@ inline auto AddCountedButton(
|
||||
Ui::MultiSlideTracker &tracker) {
|
||||
using namespace rpl::mappers;
|
||||
|
||||
using Button = Profile::Button;
|
||||
using Button = Ui::SettingsButton;
|
||||
auto forked = std::move(count)
|
||||
| start_spawning(parent->lifetime());
|
||||
auto text = rpl::duplicate(
|
||||
|
@ -12,11 +12,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "info/media/info_media_list_widget.h"
|
||||
#include "info/media/info_media_buttons.h"
|
||||
#include "info/media/info_media_empty_widget.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "info/profile/info_profile_icon.h"
|
||||
#include "info/info_controller.h"
|
||||
#include "ui/widgets/discrete_sliders.h"
|
||||
#include "ui/widgets/shadow.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/box_content_divider.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/search_field_controller.h"
|
||||
|
@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/widgets/shadow.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/box_content_divider.h"
|
||||
#include "ui/layers/generic_box.h"
|
||||
#include "ui/toast/toast.h"
|
||||
@ -34,7 +35,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "info/info_memento.h"
|
||||
#include "info/profile/info_profile_icon.h"
|
||||
#include "info/profile/info_profile_values.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "info/profile/info_profile_text.h"
|
||||
#include "support/support_helper.h"
|
||||
#include "window/window_session_controller.h"
|
||||
@ -76,11 +76,11 @@ auto AddActionButton(
|
||||
Text &&text,
|
||||
ToggleOn &&toggleOn,
|
||||
Callback &&callback,
|
||||
const style::InfoProfileButton &st
|
||||
const style::SettingsButton &st
|
||||
= st::infoSharedMediaButton) {
|
||||
auto result = parent->add(object_ptr<Ui::SlideWrap<Button>>(
|
||||
auto result = parent->add(object_ptr<Ui::SlideWrap<Ui::SettingsButton>>(
|
||||
parent,
|
||||
object_ptr<Button>(
|
||||
object_ptr<Ui::SettingsButton>(
|
||||
parent,
|
||||
std::move(text),
|
||||
st))
|
||||
@ -349,7 +349,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||
|
||||
object_ptr<Ui::RpWidget> DetailsFiller::setupMuteToggle() {
|
||||
const auto peer = _peer;
|
||||
auto result = object_ptr<Button>(
|
||||
auto result = object_ptr<Ui::SettingsButton>(
|
||||
_wrap,
|
||||
tr::lng_profile_enable_notifications(),
|
||||
st::infoNotificationsButton);
|
||||
@ -758,7 +758,7 @@ object_ptr<Ui::RpWidget> ActionsFiller::fill() {
|
||||
// using namespace rpl::mappers;
|
||||
// const auto feed = _feed;
|
||||
// const auto feedId = feed->id();
|
||||
// auto result = object_ptr<Button>(
|
||||
// auto result = object_ptr<Ui::SettingsButton>(
|
||||
// _wrap,
|
||||
// tr::lng_info_feed_is_default(),
|
||||
// st::infoNotificationsButton);
|
||||
|
@ -1,156 +0,0 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "info/profile/info_profile_button.h"
|
||||
|
||||
#include <rpl/never.h>
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "styles/style_info.h"
|
||||
|
||||
namespace Info {
|
||||
namespace Profile {
|
||||
|
||||
Button::Button(
|
||||
QWidget *parent,
|
||||
rpl::producer<QString> &&text)
|
||||
: Button(parent, std::move(text), st::infoProfileButton) {
|
||||
}
|
||||
|
||||
Button::Button(
|
||||
QWidget *parent,
|
||||
rpl::producer<QString> &&text,
|
||||
const style::InfoProfileButton &st)
|
||||
: RippleButton(parent, st.ripple)
|
||||
, _st(st) {
|
||||
std::move(
|
||||
text
|
||||
) | rpl::start_with_next([this](QString &&value) {
|
||||
setText(std::move(value));
|
||||
}, lifetime());
|
||||
}
|
||||
|
||||
Button *Button::toggleOn(rpl::producer<bool> &&toggled) {
|
||||
Expects(_toggle == nullptr);
|
||||
_toggle = std::make_unique<Ui::ToggleView>(
|
||||
isOver() ? _st.toggleOver : _st.toggle,
|
||||
false,
|
||||
[this] { rtlupdate(toggleRect()); });
|
||||
addClickHandler([this] {
|
||||
_toggle->setChecked(!_toggle->checked(), anim::type::normal);
|
||||
});
|
||||
std::move(
|
||||
toggled
|
||||
) | rpl::start_with_next([this](bool toggled) {
|
||||
_toggle->setChecked(toggled, anim::type::normal);
|
||||
}, lifetime());
|
||||
_toggle->finishAnimating();
|
||||
return this;
|
||||
}
|
||||
|
||||
bool Button::toggled() const {
|
||||
return _toggle ? _toggle->checked() : false;
|
||||
}
|
||||
|
||||
rpl::producer<bool> Button::toggledChanges() const {
|
||||
if (_toggle) {
|
||||
return _toggle->checkedChanges();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
rpl::producer<bool> Button::toggledValue() const {
|
||||
if (_toggle) {
|
||||
return _toggle->checkedValue();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Button::setColorOverride(std::optional<QColor> textColorOverride) {
|
||||
_textColorOverride = textColorOverride;
|
||||
update();
|
||||
}
|
||||
|
||||
void Button::paintEvent(QPaintEvent *e) {
|
||||
Painter p(this);
|
||||
|
||||
auto paintOver = (isOver() || isDown()) && !isDisabled();
|
||||
p.fillRect(e->rect(), paintOver ? _st.textBgOver : _st.textBg);
|
||||
|
||||
paintRipple(p, 0, 0);
|
||||
|
||||
auto outerw = width();
|
||||
p.setFont(_st.font);
|
||||
p.setPen(_textColorOverride
|
||||
? QPen(*_textColorOverride)
|
||||
: paintOver
|
||||
? _st.textFgOver
|
||||
: _st.textFg);
|
||||
p.drawTextLeft(
|
||||
_st.padding.left(),
|
||||
_st.padding.top(),
|
||||
outerw,
|
||||
_text,
|
||||
_textWidth);
|
||||
|
||||
if (_toggle) {
|
||||
auto rect = toggleRect();
|
||||
_toggle->paint(p, rect.left(), rect.top(), outerw);
|
||||
}
|
||||
}
|
||||
|
||||
QRect Button::toggleRect() const {
|
||||
Expects(_toggle != nullptr);
|
||||
|
||||
auto size = _toggle->getSize();
|
||||
auto left = width() - _st.toggleSkip - size.width();
|
||||
auto top = (height() - size.height()) / 2;
|
||||
return { QPoint(left, top), size };
|
||||
}
|
||||
|
||||
int Button::resizeGetHeight(int newWidth) {
|
||||
updateVisibleText(newWidth);
|
||||
return _st.padding.top() + _st.height + _st.padding.bottom();
|
||||
}
|
||||
|
||||
void Button::onStateChanged(
|
||||
State was,
|
||||
StateChangeSource source) {
|
||||
if (!isDisabled() || !isDown()) {
|
||||
RippleButton::onStateChanged(was, source);
|
||||
}
|
||||
if (_toggle) {
|
||||
_toggle->setStyle(isOver() ? _st.toggleOver : _st.toggle);
|
||||
}
|
||||
setPointerCursor(!isDisabled());
|
||||
}
|
||||
|
||||
void Button::setText(QString &&text) {
|
||||
_original = std::move(text);
|
||||
_originalWidth = _st.font->width(_original);
|
||||
updateVisibleText(width());
|
||||
}
|
||||
|
||||
void Button::updateVisibleText(int newWidth) {
|
||||
auto availableWidth = newWidth
|
||||
- _st.padding.left()
|
||||
- _st.padding.right();
|
||||
if (_toggle) {
|
||||
availableWidth -= (width() - toggleRect().x());
|
||||
}
|
||||
accumulate_max(availableWidth, 0);
|
||||
if (availableWidth < _originalWidth) {
|
||||
_text = _st.font->elided(_original, availableWidth);
|
||||
_textWidth = _st.font->width(_text);
|
||||
} else {
|
||||
_text = _original;
|
||||
_textWidth = _originalWidth;
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
} // namespace Profile
|
||||
} // namespace Info
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "ui/widgets/buttons.h"
|
||||
|
||||
namespace Ui {
|
||||
class ToggleView;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Info {
|
||||
namespace Profile {
|
||||
|
||||
class Button : public Ui::RippleButton {
|
||||
public:
|
||||
Button(
|
||||
QWidget *parent,
|
||||
rpl::producer<QString> &&text);
|
||||
Button(
|
||||
QWidget *parent,
|
||||
rpl::producer<QString> &&text,
|
||||
const style::InfoProfileButton &st);
|
||||
|
||||
Button *toggleOn(rpl::producer<bool> &&toggled);
|
||||
bool toggled() const;
|
||||
rpl::producer<bool> toggledChanges() const;
|
||||
rpl::producer<bool> toggledValue() const;
|
||||
|
||||
void setColorOverride(std::optional<QColor> textColorOverride);
|
||||
|
||||
protected:
|
||||
int resizeGetHeight(int newWidth) override;
|
||||
void onStateChanged(
|
||||
State was,
|
||||
StateChangeSource source) override;
|
||||
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
|
||||
private:
|
||||
void setText(QString &&text);
|
||||
QRect toggleRect() const;
|
||||
void updateVisibleText(int newWidth);
|
||||
|
||||
const style::InfoProfileButton &_st;
|
||||
QString _original;
|
||||
QString _text;
|
||||
int _originalWidth = 0;
|
||||
int _textWidth = 0;
|
||||
std::unique_ptr<Ui::ToggleView> _toggle;
|
||||
std::optional<QColor> _textColorOverride;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Profile
|
||||
} // namespace Info
|
@ -12,7 +12,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <rpl/flatten_latest.h>
|
||||
#include "info/info_memento.h"
|
||||
#include "info/info_controller.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "info/profile/info_profile_widget.h"
|
||||
#include "info/profile/info_profile_text.h"
|
||||
#include "info/profile/info_profile_values.h"
|
||||
|
@ -12,7 +12,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "info/profile/info_profile_values.h"
|
||||
#include "info/profile/info_profile_icon.h"
|
||||
#include "info/profile/info_profile_values.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "info/profile/info_profile_members_controllers.h"
|
||||
#include "info/members/info_members_widget.h"
|
||||
#include "info/info_content_widget.h"
|
||||
@ -124,7 +123,7 @@ void Members::setupHeader() {
|
||||
st::infoMembersHeader);
|
||||
auto parent = _header.data();
|
||||
|
||||
_openMembers = Ui::CreateChild<Button>(
|
||||
_openMembers = Ui::CreateChild<Ui::SettingsButton>(
|
||||
parent,
|
||||
rpl::single(QString()));
|
||||
|
||||
|
@ -17,6 +17,7 @@ class IconButton;
|
||||
class FlatLabel;
|
||||
struct ScrollToRequest;
|
||||
class AbstractButton;
|
||||
class SettingsButton;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Info {
|
||||
@ -26,7 +27,6 @@ enum class Wrap;
|
||||
|
||||
namespace Profile {
|
||||
|
||||
class Button;
|
||||
class Memento;
|
||||
struct MembersState {
|
||||
std::unique_ptr<PeerListState> list;
|
||||
@ -108,7 +108,7 @@ private:
|
||||
object_ptr<Ui::RpWidget> _header = { nullptr };
|
||||
object_ptr<ListWidget> _list = { nullptr };
|
||||
|
||||
Button *_openMembers = nullptr;
|
||||
Ui::SettingsButton *_openMembers = nullptr;
|
||||
Ui::RpWidget *_titleWrap = nullptr;
|
||||
Ui::FlatLabel *_title = nullptr;
|
||||
Ui::IconButton *_addMember = nullptr;
|
||||
|
@ -123,7 +123,7 @@ passportRowTitleFg: windowFg;
|
||||
passportRowDescriptionFg: windowSubTextFg;
|
||||
|
||||
passportScansHeaderPadding: margins(22px, 10px, 22px, 10px);
|
||||
passportUploadButton: InfoProfileButton {
|
||||
passportUploadButton: SettingsButton {
|
||||
textFg: windowActiveTextFg;
|
||||
textFgOver: windowActiveTextFg;
|
||||
textBg: windowBg;
|
||||
@ -140,7 +140,7 @@ passportUploadButtonPadding: margins(0px, 10px, 0px, 10px);
|
||||
passportUploadHeaderPadding: margins(22px, 14px, 22px, 3px);
|
||||
passportUploadErrorPadding: margins(22px, 5px, 22px, 5px);
|
||||
passportValueErrorPadding: passportUploadHeaderPadding;
|
||||
passportDeleteButton: InfoProfileButton(passportUploadButton) {
|
||||
passportDeleteButton: SettingsButton(passportUploadButton) {
|
||||
textFg: attentionButtonFg;
|
||||
textFgOver: attentionButtonFgOver;
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#include "passport/passport_panel_controller.h"
|
||||
#include "passport/passport_panel_details_row.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
@ -237,7 +236,7 @@ void PanelEditContact::setupControls(
|
||||
st::passportFormDividerHeight));
|
||||
if (!existing.isEmpty()) {
|
||||
_content->add(
|
||||
object_ptr<Info::Profile::Button>(
|
||||
object_ptr<Ui::SettingsButton>(
|
||||
_content,
|
||||
tr::lng_passport_use_existing(
|
||||
lt_existing,
|
||||
@ -322,7 +321,7 @@ void PanelEditContact::setupControls(
|
||||
|
||||
if (auto text = _controller->deleteValueLabel()) {
|
||||
_content->add(
|
||||
object_ptr<Info::Profile::Button>(
|
||||
object_ptr<Ui::SettingsButton>(
|
||||
_content,
|
||||
std::move(*text) | Ui::Text::ToUpper(),
|
||||
st::passportDeleteButton),
|
||||
|
@ -10,7 +10,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "passport/passport_panel_controller.h"
|
||||
#include "passport/passport_panel_details_row.h"
|
||||
#include "passport/passport_panel_edit_scans.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
@ -484,7 +483,7 @@ not_null<Ui::RpWidget*> PanelEditDocument::setupContent(
|
||||
}
|
||||
if (auto text = _controller->deleteValueLabel()) {
|
||||
inner->add(
|
||||
object_ptr<Info::Profile::Button>(
|
||||
object_ptr<Ui::SettingsButton>(
|
||||
inner,
|
||||
std::move(*text) | Ui::Text::ToUpper(),
|
||||
st::passportDeleteButton),
|
||||
|
@ -18,17 +18,12 @@ class PlainShadow;
|
||||
class FlatLabel;
|
||||
class RoundButton;
|
||||
class VerticalLayout;
|
||||
class SettingsButton;
|
||||
class BoxContent;
|
||||
template <typename Widget>
|
||||
class SlideWrap;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Info {
|
||||
namespace Profile {
|
||||
class Button;
|
||||
} // namespace Profile
|
||||
} // namespace Info
|
||||
|
||||
namespace Passport {
|
||||
|
||||
class PanelController;
|
||||
@ -160,7 +155,7 @@ private:
|
||||
bool _fieldsChanged = false;
|
||||
bool _additionalShown = false;
|
||||
|
||||
QPointer<Info::Profile::Button> _delete;
|
||||
QPointer<Ui::SettingsButton> _delete;
|
||||
|
||||
object_ptr<Ui::RoundButton> _done;
|
||||
|
||||
|
@ -9,7 +9,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#include "passport/passport_panel_controller.h"
|
||||
#include "passport/passport_panel_details_row.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/box_content_divider.h"
|
||||
@ -121,7 +120,7 @@ struct EditScans::SpecialScan {
|
||||
QPointer<Ui::SlideWrap<Ui::FlatLabel>> header;
|
||||
QPointer<Ui::VerticalLayout> wrap;
|
||||
base::unique_qptr<Ui::SlideWrap<ScanButton>> row;
|
||||
QPointer<Info::Profile::Button> upload;
|
||||
QPointer<Ui::SettingsButton> upload;
|
||||
bool errorShown = false;
|
||||
Ui::Animations::Simple errorAnimation;
|
||||
rpl::variable<bool> rowCreated;
|
||||
@ -581,7 +580,7 @@ void EditScans::setupList(
|
||||
}
|
||||
|
||||
list.upload = container->add(
|
||||
object_ptr<Info::Profile::Button>(
|
||||
object_ptr<Ui::SettingsButton>(
|
||||
container,
|
||||
list.uploadTexts.events_starting_with(
|
||||
list.uploadButtonText()
|
||||
@ -692,7 +691,7 @@ void EditScans::setupSpecialScans(
|
||||
}) | rpl::flatten_latest(
|
||||
) | Ui::Text::ToUpper();
|
||||
scan.upload = inner->add(
|
||||
object_ptr<Info::Profile::Button>(
|
||||
object_ptr<Ui::SettingsButton>(
|
||||
inner,
|
||||
std::move(label),
|
||||
st::passportUploadButton),
|
||||
|
@ -14,17 +14,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
namespace Ui {
|
||||
class BoxContentDivider;
|
||||
class VerticalLayout;
|
||||
class SettingsButton;
|
||||
class FlatLabel;
|
||||
template <typename Widget>
|
||||
class SlideWrap;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Info {
|
||||
namespace Profile {
|
||||
class Button;
|
||||
} // namespace Profile
|
||||
} // namespace Info
|
||||
|
||||
namespace Passport {
|
||||
|
||||
enum class FileType;
|
||||
@ -100,7 +95,7 @@ private:
|
||||
QPointer<Ui::SlideWrap<Ui::FlatLabel>> uploadMoreError;
|
||||
QPointer<Ui::VerticalLayout> wrap;
|
||||
std::vector<base::unique_qptr<Ui::SlideWrap<ScanButton>>> rows;
|
||||
QPointer<Info::Profile::Button> upload;
|
||||
QPointer<Ui::SettingsButton> upload;
|
||||
rpl::event_stream<rpl::producer<QString>> uploadTexts;
|
||||
bool errorShown = false;
|
||||
Ui::Animations::Simple errorAnimation;
|
||||
|
@ -10,14 +10,14 @@ using "ui/widgets/widgets.style";
|
||||
using "info/info.style";
|
||||
using "boxes/boxes.style";
|
||||
|
||||
settingsSectionButton: InfoProfileButton(infoProfileButton) {
|
||||
settingsSectionButton: SettingsButton(infoProfileButton) {
|
||||
font: boxTextFont;
|
||||
padding: margins(79px, 13px, 22px, 11px);
|
||||
}
|
||||
settingsButton: InfoProfileButton(settingsSectionButton) {
|
||||
settingsButton: SettingsButton(settingsSectionButton) {
|
||||
padding: margins(22px, 10px, 22px, 8px);
|
||||
}
|
||||
settingsAttentionButton: InfoProfileButton(settingsButton) {
|
||||
settingsAttentionButton: SettingsButton(settingsButton) {
|
||||
textFg: attentionButtonFg;
|
||||
textFgOver: attentionButtonFgOver;
|
||||
}
|
||||
@ -37,14 +37,14 @@ settingsSlider: SettingsSlider(defaultSettingsSlider) {
|
||||
labelFg: windowSubTextFg;
|
||||
labelFgActive: windowActiveTextFg;
|
||||
}
|
||||
settingsUpdateToggle: InfoProfileButton(settingsButton) {
|
||||
settingsUpdateToggle: SettingsButton(settingsButton) {
|
||||
height: 40px;
|
||||
padding: margins(22px, 8px, 22px, 8px);
|
||||
}
|
||||
settingsUpdateState: FlatLabel(defaultFlatLabel) {
|
||||
textFg: windowSubTextFg;
|
||||
}
|
||||
settingsUpdate: InfoProfileButton(infoMainButton, settingsButton) {
|
||||
settingsUpdate: SettingsButton(infoMainButton, settingsButton) {
|
||||
}
|
||||
settingsUpdateStatePosition: point(22px, 29px);
|
||||
settingsDividerLabelPadding: margins(22px, 10px, 22px, 19px);
|
||||
@ -112,7 +112,7 @@ settingsInfoPhotoTop: 17px;
|
||||
settingsInfoPhotoSkip: 16px;
|
||||
settingsInfoPhotoSet: defaultActiveButton;
|
||||
|
||||
settingsInfoRow: InfoProfileButton(settingsButton) {
|
||||
settingsInfoRow: SettingsButton(settingsButton) {
|
||||
height: 62px;
|
||||
padding: margins(0px, 0px, 0px, 0px);
|
||||
}
|
||||
@ -160,7 +160,7 @@ settingsBioLabelPadding: margins(22px, 11px, 22px, 0px);
|
||||
|
||||
settingsPrivacyEditLabelPadding: margins(22px, 11px, 22px, 11px);
|
||||
|
||||
settingsChatButton: InfoProfileButton(settingsSectionButton) {
|
||||
settingsChatButton: SettingsButton(settingsSectionButton) {
|
||||
padding: margins(59px, 13px, 22px, 11px);
|
||||
}
|
||||
settingsChatIconLeft: 19px;
|
||||
@ -193,7 +193,7 @@ settingsThemeMinSkip: 4px;
|
||||
settingsThemeNotSupportedBg: windowBgOver;
|
||||
settingsThemeNotSupportedIcon: icon {{ "theme_preview", menuIconFg }};
|
||||
|
||||
autoDownloadLimitButton: InfoProfileButton(settingsButton) {
|
||||
autoDownloadLimitButton: SettingsButton(settingsButton) {
|
||||
padding: margins(22px, 10px, 22px, 0px);
|
||||
}
|
||||
settingsAudioVolumeSlider: MediaSlider(defaultContinuousSlider) {
|
||||
|
@ -13,11 +13,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/text/text_utilities.h" // Ui::Text::ToUpper
|
||||
#include "boxes/connection_box.h"
|
||||
#include "boxes/about_box.h"
|
||||
#include "boxes/confirm_box.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "platform/platform_specific.h"
|
||||
#include "base/platform/base_platform_info.h"
|
||||
#include "window/window_session_controller.h"
|
||||
|
@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/level_meter.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "boxes/single_choice_box.h"
|
||||
#include "boxes/confirm_box.h"
|
||||
#include "platform/platform_specific.h"
|
||||
|
@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/layers/generic_box.h"
|
||||
#include "ui/effects/radial_animation.h"
|
||||
@ -34,7 +35,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "window/themes/window_themes_cloud_list.h"
|
||||
#include "window/window_session_controller.h"
|
||||
#include "window/window_controller.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "storage/localstorage.h"
|
||||
#include "core/file_utilities.h"
|
||||
#include "core/application.h"
|
||||
|
@ -18,7 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/box_content_divider.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "boxes/abstract_box.h"
|
||||
#include "window/themes/window_theme_editor_box.h"
|
||||
#include "window/window_session_controller.h"
|
||||
@ -83,7 +83,7 @@ void AddDividerText(
|
||||
not_null<Button*> AddButton(
|
||||
not_null<Ui::VerticalLayout*> container,
|
||||
rpl::producer<QString> text,
|
||||
const style::InfoProfileButton &st,
|
||||
const style::SettingsButton &st,
|
||||
const style::icon *leftIcon,
|
||||
int iconLeft) {
|
||||
const auto result = container->add(object_ptr<Button>(
|
||||
@ -120,7 +120,7 @@ not_null<Button*> AddButton(
|
||||
void CreateRightLabel(
|
||||
not_null<Button*> button,
|
||||
rpl::producer<QString> label,
|
||||
const style::InfoProfileButton &st,
|
||||
const style::SettingsButton &st,
|
||||
rpl::producer<QString> buttonText) {
|
||||
const auto name = Ui::CreateChild<Ui::FlatLabel>(
|
||||
button.get(),
|
||||
@ -149,7 +149,7 @@ not_null<Button*> AddButtonWithLabel(
|
||||
not_null<Ui::VerticalLayout*> container,
|
||||
rpl::producer<QString> text,
|
||||
rpl::producer<QString> label,
|
||||
const style::InfoProfileButton &st,
|
||||
const style::SettingsButton &st,
|
||||
const style::icon *leftIcon,
|
||||
int iconLeft) {
|
||||
const auto button = AddButton(
|
||||
|
@ -17,20 +17,15 @@ class Session;
|
||||
namespace Ui {
|
||||
class VerticalLayout;
|
||||
class FlatLabel;
|
||||
class SettingsButton;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Window {
|
||||
class SessionController;
|
||||
} // namespace Window
|
||||
|
||||
namespace Info {
|
||||
namespace Profile {
|
||||
class Button;
|
||||
} // namespace Profile
|
||||
} // namespace Info
|
||||
|
||||
namespace style {
|
||||
struct InfoProfileButton;
|
||||
struct SettingsButton;
|
||||
} // namespace style
|
||||
|
||||
namespace Settings {
|
||||
@ -45,7 +40,7 @@ enum class Type {
|
||||
Calls,
|
||||
};
|
||||
|
||||
using Button = Info::Profile::Button;
|
||||
using Button = Ui::SettingsButton;
|
||||
|
||||
class Section : public Ui::RpWidget {
|
||||
public:
|
||||
@ -77,20 +72,20 @@ void AddDividerText(
|
||||
not_null<Button*> AddButton(
|
||||
not_null<Ui::VerticalLayout*> container,
|
||||
rpl::producer<QString> text,
|
||||
const style::InfoProfileButton &st,
|
||||
const style::SettingsButton &st,
|
||||
const style::icon *leftIcon = nullptr,
|
||||
int iconLeft = 0);
|
||||
not_null<Button*> AddButtonWithLabel(
|
||||
not_null<Ui::VerticalLayout*> container,
|
||||
rpl::producer<QString> text,
|
||||
rpl::producer<QString> label,
|
||||
const style::InfoProfileButton &st,
|
||||
const style::SettingsButton &st,
|
||||
const style::icon *leftIcon = nullptr,
|
||||
int iconLeft = 0);
|
||||
void CreateRightLabel(
|
||||
not_null<Button*> button,
|
||||
rpl::producer<QString> label,
|
||||
const style::InfoProfileButton &st,
|
||||
const style::SettingsButton &st,
|
||||
rpl::producer<QString> buttonText);
|
||||
not_null<Ui::FlatLabel*> AddSubsectionTitle(
|
||||
not_null<Ui::VerticalLayout*> container,
|
||||
|
@ -24,7 +24,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "boxes/username_box.h"
|
||||
#include "data/data_user.h"
|
||||
#include "info/profile/info_profile_values.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "main/main_session.h"
|
||||
#include "window/window_session_controller.h"
|
||||
|
@ -16,7 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/discrete_sliders.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "info/profile/info_profile_cover.h"
|
||||
#include "data/data_user.h"
|
||||
#include "data/data_session.h"
|
||||
|
@ -15,7 +15,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/discrete_sliders.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "storage/localstorage.h"
|
||||
#include "window/notifications_manager.h"
|
||||
#include "window/window_session_controller.h"
|
||||
|
@ -21,10 +21,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/wrap/fade_wrap.h"
|
||||
#include "ui/widgets/shadow.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "calls/calls_instance.h"
|
||||
#include "core/core_cloud_password.h"
|
||||
#include "core/update_checker.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "platform/platform_specific.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "data/data_session.h"
|
||||
|
@ -307,7 +307,7 @@ void CountrySelectBox::Inner::paintEvent(QPaintEvent *e) {
|
||||
|
||||
auto name = QString::fromUtf8(list[i]->name);
|
||||
auto nameWidth = st::countryRowNameFont->width(name);
|
||||
auto availWidth = width() - st::countryRowPadding.left() - st::countryRowPadding.right() - codeWidth - st::boxLayerScroll.width;
|
||||
auto availWidth = width() - st::countryRowPadding.left() - st::countryRowPadding.right() - codeWidth - st::boxScroll.width;
|
||||
if (nameWidth > availWidth) {
|
||||
name = st::countryRowNameFont->elided(name, availWidth);
|
||||
nameWidth = st::countryRowNameFont->width(name);
|
||||
|
@ -527,7 +527,7 @@ void Editor::Inner::paintEvent(QPaintEvent *e) {
|
||||
p.setFont(st::boxTitleFont);
|
||||
p.setPen(st::windowFg);
|
||||
if (!_newRows->isHidden()) {
|
||||
p.drawTextLeft(st::themeEditorMargin.left(), _existingRows->y() + _existingRows->height() + st::boxLayerTitlePosition.y(), width(), tr::lng_theme_editor_new_keys(tr::now));
|
||||
p.drawTextLeft(st::themeEditorMargin.left(), _existingRows->y() + _existingRows->height() + st::boxTitlePosition.y(), width(), tr::lng_theme_editor_new_keys(tr::now));
|
||||
}
|
||||
}
|
||||
|
||||
@ -537,7 +537,7 @@ int Editor::Inner::resizeGetHeight(int newWidth) {
|
||||
_newRows->resizeToWidth(rowsWidth);
|
||||
|
||||
_existingRows->moveToLeft(0, 0);
|
||||
_newRows->moveToLeft(0, _existingRows->height() + st::boxLayerTitleHeight);
|
||||
_newRows->moveToLeft(0, _existingRows->height() + st::boxTitleHeight);
|
||||
|
||||
auto lowest = (_newRows->isHidden() ? _existingRows : _newRows).data();
|
||||
|
||||
|
@ -16,11 +16,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/image/image_prepare.h"
|
||||
#include "ui/toast/toast.h"
|
||||
#include "ui/special_fields.h"
|
||||
#include "info/profile/info_profile_button.h"
|
||||
#include "main/main_account.h"
|
||||
#include "main/main_session.h"
|
||||
#include "storage/localstorage.h"
|
||||
@ -701,7 +701,7 @@ void CreateForExistingBox(
|
||||
st::boxDividerLabel));
|
||||
|
||||
box->addRow(
|
||||
object_ptr<Info::Profile::Button>(
|
||||
object_ptr<Ui::SettingsButton>(
|
||||
box,
|
||||
tr::lng_theme_editor_import_existing() | Ui::Text::ToUpper(),
|
||||
st::createThemeImportButton),
|
||||
|
@ -81,9 +81,9 @@ void WarningWidget::resizeEvent(QResizeEvent *e) {
|
||||
}
|
||||
|
||||
void WarningWidget::updateControlsGeometry() {
|
||||
auto left = _inner.x() + _inner.width() - st::boxButtonPadding.right() - _keepChanges->width();
|
||||
_keepChanges->moveToLeft(left, _inner.y() + _inner.height() - st::boxButtonPadding.bottom() - _keepChanges->height());
|
||||
_revert->moveToLeft(left - st::boxButtonPadding.left() - _revert->width(), _keepChanges->y());
|
||||
auto left = _inner.x() + _inner.width() - st::defaultBox.buttonPadding.right() - _keepChanges->width();
|
||||
_keepChanges->moveToLeft(left, _inner.y() + _inner.height() - st::defaultBox.buttonPadding.bottom() - _keepChanges->height());
|
||||
_revert->moveToLeft(left - st::defaultBox.buttonPadding.left() - _revert->width(), _keepChanges->y());
|
||||
}
|
||||
|
||||
void WarningWidget::refreshLang() {
|
||||
|
@ -214,7 +214,7 @@ windowOutdatedClose: IconButton(defaultIconButton) {
|
||||
iconPosition: point(-1px, -1px);
|
||||
}
|
||||
|
||||
createThemeImportButton: InfoProfileButton {
|
||||
createThemeImportButton: SettingsButton {
|
||||
textFg: lightButtonFg;
|
||||
textFgOver: lightButtonFgOver;
|
||||
textBg: windowBg;
|
||||
|
@ -149,9 +149,9 @@ if %BuildUWP% equ 0 (
|
||||
if %AlphaVersion% equ 0 (
|
||||
iscc /dMyAppVersion=%AppVersionStrSmall% /dMyAppVersionZero=%AppVersionStr% /dMyAppVersionFull=%AppVersionStrFull% "/dReleasePath=%ReleasePath%" "%FullScriptPath%setup.iss"
|
||||
if %errorlevel% neq 0 goto error
|
||||
if not exist "tsetup.%AppVersionStrFull%.exe" goto error
|
||||
if not exist "%SetupFile%" goto error
|
||||
:sign3
|
||||
call "%SignPath%" "tsetup.%AppVersionStrFull%.exe"
|
||||
call "%SignPath%" "%SetupFile%"
|
||||
if %errorlevel% neq 0 (
|
||||
timeout /t 3
|
||||
goto sign3
|
||||
|
@ -136,6 +136,8 @@
|
||||
<(src_loc)/chat_helpers/tabbed_selector.h
|
||||
<(src_loc)/core/application.cpp
|
||||
<(src_loc)/core/application.h
|
||||
<(src_loc)/core/base_integration.cpp
|
||||
<(src_loc)/core/base_integration.h
|
||||
<(src_loc)/core/changelogs.cpp
|
||||
<(src_loc)/core/changelogs.h
|
||||
<(src_loc)/core/click_handler_types.cpp
|
||||
@ -402,8 +404,6 @@
|
||||
<(src_loc)/info/members/info_members_widget.h
|
||||
<(src_loc)/info/profile/info_profile_actions.cpp
|
||||
<(src_loc)/info/profile/info_profile_actions.h
|
||||
<(src_loc)/info/profile/info_profile_button.cpp
|
||||
<(src_loc)/info/profile/info_profile_button.h
|
||||
<(src_loc)/info/profile/info_profile_cover.cpp
|
||||
<(src_loc)/info/profile/info_profile_cover.h
|
||||
<(src_loc)/info/profile/info_profile_icon.cpp
|
||||
|
@ -16,6 +16,7 @@
|
||||
'-lDbgHelp',
|
||||
'-lOpenAL32',
|
||||
'-lopus',
|
||||
'-lRstrtmgr',
|
||||
],
|
||||
'msvs_settings': {
|
||||
'VCLinkerTool': {
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 7f9a2d5e9a3145106c3181ad38356f6335101f84
|
||||
Subproject commit 26f277d633ed23dd87c4a332f1ee2d4ec57ec10b
|
@ -1 +1 @@
|
||||
Subproject commit 0dc3f7048a829c9209b31607d28b748aa3890cf1
|
||||
Subproject commit 9c353d1abbcc022c4f362a161216a2f1d65ab85d
|
@ -1 +1 @@
|
||||
Subproject commit fe845712aaab48fa7b2afd5dc45ecb69b3fdf1fa
|
||||
Subproject commit ba12ebc67ab4c6d47dba4d2873b0efdf574680a6
|
Loading…
Reference in New Issue
Block a user