diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 5999c47f4..9ee657664 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -53,6 +53,7 @@ color8: #ce671b; // orange wndMinWidth: 380px; adaptiveNormalWidth: 640px; +adaptiveWideWidth: 1366px; wndMinHeight: 480px; wndDefWidth: 800px; @@ -1016,8 +1017,6 @@ historyToEndSkip: 10px; activeFadeInDuration: 500; activeFadeOutDuration: 3000; -historyMaxWidth: 720px; - msgRadius: 3px; msgMaxWidth: 430px; diff --git a/Telegram/SourceFiles/gui/popupmenu.cpp b/Telegram/SourceFiles/gui/popupmenu.cpp index 8fb99d7d5..cad98ebe0 100644 --- a/Telegram/SourceFiles/gui/popupmenu.cpp +++ b/Telegram/SourceFiles/gui/popupmenu.cpp @@ -539,6 +539,8 @@ PopupTooltip::PopupTooltip() : TWidget(0) _showTimer.setSingleShot(true); connect(&_showTimer, SIGNAL(timeout()), this, SLOT(onShow())); + + connect(App::wnd()->windowHandle(), SIGNAL(activeChanged()), this, SLOT(onWndActiveChanged())); } void PopupTooltip::onShow() { @@ -552,6 +554,12 @@ void PopupTooltip::onShow() { } } +void PopupTooltip::onWndActiveChanged() { + if (!App::wnd()->windowHandle()->isActive()) { + PopupTooltip::Hide(); + } +} + bool PopupTooltip::eventFilter(QObject *o, QEvent *e) { if (e->type() == QEvent::Leave) { _hideByLeaveTimer.start(10); diff --git a/Telegram/SourceFiles/gui/popupmenu.h b/Telegram/SourceFiles/gui/popupmenu.h index caf65492d..4d7968bfc 100644 --- a/Telegram/SourceFiles/gui/popupmenu.h +++ b/Telegram/SourceFiles/gui/popupmenu.h @@ -133,6 +133,7 @@ public: public slots: void onShow(); + void onWndActiveChanged(); void onHideByLeave(); protected: diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index e64facc5b..574164736 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -6197,16 +6197,12 @@ void HistoryMessage::initDimensions() { } void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { - int32 maxwidth = qMin(int(st::msgMaxWidth), _maxw), hwidth = _history->width, hmaxwidth = st::historyMaxWidth; + int32 maxwidth = qMin(int(st::msgMaxWidth), _maxw), hwidth = _history->width; if (_media && _media->currentWidth() < maxwidth) { maxwidth = qMax(_media->currentWidth(), qMin(maxwidth, plainMaxWidth())); } - left = 0; - if (Adaptive::Wide()) { - hwidth = hmaxwidth; - } - left += (!fromChannel() && out() && !Adaptive::Wide()) ? st::msgMargin.right() : st::msgMargin.left(); + left = (!fromChannel() && out() && !Adaptive::Wide()) ? st::msgMargin.right() : st::msgMargin.left(); if (displayFromPhoto()) { left += st::msgPhotoSkip; // } else if (!Adaptive::Wide() && !out() && !fromChannel() && st::msgPhotoSkip - (hmaxwidth - hwidth) > 0) { diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index f9ea8f55e..145671347 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "Aus der Galerie"; "lng_settings_bg_from_file" = "Durchsuchen"; "lng_settings_bg_tile" = "Nebeneinander"; +"lng_settings_adaptive_wide" = "Flexibles Layout für breite Bildschirme"; "lng_backgrounds_header" = "Neuen Chat-Hintergrund wählen"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop wurde aktualisiert auf Version {version}\n\n{changes}\n\nGesamter Versionsverlauf:\n{link}"; "lng_new_version_minor" = "— Fehlerbehebungen und Softwareoptimierungen"; -"lng_new_version_text" = "— Neue Optik für Sprachnachrichten\n— Sticker werden nach Emoji-Eingabe vorgeschlagen"; +"lng_new_version_text" = "— Neue Option in den Einstellungen hinzugefügt (\"Flexibles Layout für breite Bildschirme\"), um das Layout bei besonders breiten Bildschirmen zu ändern\n— Abstürze in der Linux-Version behoben"; "lng_menu_insert_unicode" = "Unicode-Steuerzeichen einfügen"; diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index 2c0e037f9..4370b950b 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "Elegir desde la galería"; "lng_settings_bg_from_file" = "Elegir desde archivos"; "lng_settings_bg_tile" = "Fondo con mosaico"; +"lng_settings_adaptive_wide" = "Diseño adaptable para pantallas anchas"; "lng_backgrounds_header" = "Elige tu nuevo fondo de chat"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop ha sido actualizada a la versión {version}\n\n{changes}\n\nEl historial completo está disponible aquí:\n{link}"; "lng_new_version_minor" = "— Corrección de errores y otras mejoras menores"; -"lng_new_version_text" = "– Nueva visualización de ondas para los mensajes de voz\n– Sugerencias de stickers cuando escribes un emoji"; +"lng_new_version_text" = "— Ajuste para activar o desactivar el diseño adaptable para pantallas anchas \n— Arreglado el cierre inesperado en la versión para Linux"; "lng_menu_insert_unicode" = "Insertar caracteres de control Unicode"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index fac88aef7..9babab03f 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "Scegli dalla galleria"; "lng_settings_bg_from_file" = "Scegli da file"; "lng_settings_bg_tile" = "Affianca sfondo"; +"lng_settings_adaptive_wide" = "Layout adattivo per grandi schermi"; "lng_backgrounds_header" = "Scegli un nuovo sfondo per la chat"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop si è aggiornato alla versione {version}\n\n{changes}\n\nLa cronologia degli aggiornamenti è disponibile qui:\n{link}"; "lng_new_version_minor" = "— Risoluzione di problemi e altri miglioramenti minori"; -"lng_new_version_text" = "— Nuova visualizzazione delle onde sonore per i messaggi vocali\n— Suggerimento per gli sticker quando digiti un'emoji"; +"lng_new_version_text" = "— Interruttore per il layout adattivo per grandi schermi aggiunto nelle Impostazioni\n— Risoluzione dei crash su Linux"; "lng_menu_insert_unicode" = "Inserisci carattere di controllo Unicode"; diff --git a/Telegram/SourceFiles/langs/lang_ko.strings b/Telegram/SourceFiles/langs/lang_ko.strings index 1d401e7e3..416441353 100644 --- a/Telegram/SourceFiles/langs/lang_ko.strings +++ b/Telegram/SourceFiles/langs/lang_ko.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "이미지 선택"; "lng_settings_bg_from_file" = "파일 선택"; "lng_settings_bg_tile" = "타일형 배경화면"; +"lng_settings_adaptive_wide" = "와이드 스크린 레이아웃 적용"; "lng_backgrounds_header" = "새로운 대화창 배경화면을 선택"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "텔레그램 데스크탑은 {version} 버전으로 업데이트 되었습니다.\n\n{changes}\n\n전체 버전 히스토리는 아래에서 확인 가능합니다:\n{link}"; "lng_new_version_minor" = "— 버그 수정 및 일부 기능 향상"; -"lng_new_version_text" = "— 음성 메시지에 웨이브 시각 효과 추가\n— 이모티콘 입력시 스티커 추천"; +"lng_new_version_text" = "— 와이드 스크린 레이아웃 설정 적용\n— 리눅스 버전 크래시 수정"; "lng_menu_insert_unicode" = "유니코드 문자를 입력하세요."; diff --git a/Telegram/SourceFiles/langs/lang_nl.strings b/Telegram/SourceFiles/langs/lang_nl.strings index 6f6d5dca0..5d5e5d0cf 100644 --- a/Telegram/SourceFiles/langs/lang_nl.strings +++ b/Telegram/SourceFiles/langs/lang_nl.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "Uit galerij kiezen"; "lng_settings_bg_from_file" = "Bestand kiezen"; "lng_settings_bg_tile" = "Naast elkaar"; +"lng_settings_adaptive_wide" = "Adaptieve layout voor brede schermen"; "lng_backgrounds_header" = "Kies je nieuwe achtergrond"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram is bijgewerkt naar versie {version}\n\n{changes} \n\nVolledige versiegeschiedenis is hier te vinden:\n{link}"; "lng_new_version_minor" = "— Probleemoplossing en andere kleine verbeteringen"; -"lng_new_version_text" = "— Nieuwe visualisatie voor spraakberichten\n— Stickersuggesties als een emoji typt"; +"lng_new_version_text" = "— Adaptieve layout voor brede schermen toegevoegd aan instellingen\n— Crashes in de Linuxversie opgelost"; "lng_menu_insert_unicode" = "Unicode-besturingsteken invoegen"; diff --git a/Telegram/SourceFiles/langs/lang_pt_BR.strings b/Telegram/SourceFiles/langs/lang_pt_BR.strings index bc77b4a31..fb36ee618 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "Escolher da galeria"; "lng_settings_bg_from_file" = "Escolher dos arquivos"; "lng_settings_bg_tile" = "Lado-a-lado"; +"lng_settings_adaptive_wide" = "Layout adaptativo para wide screens"; "lng_backgrounds_header" = "Escolha o seu novo papel de parede"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop foi atualizado para a versão {version}\n\n{changes}\n\nHistórico completo de mudanças disponível aqui:\n{link}"; "lng_new_version_minor" = "— Resolução de bugs e outras melhorias menores"; -"lng_new_version_text" = "— Nova visualização em ondas para mensagens de voz\n— Sugestões de sticker quando você inicia com emoji"; +"lng_new_version_text" = "— Layout adaptativo para wide screens adicionado em Configurações\n— Resolvido crash nas versões Linux"; "lng_menu_insert_unicode" = "Inserir caractere de controle Unicode"; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 1209ffc3e..0f10218b3 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1229,12 +1229,10 @@ void Window::resizeEvent(QResizeEvent *e) { if (!title) return; Adaptive::Layout layout = Adaptive::OneColumnLayout; - if (width() >= st::adaptiveNormalWidth) { - if (width() - chatsListWidth(width()) >= st::historyMaxWidth) { - layout = Adaptive::WideLayout; - } else { - layout = Adaptive::NormalLayout; - } + if (width() > st::adaptiveWideWidth) { + layout = Adaptive::WideLayout; + } else if (width() >= st::adaptiveNormalWidth) { + layout = Adaptive::NormalLayout; } if (layout != Global::AdaptiveLayout()) { Global::SetAdaptiveLayout(layout);