Skip to content

Commit 74b5302

Browse files
committed
Fix color picker in userpic builder again.
1 parent 4052c3d commit 74b5302

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Telegram/SourceFiles/info/userpic/info_userpic_colors_editor.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,12 @@ object_ptr<Ui::RpWidget> CreateGradientEditor(
270270
Ui::AddDivider(container);
271271
Ui::AddSkip(container);
272272

273-
const auto editor = container->add(object_ptr<ColorEditor>(
273+
auto ownedEditor = object_ptr<ColorEditor>(
274274
container,
275275
ColorEditor::Mode::HSL,
276-
state->colors.back()));
276+
state->colors.back());
277+
container->resizeToWidth(ownedEditor->width());
278+
const auto editor = container->add(std::move(ownedEditor));
277279

278280
buttonsContainer->chosenChanges(
279281
) | rpl::start_with_next([=](ColorsLine::Chosen *chosen) {
@@ -305,7 +307,6 @@ object_ptr<Ui::RpWidget> CreateGradientEditor(
305307
save();
306308
}, container->lifetime());
307309

308-
container->resizeToWidth(editor->width());
309310
buttonsContainer->init();
310311

311312
return container;

0 commit comments

Comments
 (0)