Commit 987f5fe9 authored by Nate Graham's avatar Nate Graham 🔩

[Calculator] Make buttons' text labels scale in size along with the widget

Summary:
The Calculator widget's button labels were not scaling in size as the widget got bigger,
leading to situations where the labels were tiny when the widget was very large.

This patch addresses that situation by scaling the labels size along with the widget.

For best results, also apply D21502.

Test Plan: {F6860484, size=full}

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D21503
parent 064df9b0
......@@ -23,14 +23,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
*****************************************************************************/
import QtQuick 2.2
import QtQuick.Layouts 1.1
import QtQuick 2.5
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.5 as QQC2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0 as QtExtra
import org.kde.plasma.plasmoid 2.0
Item {
QQC2.Control {
id: main;
Plasmoid.switchWidth: Layout.minimumWidth
......@@ -41,6 +42,10 @@ Item {
width: units.gridSize * 3
height: units.gridSize * 4
// Make the buttons' text labels scale with the widget's size
// This is propagated down to all child controls with text
font.pixelSize: Math.round(width/12)
property real result: 0;
property bool hasResult: false;
property bool showingInput: true;
......
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