Merge branch 'master' of https://github.com/telegramdesktop/tdesktop into dev
This commit is contained in:
		
						commit
						97151e6d39
					
				
					 2 changed files with 23 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -40,6 +40,7 @@
 | 
			
		|||
#include <private/qguiapplication_p.h>
 | 
			
		||||
#include <qpa/qplatformtheme.h>
 | 
			
		||||
#include <qstylehints.h>
 | 
			
		||||
#include <QtCore/QLocale>
 | 
			
		||||
#ifndef QT_NO_ACCESSIBILITY
 | 
			
		||||
#include "qaccessible.h"
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -1880,9 +1881,16 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
	// QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards
 | 
			
		||||
    if (unknown && !isReadOnly()
 | 
			
		||||
        && event->modifiers() != Qt::ControlModifier
 | 
			
		||||
        && event->modifiers() != (Qt::ControlModifier | Qt::ShiftModifier)) {
 | 
			
		||||
	//
 | 
			
		||||
	bool skip = false;
 | 
			
		||||
	if (QGuiApplication::inputMethod()->locale().language() == QLocale::German) {
 | 
			
		||||
		if (event->modifiers() == Qt::ControlModifier
 | 
			
		||||
			|| event->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) {
 | 
			
		||||
			skip = true;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (unknown && !isReadOnly() && !skip) {
 | 
			
		||||
        QString t = event->text();
 | 
			
		||||
		if (!t.isEmpty() && (t.at(0).isPrint() || t.at(0).unicode() == 0x200C || t.at(0).unicode() == 0x200D)) {
 | 
			
		||||
            insert(t);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1341,17 +1341,21 @@ void QWidgetTextControlPrivate::keyPressEvent(QKeyEvent *e)
 | 
			
		|||
    goto accept;
 | 
			
		||||
 | 
			
		||||
process:
 | 
			
		||||
    {
 | 
			
		||||
        if (QGuiApplication::inputMethod()->locale().language() == QLocale::German)
 | 
			
		||||
    {
 | 
			
		||||
		// QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards
 | 
			
		||||
		//
 | 
			
		||||
		bool skip = false;
 | 
			
		||||
        if (QGuiApplication::inputMethod()->locale().language() == QLocale::German) {
 | 
			
		||||
            if (e->modifiers() == Qt::ControlModifier
 | 
			
		||||
                || e->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) {
 | 
			
		||||
				skip = true;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
		if (skip) {
 | 
			
		||||
			e->ignore();
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		QString text = e->text();
 | 
			
		||||
		if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t') || text.at(0).unicode() == 0x200C || text.at(0).unicode() == 0x200D)) {
 | 
			
		||||
            if (overwriteMode
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue