adaptive layout starts after 1366px window, langs updated, hiding tooltip on window deactivation

This commit is contained in:
John Preston 2016-02-22 10:01:10 +03:00
parent 90d104cf61
commit 7de5e24df5
11 changed files with 28 additions and 20 deletions

View File

@ -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;

View File

@ -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);

View File

@ -133,6 +133,7 @@ public:
public slots:
void onShow();
void onWndActiveChanged();
void onHideByLeave();
protected:

View File

@ -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) {

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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" = "유니코드 문자를 입력하세요.";

View File

@ -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";

View File

@ -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";

View File

@ -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);