summaryrefslogtreecommitdiff
blob: 38c89728b52ec63fe70665dca6a64fcc6e50462c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
From dc901a1f0b5f6621bfa1c23e33dcfdf6246e7cb1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kre=C5=A1imir=20=C4=8Cohar?= <kcohar@gmail.com>
Date: Thu, 10 Jan 2019 09:19:33 -0700
Subject: [KWidgetsAddons] Do not use light font styles for headings (3/3)

Summary:
This patch brings back regular font styles for headings to KTitleWidget for the sake of consistency with QML and Kirigami, where they were also reintroduced in favor of better legibility.

CCBUG: 402730

FIXED-IN: 5.54

Test Plan:
Before:
{F6520054}
After:
{F6520058}

Reviewers: ngraham, #frameworks, #vdg, #plasma

Reviewed By: ngraham, #vdg

Subscribers: cfeck, filipf, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D17907
---
 src/ktitlewidget.cpp | 29 -----------------------------
 1 file changed, 29 deletions(-)

diff --git a/src/ktitlewidget.cpp b/src/ktitlewidget.cpp
index 7a34bc2..d8b0517 100644
--- a/src/ktitlewidget.cpp
+++ b/src/ktitlewidget.cpp
@@ -213,16 +213,6 @@ void KTitleWidget::changeEvent(QEvent *e)
     if (e->type() == QEvent::PaletteChange || e->type() == QEvent::FontChange
                                            || e->type() == QEvent::ApplicationFontChange) {
         d->textLabel->setStyleSheet(d->textStyleSheet());
-        //Qt stylesheet doesn't support lighter font-weight
-        QFont font(d->textLabel->font());
-        if (d->level <= 4) {
-            font.setWeight(QFont::Light);
-            font.setStyleName(QStringLiteral("Light"));
-        } else {
-            font.setWeight(QFont::Normal);
-            font.setStyleName(QStringLiteral("Regular"));
-        }
-        d->textLabel->setFont(font);
         d->commentLabel->setStyleSheet(d->commentStyleSheet());
     }
 }
@@ -233,16 +223,6 @@ void KTitleWidget::setText(const QString &text, Qt::Alignment alignment)
 
     if (!Qt::mightBeRichText(text)) {
         d->textLabel->setStyleSheet(d->textStyleSheet());
-        //Qt stylesheet doesn't support lighter font-weight
-        QFont font(d->textLabel->font());
-        if (d->level <= 4) {
-            font.setWeight(QFont::Light);
-            font.setStyleName(QStringLiteral("Light"));
-        } else {
-            font.setWeight(QFont::Normal);
-            font.setStyleName(QStringLiteral("Regular"));
-        }
-        d->textLabel->setFont(font);
     }
 
     d->textLabel->setText(text);
@@ -259,15 +239,6 @@ void KTitleWidget::setLevel(int level)
     d->level = level;
 
     d->textLabel->setStyleSheet(d->textStyleSheet());
-    //Qt stylesheet doesn't support lighter font-weight
-    QFont font(d->textLabel->font());
-    if (d->level <= 4) {
-        font.setWeight(QFont::Light);
-        font.setStyleName(QStringLiteral("Light"));
-    } else {
-        font.setWeight(QFont::Normal);
-        font.setStyleName(QStringLiteral("Regular"));
-    }
 }
 
 int KTitleWidget::level()
-- 
cgit v1.1