NIcon new widget to simplify icons display

This commit is contained in:
quadbyte 2025-08-17 16:04:23 -04:00
parent 9bb9e7e015
commit ac8b4793d8
21 changed files with 64 additions and 127 deletions

View file

@ -75,10 +75,9 @@ Row {
spacing: Style.marginTiny * scaling
// Window icon
NText {
NIcon {
id: windowIcon
text: "dialogs"
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeLarge * scaling
verticalAlignment: Text.AlignVCenter
anchors.verticalCenter: parent.verticalCenter

View file

@ -121,9 +121,8 @@ NLoader {
Layout.fillWidth: true
spacing: Style.marginMedium * scaling
NText {
NIcon {
text: "bluetooth"
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeXL * scaling
color: Color.mPrimary
}
@ -230,9 +229,8 @@ NLoader {
spacing: Style.marginSmall * scaling
// One device BT icon
NText {
NIcon {
text: BluetoothService.getDeviceIcon(modelData)
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeXL * scaling
color: {
if (availableDeviceArea.containsMouse)
@ -305,9 +303,8 @@ NLoader {
}
}
NText {
NIcon {
text: BluetoothService.getSignalIcon(modelData)
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeSmall * scaling
color: {
if (availableDeviceArea.containsMouse)
@ -430,9 +427,8 @@ NLoader {
anchors.horizontalCenter: parent.horizontalCenter
spacing: Style.marginMedium * scaling
NText {
NIcon {
text: "sync"
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeXLL * 1.5 * scaling
color: Color.mPrimary
anchors.verticalCenter: parent.verticalCenter

View file

@ -44,10 +44,9 @@ Row {
spacing: Style.marginTiny * scaling
// Window icon
NText {
NIcon {
id: windowIcon
text: MediaService.isPlaying ? "pause" : "play_arrow"
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeLarge * scaling
verticalAlignment: Text.AlignVCenter
anchors.verticalCenter: parent.verticalCenter

View file

@ -17,12 +17,9 @@ Row {
id: cpuUsageLayout
spacing: Style.marginTiny * scaling
NText {
NIcon {
id: cpuUsageIcon
text: "speed"
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeLarge * scaling
verticalAlignment: Text.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
}
@ -42,12 +39,8 @@ Row {
id: cpuTempLayout
spacing: Style.marginTiny * scaling
NText {
NIcon {
text: "thermometer"
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeLarge * scaling
verticalAlignment: Text.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
}
@ -66,11 +59,8 @@ Row {
id: memoryUsageLayout
spacing: Style.marginTiny * scaling
NText {
NIcon {
text: "memory"
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeLarge * scaling
verticalAlignment: Text.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
}

View file

@ -126,7 +126,8 @@ PopupWindow {
id: text
Layout.fillWidth: true
color: (modelData?.enabled
?? true) ? (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface) : Color.applyOpacity(Color.mOnSurface, 64)
?? true) ? (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface) : Color.applyOpacity(
Color.mOnSurface, 64)
text: modelData?.text ?? ""
font.pointSize: Style.fontSizeSmall * scaling
verticalAlignment: Text.AlignVCenter
@ -142,9 +143,8 @@ PopupWindow {
}
// Chevron right for optional submenu
Text {
NIcon {
text: modelData?.hasChildren ? "menu" : ""
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeSmall * scaling
verticalAlignment: Text.AlignVCenter
visible: modelData?.hasChildren ?? false
@ -377,9 +377,8 @@ PopupWindow {
}
// TBC a Square UTF-8?
NText {
NIcon {
text: modelData?.hasChildren ? "\uE5CC" : ""
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeSmall * scaling
verticalAlignment: Text.AlignVCenter
visible: modelData?.hasChildren ?? false

View file

@ -130,9 +130,8 @@ NLoader {
Layout.fillWidth: true
spacing: Style.marginMedium * scaling
NText {
NIcon {
text: "wifi"
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeXL * scaling
color: Color.mPrimary
}
@ -198,9 +197,8 @@ NLoader {
visible: !Settings.data.network.wifiEnabled
spacing: Style.marginMedium * scaling
NText {
NIcon {
text: "wifi_off"
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeXXL * scaling
color: Color.mOnSurfaceVariant
Layout.alignment: Qt.AlignHCenter
@ -250,9 +248,8 @@ NLoader {
anchors.margins: Style.marginSmall * scaling
spacing: Style.marginSmall * scaling
NText {
NIcon {
text: NetworkService.signalIcon(modelData.signal)
font.family: "Material Symbols Outlined"
font.pointSize: Style.fontSizeXL * scaling
color: modelData.connected ? Color.mSurface : (networkMouseArea.containsMouse ? Color.mSurface : Color.mOnSurface)
}