cleanup and fits text to buttons

This commit is contained in:
vladest 2018-03-01 11:18:18 +01:00
parent f51025061c
commit 02612e0465
2 changed files with 3 additions and 7 deletions

View file

@ -1,10 +1,5 @@
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import "../../styles-uit"
import "../../controls-uit" as HifiControls
import "../../controls"
import "../toolbars"
StackView {
id: editRoot

View file

@ -19,7 +19,6 @@ TabButton {
property alias title: control.text
property alias active: control.checkable
height: 40
font.pixelSize: height / 2
padding: 0
spacing: 0
HifiConstants { id: hifi; }
@ -32,6 +31,7 @@ TabButton {
color: "white"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
fontSizeMode: Text.HorizontalFit
property string glyphtext: ""
HiFiGlyphs {
anchors.centerIn: parent
@ -49,7 +49,8 @@ TabButton {
background: Rectangle {
color: control.checked ? "#404040" :"black"
implicitWidth: control.contentItem.width + 42
implicitWidth: control.contentItem.width + 42 > text.paintedWidth ? control.contentItem.width + 42 :
text.paintedWidth + 10
implicitHeight: 40
}
}