diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index 7e2e3f687..b397642c3 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -602,12 +602,20 @@ void MainWindow::showRightColumn(object_ptr widget) { } const auto nowRightWidth = _rightColumn ? _rightColumn->width() : 0; const auto wasMaximized = isMaximized(); + const auto wasMinimumWidth = minimumWidth(); + const auto nowMinimumWidth = st::windowMinWidth + nowRightWidth; + const auto firstResize = (nowMinimumWidth < wasMinimumWidth); + if (firstResize) { + setMinimumWidth(nowMinimumWidth); + } if (!isMaximized()) { tryToExtendWidthBy(wasWidth + nowRightWidth - wasRightWidth - width()); } else { updateControlsGeometry(); } - setMinimumWidth(st::windowMinWidth + nowRightWidth); + if (!firstResize) { + setMinimumWidth(nowMinimumWidth); + } } int MainWindow::maximalExtendBy() const { diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor.cpp index d56a86973..af32d5724 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor.cpp @@ -809,33 +809,6 @@ void Editor::paintEvent(QPaintEvent *e) { p.drawTextLeft(st::themeEditorMargin.left(), st::themeEditorMargin.top(), width(), tr::lng_theme_editor_title(tr::now)); } -//void Editor::Start() { -// const auto path = Background()->themeAbsolutePath(); -// if (!Window::Theme::IsPaletteTestingPath(path)) { -// const auto start = [](const QString &path) { -// if (!Local::copyThemeColorsToPalette(path)) { -// writeDefaultPalette(path); -// } -// if (!Apply(path)) { -// Ui::show(Box(tr::lng_theme_editor_error(tr::now))); -// return; -// } -// KeepApplied(); -// if (auto window = App::wnd()) { -// window->showRightColumn(Box(path)); -// } -// }; -// FileDialog::GetWritePath( -// App::wnd(), -// tr::lng_theme_editor_save_palette(tr::now), -// "Palette (*.tdesktop-palette)", -// "colors.tdesktop-palette", -// start); -// } else if (auto window = App::wnd()) { -// window->showRightColumn(Box(path)); -// } -//} - void Editor::closeWithConfirmation() { if (!PaletteChanged(_inner->paletteContent(), _cloud)) { Background()->clearEditingTheme(ClearEditing::KeepChanges);