diff --git a/src/controls/Heading.qml b/src/controls/Heading.qml index bdb17928..0b6000c0 100644 --- a/src/controls/Heading.qml +++ b/src/controls/Heading.qml @@ -1,85 +1,85 @@ /* * Copyright 2012 by Sebastian Kügler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. */ import QtQuick 2.0 import QtQuick.Controls 2.0 as QQC2 import org.kde.kirigami 2.4 /** * A heading label used for subsections of texts. * * The characteristics of the text will be automatically set according to the * plasma Theme. Use this components for section titles or headings in your UI, * for example page or section titles. * * Example usage: * * @code * import org.kde.kirigami 2.4 as Kirigami * [...] * Column { * Kirigami.Heading { * text: "Apples in the sunlight" * level: 2 * } * [...] * } * @endcode * * The most important property is "text", which applies to the text property of * Label. See PlasmaComponents Label and primitive QML Text element API for * additional properties, methods and signals. * @inherits QtQuick.Controls.Label */ QQC2.Label { id: heading /** * level: int * The level determines how big the section header is display, values * between 1 (big) and 5 (small) are accepted */ property int level: 1 /** * step: int * adjust the point size in between a level and another. * DEPRECATED */ property int step: 0 font.pointSize: headerPointSize(level) function headerPointSize(l) { var n = Theme.defaultFont.pointSize; var s; switch (l) { case 1: - return Math.round(n * 1.80) + step; + return Math.round(n * 1.50) + step; case 2: return Math.round(n * 1.30) + step; case 3: return Math.round(n * 1.20) + step; case 4: return Math.round(n * 1.10) + step; default: return n + step; } } } diff --git a/src/controls/private/globaltoolbar/TitlesPageHeader.qml b/src/controls/private/globaltoolbar/TitlesPageHeader.qml index 0f1deb18..a64d1f03 100644 --- a/src/controls/private/globaltoolbar/TitlesPageHeader.qml +++ b/src/controls/private/globaltoolbar/TitlesPageHeader.qml @@ -1,46 +1,46 @@ /* * Copyright 2018 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.5 import QtQuick.Controls 2.0 as Controls import QtQuick.Layouts 1.2 import org.kde.kirigami 2.4 AbstractPageHeader { id: root Loader { id: titleLoader anchors { verticalCenter: parent.verticalCenter left: parent.left right: parent.right - leftMargin: Units.largeSpacing + leftMargin: Units.gridUnit } height: Math.min(root.height, item ? (item.Layout.preferredHeight > 0 ? item.Layout.preferredHeight : item.implicitHeight) : 0) sourceComponent: page ? page.titleDelegate : null } } diff --git a/src/controls/private/globaltoolbar/ToolBarPageHeader.qml b/src/controls/private/globaltoolbar/ToolBarPageHeader.qml index 538fbebc..747e3e4e 100644 --- a/src/controls/private/globaltoolbar/ToolBarPageHeader.qml +++ b/src/controls/private/globaltoolbar/ToolBarPageHeader.qml @@ -1,92 +1,92 @@ /* * Copyright 2018 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.5 import QtQuick.Controls 2.0 as Controls import QtQuick.Layouts 1.2 import org.kde.kirigami 2.5 import "../" as Private AbstractPageHeader { id: root implicitWidth: layout.implicitWidth + Units.smallSpacing * 2 Layout.preferredHeight: Math.max(titleLoader.implicitHeight, toolBar.implicitHeight) + Units.smallSpacing * 2 MouseArea { anchors.fill: parent onClicked: page.forceActiveFocus() } RowLayout { id: layout anchors.fill: parent - anchors.leftMargin: Units.largeSpacing + anchors.leftMargin: Units.gridUnit anchors.rightMargin: Units.smallSpacing spacing: Units.smallSpacing Loader { id: titleLoader Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter Layout.fillWidth: item ? item.Layout.fillWidth : undefined Layout.minimumWidth: item ? item.Layout.minimumWidth : undefined Layout.preferredWidth: item ? item.Layout.preferredWidth : undefined Layout.maximumWidth: item ? item.Layout.maximumWidth : undefined sourceComponent: page ? page.titleDelegate : null } ActionToolBar { id: toolBar Layout.alignment: Qt.AlignVCenter Layout.fillWidth: true visible: actions.length > 0 alignment: pageRow.globalToolBar.toolbarActionAlignment actions: { var result = [] if (page) { if (page.actions.main) { page.actions.main.displayHint |= Action.DisplayHint.KeepVisible result.push(page.actions.main) } if (page.actions.left) { page.actions.left.displayHint |= Action.DisplayHint.KeepVisible result.push(page.actions.left) } if (page.actions.right) { page.actions.right.displayHint |= Action.DisplayHint.KeepVisible result.push(page.actions.right) } if (page.actions.contextualActions.length > 0) { result = result.concat(Array.prototype.map.call(page.actions.contextualActions, function(item) { return item })) } } return result } } } }