Commit a871333d authored by ivan tkachenko's avatar ivan tkachenko Committed by Nate Graham
Browse files

Heading: Deprecate headerPointSize(int level) method

It is an implementation detail, and was never meant to be a public API.
While there are no traces of its usage (outside of the Heading
component itself) in the whole KDE infrastructure, we still can not
remove it until the next major version, as it would technically be a
breaking change for 3rd-party libraries.
parent 7c1da03e
Pipeline #104385 passed with stage
in 2 minutes and 9 seconds
......@@ -67,7 +67,7 @@ Label {
*/
property int type: Heading.Type.Normal
font.pointSize: headerPointSize(level)
font.pointSize: __headerPointSize(level)
font.weight: type === Heading.Type.Primary ? Font.DemiBold : Font.Normal
wrapMode: Text.WordWrap
......@@ -75,10 +75,25 @@ Label {
Accessible.role: Accessible.Heading
// TODO KF6: Remove this public method
function headerPointSize(l) {
var n = PlasmaCore.Theme.defaultFont.pointSize;
var s;
switch (l) {
console.warn("org.kde.plasma.extras/Heading::headerPointSize() is deprecated. Use font.pointSize directly instead");
return __headerPointSize(l);
}
//
// W A R N I N G
// -------------
//
// This method is not part of the PlasmaExtras API. It exists purely as an
// implementation detail. It may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
function __headerPointSize(level) {
const n = PlasmaCore.Theme.defaultFont.pointSize;
switch (level) {
case 1:
return n * 1.35 + step;
case 2:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment