mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Dont scale NIconButton in the bar
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
"description": "Enable or disable tooltips throughout the interface."
|
||||
},
|
||||
"scaling": {
|
||||
"label": "Interface Scaling",
|
||||
"label": "Interface scaling",
|
||||
"description": "Changes the size of the general user interface, excluding the bar.",
|
||||
"reset-scaling": "Reset interface scaling"
|
||||
},
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
},
|
||||
"scaling": {
|
||||
"description": "Altera o tamanho da interface geral do usuário, excluindo a barra.",
|
||||
"label": "Escalonamento da Interface",
|
||||
"label": "Escalonamento da interface",
|
||||
"reset-scaling": "Redefinir escala da interface"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -132,6 +132,7 @@ Item {
|
||||
NIcon {
|
||||
icon: root.icon
|
||||
pointSize: iconSize
|
||||
applyUiScale: false
|
||||
color: hovered ? Color.mOnTertiary : Color.mOnSurface
|
||||
// Center horizontally
|
||||
x: (iconCircle.width - width) / 2
|
||||
|
||||
@@ -155,6 +155,7 @@ Item {
|
||||
NIcon {
|
||||
icon: root.icon
|
||||
pointSize: iconSize
|
||||
applyUiScale: false
|
||||
color: hovered ? Color.mOnTertiary : Color.mOnSurface
|
||||
// Center horizontally
|
||||
x: (iconCircle.width - width) / 2
|
||||
|
||||
@@ -165,6 +165,7 @@ PopupWindow {
|
||||
NIcon {
|
||||
icon: modelData?.hasChildren ? "menu" : ""
|
||||
pointSize: Style.fontSizeS
|
||||
applyUiScale: false
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
visible: modelData?.hasChildren ?? false
|
||||
color: (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface)
|
||||
|
||||
@@ -13,6 +13,7 @@ NIconButton {
|
||||
property ShellScreen screen
|
||||
|
||||
baseSize: Style.capsuleHeight
|
||||
applyUiScale: false
|
||||
compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini")
|
||||
colorBg: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent
|
||||
colorFg: Color.mOnSurface
|
||||
|
||||
@@ -37,6 +37,7 @@ NIconButton {
|
||||
tooltipText: I18n.tr("tooltips.open-control-center")
|
||||
tooltipDirection: BarService.getTooltipDirection()
|
||||
baseSize: Style.capsuleHeight
|
||||
applyUiScale: false
|
||||
compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini")
|
||||
colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent)
|
||||
colorFg: Color.mOnSurface
|
||||
|
||||
@@ -13,6 +13,7 @@ NIconButton {
|
||||
tooltipDirection: BarService.getTooltipDirection()
|
||||
compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini")
|
||||
baseSize: Style.capsuleHeight
|
||||
applyUiScale: false
|
||||
colorBg: Settings.data.colorSchemes.darkMode ? (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) : Color.mPrimary
|
||||
colorFg: Settings.data.colorSchemes.darkMode ? Color.mOnSurface : Color.mOnPrimary
|
||||
colorBorder: Color.transparent
|
||||
|
||||
@@ -11,6 +11,7 @@ NIconButton {
|
||||
property ShellScreen screen
|
||||
|
||||
baseSize: Style.capsuleHeight
|
||||
applyUiScale: false
|
||||
compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini")
|
||||
icon: IdleInhibitorService.isInhibited ? "keep-awake-on" : "keep-awake-off"
|
||||
tooltipText: IdleInhibitorService.isInhibited ? I18n.tr("tooltips.disable-keep-awake") : I18n.tr("tooltips.enable-keep-awake")
|
||||
|
||||
@@ -15,6 +15,7 @@ NIconButton {
|
||||
|
||||
compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini")
|
||||
baseSize: Style.capsuleHeight
|
||||
applyUiScale: false
|
||||
colorBg: Settings.data.nightLight.forced ? Color.mPrimary : (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent)
|
||||
colorFg: Settings.data.nightLight.forced ? Color.mOnPrimary : Color.mOnSurface
|
||||
colorBorder: Color.transparent
|
||||
|
||||
@@ -49,6 +49,7 @@ NIconButton {
|
||||
}
|
||||
|
||||
baseSize: Style.capsuleHeight
|
||||
applyUiScale: false
|
||||
compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini")
|
||||
icon: Settings.data.notifications.doNotDisturb ? "bell-off" : "bell"
|
||||
tooltipText: Settings.data.notifications.doNotDisturb ? I18n.tr("tooltips.open-notification-history-disable-dnd") : I18n.tr("tooltips.open-notification-history-enable-dnd")
|
||||
|
||||
@@ -12,14 +12,14 @@ NIconButton {
|
||||
property ShellScreen screen
|
||||
|
||||
baseSize: Style.capsuleHeight
|
||||
applyUiScale: false
|
||||
compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini")
|
||||
visible: PowerProfileService.available
|
||||
|
||||
icon: PowerProfileService.getIcon()
|
||||
tooltipText: I18n.tr("tooltips.power-profile", {
|
||||
"profile": PowerProfileService.getName()
|
||||
})
|
||||
tooltipDirection: BarService.getTooltipDirection()
|
||||
compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini")
|
||||
colorBg: (PowerProfileService.profile === PowerProfile.Balanced) ? (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) : Color.mPrimary
|
||||
colorFg: (PowerProfileService.profile === PowerProfile.Balanced) ? Color.mOnSurface : Color.mOnPrimary
|
||||
colorBorder: Color.transparent
|
||||
|
||||
@@ -14,6 +14,7 @@ NIconButton {
|
||||
tooltipDirection: BarService.getTooltipDirection()
|
||||
compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini")
|
||||
baseSize: Style.capsuleHeight
|
||||
applyUiScale: false
|
||||
colorBg: ScreenRecorderService.isRecording ? Color.mPrimary : (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent)
|
||||
colorFg: ScreenRecorderService.isRecording ? Color.mOnPrimary : Color.mOnSurface
|
||||
colorBorder: Color.transparent
|
||||
|
||||
@@ -12,6 +12,7 @@ NIconButton {
|
||||
|
||||
compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini")
|
||||
baseSize: Style.capsuleHeight
|
||||
applyUiScale: false
|
||||
icon: "power"
|
||||
tooltipText: I18n.tr("tooltips.session-menu")
|
||||
tooltipDirection: BarService.getTooltipDirection()
|
||||
|
||||
@@ -11,6 +11,7 @@ NIconButton {
|
||||
property ShellScreen screen
|
||||
|
||||
baseSize: Style.capsuleHeight
|
||||
applyUiScale: false
|
||||
compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini")
|
||||
icon: "wallpaper-selector"
|
||||
tooltipText: I18n.tr("tooltips.open-wallpaper-selector")
|
||||
|
||||
@@ -14,6 +14,7 @@ NIconButton {
|
||||
|
||||
compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini")
|
||||
baseSize: Style.capsuleHeight
|
||||
applyUiScale: false
|
||||
colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent)
|
||||
colorFg: Color.mOnSurface
|
||||
colorBorder: Color.transparent
|
||||
|
||||
@@ -7,7 +7,8 @@ import qs.Services
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
property real baseSize: Style.baseWidgetSize * Style.uiScaleRatio
|
||||
property real baseSize: Style.baseWidgetSize
|
||||
property bool applyUiScale: true
|
||||
|
||||
property string icon
|
||||
property string tooltipText
|
||||
@@ -30,8 +31,8 @@ Rectangle {
|
||||
signal rightClicked
|
||||
signal middleClicked
|
||||
|
||||
implicitWidth: Math.round(baseSize)
|
||||
implicitHeight: Math.round(baseSize)
|
||||
implicitWidth: applyUiScale ? Math.round(baseSize * applyUiScale) : Math.round(baseSize)
|
||||
implicitHeight: applyUiScale ? Math.round(baseSize * applyUiScale) : Math.round(baseSize)
|
||||
|
||||
opacity: root.enabled ? Style.opacityFull : Style.opacityMedium
|
||||
color: root.enabled && root.hovering ? colorBgHover : colorBg
|
||||
@@ -49,6 +50,7 @@ Rectangle {
|
||||
NIcon {
|
||||
icon: root.icon
|
||||
pointSize: Math.max(1, root.compact ? root.width * 0.65 : root.width * 0.48)
|
||||
applyUiScale: root.applyUiScale
|
||||
color: root.enabled && root.hovering ? colorFgHover : colorFg
|
||||
// Center horizontally
|
||||
x: (root.width - width) / 2
|
||||
|
||||
Reference in New Issue
Block a user