mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Slightly simplified resize handler for menu items.
This commit is contained in:
@@ -32,7 +32,7 @@ CoverItem::CoverItem(
|
||||
, _st(st) {
|
||||
setPointerCursor(false);
|
||||
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
enableMouseSelecting();
|
||||
enableMouseSelecting(_cover.widget());
|
||||
|
||||
@@ -66,7 +66,7 @@ AboutItem::AboutItem(
|
||||
, _dummyAction(new QAction(parent)) {
|
||||
setPointerCursor(false);
|
||||
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
enableMouseSelecting();
|
||||
enableMouseSelecting(_text.get());
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ JoinAsAction::JoinAsAction(
|
||||
+ st::groupCallJoinAsPhotoSize
|
||||
+ st::groupCallJoinAsPadding.bottom()) {
|
||||
setAcceptBoth(true);
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
setClickedCallback(std::move(callback));
|
||||
|
||||
paintRequest(
|
||||
@@ -262,7 +262,7 @@ RecordingAction::RecordingAction(
|
||||
}, lifetime());
|
||||
|
||||
setAcceptBoth(true);
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
setClickedCallback(std::move(callback));
|
||||
|
||||
paintRequest(
|
||||
|
||||
@@ -65,7 +65,7 @@ MenuVolumeItem::MenuVolumeItem(
|
||||
_localMuted ? 0. : (startVolume / float(maxVolume)),
|
||||
Ui::Paint::ArcsAnimation::Direction::Right)) {
|
||||
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
enableMouseSelecting();
|
||||
enableMouseSelecting(_slider.get());
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ Subsection::Subsection(
|
||||
, _dummyAction(Ui::CreateChild<QAction>(parent)) {
|
||||
setPointerCursor(false);
|
||||
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
|
||||
_text->resizeToWidth(st::callDeviceSelectionLabel.minWidth);
|
||||
_text->moveToLeft(st.itemPadding.left(), st.itemPadding.top());
|
||||
@@ -110,7 +110,7 @@ Selector::Selector(
|
||||
, _dummyAction(Ui::CreateChild<QAction>(parent)) {
|
||||
setPointerCursor(false);
|
||||
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
|
||||
const auto padding = st.itemPadding;
|
||||
const auto group = std::make_shared<Ui::RadiobuttonGroup>();
|
||||
|
||||
@@ -105,7 +105,7 @@ ResolveBankCardAction::ResolveBankCardAction(
|
||||
, _st(st)
|
||||
, _height(st::groupCallJoinAsPhotoSize) {
|
||||
setAcceptBoth(true);
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
setStatus(Status::Loading);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ ResolvePhoneAction::ResolvePhoneAction(
|
||||
, _height(rect::m::sum::v(st::groupCallJoinAsPadding)
|
||||
+ st::groupCallJoinAsPhotoSize) {
|
||||
setAcceptBoth(true);
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
setClickedCallback([=] {
|
||||
if (const auto peer = _peer.current()) {
|
||||
controller->showPeerInfo(peer);
|
||||
|
||||
@@ -100,7 +100,7 @@ Action::Action(
|
||||
_text.setText(st::semiboldTextStyle, label);
|
||||
_icon->subscribeToUpdates([=] { update(); });
|
||||
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
resolveMinWidth();
|
||||
|
||||
paintRequest(
|
||||
|
||||
@@ -107,7 +107,7 @@ TwoTextAction::TwoTextAction(
|
||||
+ _st.itemStyle.font->height
|
||||
+ st::ttlItemTimerFont->height
|
||||
+ st::ttlItemPadding.bottom()) {
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
setClickedCallback(std::move(callback));
|
||||
|
||||
paintRequest(
|
||||
|
||||
@@ -95,7 +95,7 @@ TextItem::TextItem(
|
||||
}, lifetime());
|
||||
|
||||
_label->resizeToWidth(parent->width() - added);
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
}
|
||||
|
||||
not_null<QAction*> TextItem::action() const {
|
||||
|
||||
@@ -665,7 +665,7 @@ BotAction::BotAction(
|
||||
+ _st.itemStyle.font->height
|
||||
+ _st.itemPadding.bottom()) {
|
||||
setAcceptBoth(false);
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
setClickedCallback(std::move(callback));
|
||||
|
||||
_icon.move(_st.itemIconPosition);
|
||||
|
||||
@@ -95,7 +95,7 @@ SpeedSliderItem::SpeedSliderItem(
|
||||
+ st.dropdown.menu.itemStyle.font->height
|
||||
+ st.sliderPadding.bottom())
|
||||
, _debounceTimer([=] { _debounced.fire(current()); }) {
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
enableMouseSelecting();
|
||||
enableMouseSelecting(_slider.get());
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ RateTranscribe::RateTranscribe(
|
||||
, _dummyAction(Ui::CreateChild<QAction>(this)) {
|
||||
setAcceptBoth(true);
|
||||
|
||||
initResizeHook(popupMenu->menu()->sizeValue());
|
||||
fitToMenuWidth();
|
||||
|
||||
enableMouseSelecting();
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ TextItem::TextItem(
|
||||
(s.height() - _label->height()) / 2);
|
||||
}, lifetime());
|
||||
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
}
|
||||
|
||||
not_null<QAction*> TextItem::action() const {
|
||||
|
||||
@@ -69,7 +69,7 @@ Action::Action(
|
||||
+ st::ttlItemTimerFont->height
|
||||
+ st::ttlItemPadding.bottom()) {
|
||||
setAcceptBoth(true);
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
setClickedCallback([=] {
|
||||
if (isEnabled()) {
|
||||
callback(DownloadsAction::Open);
|
||||
|
||||
@@ -83,7 +83,7 @@ ActionWithTimer::ActionWithTimer(
|
||||
+ st::ttlItemTimerFont->height
|
||||
+ st::ttlItemPadding.bottom()) {
|
||||
setAcceptBoth(true);
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
setClickedCallback(std::move(callback));
|
||||
|
||||
paintRequest(
|
||||
|
||||
@@ -214,7 +214,7 @@ Action::Action(
|
||||
};
|
||||
|
||||
setAcceptBoth(true);
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
|
||||
std::move(
|
||||
content
|
||||
@@ -519,7 +519,7 @@ WhenAction::WhenAction(
|
||||
const auto parent = parentMenu->menu();
|
||||
|
||||
setAcceptBoth(true);
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
|
||||
std::move(
|
||||
content
|
||||
@@ -735,7 +735,7 @@ WhoReactedEntryAction::WhoReactedEntryAction(
|
||||
, _height(st::defaultWhoRead.photoSkip * 2 + st::defaultWhoRead.photoSize) {
|
||||
setAcceptBoth(true);
|
||||
|
||||
initResizeHook(parent->sizeValue());
|
||||
fitToMenuWidth();
|
||||
setData(std::move(data));
|
||||
|
||||
paintRequest(
|
||||
|
||||
+1
-1
Submodule Telegram/lib_ui updated: 81e3a112bf...6f64c263e7
Reference in New Issue
Block a user