mirror of https://github.com/procxx/kepka.git
parent
c9c0d74b68
commit
423254f7eb
|
@ -602,12 +602,20 @@ void MainWindow::showRightColumn(object_ptr<TWidget> widget) {
|
||||||
}
|
}
|
||||||
const auto nowRightWidth = _rightColumn ? _rightColumn->width() : 0;
|
const auto nowRightWidth = _rightColumn ? _rightColumn->width() : 0;
|
||||||
const auto wasMaximized = isMaximized();
|
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()) {
|
if (!isMaximized()) {
|
||||||
tryToExtendWidthBy(wasWidth + nowRightWidth - wasRightWidth - width());
|
tryToExtendWidthBy(wasWidth + nowRightWidth - wasRightWidth - width());
|
||||||
} else {
|
} else {
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
}
|
}
|
||||||
setMinimumWidth(st::windowMinWidth + nowRightWidth);
|
if (!firstResize) {
|
||||||
|
setMinimumWidth(nowMinimumWidth);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int MainWindow::maximalExtendBy() const {
|
int MainWindow::maximalExtendBy() const {
|
||||||
|
|
|
@ -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));
|
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<InformBox>(tr::lng_theme_editor_error(tr::now)));
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// KeepApplied();
|
|
||||||
// if (auto window = App::wnd()) {
|
|
||||||
// window->showRightColumn(Box<Editor>(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<Editor>(path));
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
void Editor::closeWithConfirmation() {
|
void Editor::closeWithConfirmation() {
|
||||||
if (!PaletteChanged(_inner->paletteContent(), _cloud)) {
|
if (!PaletteChanged(_inner->paletteContent(), _cloud)) {
|
||||||
Background()->clearEditingTheme(ClearEditing::KeepChanges);
|
Background()->clearEditingTheme(ClearEditing::KeepChanges);
|
||||||
|
|
Loading…
Reference in New Issue