Compare commits

...

1 Commits

Author SHA1 Message Date
Martchus 2b614983d6 WIP: Improve alignment of icons in plasmoid 2020-01-29 18:52:25 +01:00
3 changed files with 23 additions and 6 deletions

View File

@ -303,8 +303,8 @@ FontAwesomeIcons::FontAwesomeIcons(const QColor &color, const QSize &size, int m
IconManager::IconManager() IconManager::IconManager()
: m_statusIcons() : m_statusIcons()
, m_trayIcons(m_statusIcons) , m_trayIcons(m_statusIcons)
, m_fontAwesomeIconsForLightTheme(QColor(10, 10, 10), QSize(64, 64), 8) , m_fontAwesomeIconsForLightTheme(QColor(10, 10, 10), QSize(64, 64), 4)
, m_fontAwesomeIconsForDarkTheme(Qt::white, QSize(64, 64), 8) , m_fontAwesomeIconsForDarkTheme(Qt::white, QSize(64, 64), 4)
{ {
} }

View File

@ -17,23 +17,30 @@ Item {
width: parent.width width: parent.width
PlasmaCore.IconItem { PlasmaCore.IconItem {
source: detailIcon id: icon
Layout.leftMargin: units.iconSizes.small * 1.1 Layout.leftMargin: units.iconSizes.small * 1.1
Layout.preferredWidth: units.iconSizes.small
Layout.preferredHeight: units.iconSizes.small Layout.preferredHeight: units.iconSizes.small
Layout.preferredWidth: height
Layout.fillHeight: true
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
source: detailIcon
opacity: 0.8 opacity: 0.8
} }
PlasmaComponents.Label { PlasmaComponents.Label {
Layout.preferredWidth: 100 Layout.preferredWidth: 100
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
text: detailName text: detailName
font.weight: Font.DemiBold font.weight: Font.DemiBold
verticalAlignment: Qt.AlignVCenter
} }
PlasmaComponents.Label { PlasmaComponents.Label {
Layout.leftMargin: theme.defaultFont.pointSize * 0.9 Layout.leftMargin: theme.defaultFont.pointSize * 0.9
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
text: detailValue text: detailValue
elide: Text.ElideRight elide: Text.ElideRight
horizontalAlignment: Qt.AlignRight horizontalAlignment: Qt.AlignRight
verticalAlignment: Qt.AlignVCenter
} }
} }

View File

@ -18,12 +18,22 @@ Item {
PlasmaCore.IconItem { PlasmaCore.IconItem {
id: iconItem id: iconItem
Layout.preferredWidth: 16 Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.preferredHeight: 16 Layout.maximumWidth: units.iconSizes.small
Layout.maximumHeight: units.iconSizes.small
opacity: 0.7 opacity: 0.7
Rectangle {
color: "red"
anchors.top: parent.top
anchors.left: parent.left
width: parent.paintedWidth
height: parent.paintedHeight
}
} }
PlasmaComponents.Label { PlasmaComponents.Label {
id: label id: label
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
} }
} }