NPillVertical: match NHorizontal on margins and color
This commit is contained in:
parent
5df218a789
commit
65933208ec
2 changed files with 3 additions and 30 deletions
|
|
@ -45,8 +45,7 @@ Item {
|
||||||
// Sizing logic for vertical bars
|
// Sizing logic for vertical bars
|
||||||
readonly property int iconSize: Math.round(Style.baseWidgetSize * sizeRatio * scaling)
|
readonly property int iconSize: Math.round(Style.baseWidgetSize * sizeRatio * scaling)
|
||||||
readonly property int pillHeight: iconSize
|
readonly property int pillHeight: iconSize
|
||||||
readonly property int pillPaddingHorizontal: Style.marginS * scaling
|
readonly property int pillPaddingVertical: 3 * 2 * scaling // Very precise adjustment don't replace by Style.margin
|
||||||
readonly property int pillPaddingVertical: Style.marginS * scaling
|
|
||||||
readonly property int pillOverlap: iconSize * 0.5
|
readonly property int pillOverlap: iconSize * 0.5
|
||||||
readonly property int maxPillWidth: iconSize
|
readonly property int maxPillWidth: iconSize
|
||||||
readonly property int maxPillHeight: Math.max(1, textItem.implicitHeight + pillPaddingVertical * 4)
|
readonly property int maxPillHeight: Math.max(1, textItem.implicitHeight + pillPaddingVertical * 4)
|
||||||
|
|
@ -83,7 +82,7 @@ Item {
|
||||||
var offset = openDownward ? pillPaddingVertical * 0.75 : -pillPaddingVertical * 0.75
|
var offset = openDownward ? pillPaddingVertical * 0.75 : -pillPaddingVertical * 0.75
|
||||||
if (forceOpen) {
|
if (forceOpen) {
|
||||||
// If its force open, the icon disc background is the same color as the bg pill move text slightly
|
// If its force open, the icon disc background is the same color as the bg pill move text slightly
|
||||||
offset += rightOpen ? -Style.marginXXS * scaling : Style.marginXS * scaling
|
offset += rightOpen ? -Style.marginXXS * scaling : Style.marginXXS * scaling
|
||||||
}
|
}
|
||||||
return offset
|
return offset
|
||||||
}
|
}
|
||||||
|
|
@ -93,7 +92,7 @@ Item {
|
||||||
font.weight: Style.fontWeightMedium
|
font.weight: Style.fontWeightMedium
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
color: Color.mPrimary
|
color: forceOpen ? Color.mOnSurface : Color.mPrimary
|
||||||
visible: revealed
|
visible: revealed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import qs.Commons
|
|
||||||
import qs.Services
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property string text: ""
|
|
||||||
property real fontSize: Style.fontSizeXS
|
|
||||||
property color color: Color.mOnSurface
|
|
||||||
property int fontWeight: Style.fontWeightBold
|
|
||||||
|
|
||||||
spacing: -2 * scaling
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: root.text.split("")
|
|
||||||
NText {
|
|
||||||
text: modelData
|
|
||||||
font.family: Settings.data.ui.fontFixed
|
|
||||||
font.pointSize: root.fontSize
|
|
||||||
font.weight: root.fontWeight
|
|
||||||
color: root.color
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue