[kcmkwin] Use QtQuick.Controls 2.0 for Label and TextField

Summary:
Using QtQuick.Controls for Label and TextField can result in blurry font rendering for a fractional scaling (e.g. 1,5). There is a work around for QtQuick.Controls 2.x therefore using QtQuick.Controls 2.0 for Label and TextField resolves the problem

BUG: 366451

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: ngraham, zzag, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14495
This commit is contained in:
Bo Simonsen 2018-08-15 10:45:22 +03:00 committed by Vlad Zagorodniy
parent 39ddc54c0a
commit 22d898399b
3 changed files with 16 additions and 13 deletions

View file

@ -21,6 +21,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.1 import QtQuick.Controls 1.1
import QtQuick.Controls 2.0 as QQC2
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
import org.kde.kwin.kwincompositing 1.0 import org.kde.kwin.kwincompositing 1.0
@ -101,22 +102,22 @@ Rectangle {
id: effectItem id: effectItem
property int maximumWidth: parent.maximumWidth - checkBoxLayout.width - (videoButton.width + configureButton.width + aboutButton.width) - parent.spacing * 5 property int maximumWidth: parent.maximumWidth - checkBoxLayout.width - (videoButton.width + configureButton.width + aboutButton.width) - parent.spacing * 5
Layout.maximumWidth: maximumWidth Layout.maximumWidth: maximumWidth
Label { QQC2.Label {
text: model.NameRole text: model.NameRole
font.bold: true font.weight: Font.Bold
wrapMode: Text.Wrap wrapMode: Text.Wrap
Layout.maximumWidth: parent.maximumWidth Layout.maximumWidth: parent.maximumWidth
} }
Label { QQC2.Label {
id: desc id: desc
text: model.DescriptionRole text: model.DescriptionRole
wrapMode: Text.Wrap wrapMode: Text.Wrap
Layout.maximumWidth: parent.maximumWidth Layout.maximumWidth: parent.maximumWidth
} }
Label { QQC2.Label {
id:aboutItem id:aboutItem
text: i18n("Author: %1\nLicense: %2", model.AuthorNameRole, model.LicenseRole) text: i18n("Author: %1\nLicense: %2", model.AuthorNameRole, model.LicenseRole)
font.bold: true font.weight: Font.Bold
visible: false visible: false
wrapMode: Text.Wrap wrapMode: Text.Wrap
Layout.maximumWidth: parent.maximumWidth Layout.maximumWidth: parent.maximumWidth

View file

@ -20,6 +20,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls 2.0 as QQC2
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
import org.kde.kwin.kwincompositing 1.0 import org.kde.kwin.kwincompositing 1.0
@ -35,12 +36,12 @@ Rectangle {
implicitHeight: sectionText.implicitHeight + 2 * col.spacing implicitHeight: sectionText.implicitHeight + 2 * col.spacing
color: searchModel.backgroundNormalColor color: searchModel.backgroundNormalColor
Label { QQC2.Label {
id: sectionText id: sectionText
x: col.spacing x: col.spacing
y: col.spacing y: col.spacing
text: section text: section
font.bold: true font.weight: Font.Bold
color: searchModel.sectionColor color: searchModel.sectionColor
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
@ -58,7 +59,7 @@ Rectangle {
id: col id: col
anchors.fill: parent anchors.fill: parent
Label { QQC2.Label {
id: hint id: hint
text: i18n("Hint: To find out or configure how to activate an effect, look at the effect's settings.") text: i18n("Hint: To find out or configure how to activate an effect, look at the effect's settings.")
anchors { anchors {
@ -68,7 +69,7 @@ Rectangle {
} }
RowLayout { RowLayout {
TextField { QQC2.TextField {
// TODO: needs clear button, missing in Qt // TODO: needs clear button, missing in Qt
id: searchField id: searchField
placeholderText: i18n("Search") placeholderText: i18n("Search")

View file

@ -19,6 +19,7 @@
*/ */
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Controls 2.0 as QQC2
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import org.kde.kwin.private.kdecoration 1.0 as KDecoration import org.kde.kwin.private.kdecoration 1.0 as KDecoration
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons; import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons;
@ -70,7 +71,7 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
anchors.centerIn: parent anchors.centerIn: parent
height: titlebar.implicitHeight height: titlebar.implicitHeight
Label { QQC2.Label {
id: titlebar id: titlebar
anchors.centerIn: parent anchors.centerIn: parent
font: titleFont font: titleFont
@ -165,7 +166,7 @@ Item {
Drag.keys: [ "decoButtonAdd" ] Drag.keys: [ "decoButtonAdd" ]
Drag.active: dragArea.drag.active Drag.active: dragArea.drag.active
} }
Label { QQC2.Label {
id: iconLabel id: iconLabel
text: model["display"] text: model["display"]
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
@ -212,9 +213,9 @@ Item {
ColumnLayout { ColumnLayout {
anchors.centerIn: parent anchors.centerIn: parent
visible: leftButtonsView.dragging || rightButtonsView.dragging visible: leftButtonsView.dragging || rightButtonsView.dragging
Label { QQC2.Label {
text: i18n("Drop here to remove button") text: i18n("Drop here to remove button")
font.bold: true font.weight: Font.Bold
} }
KQuickControlsAddons.QIconItem { KQuickControlsAddons.QIconItem {
id: icon id: icon