4242 readonly property color iconColor: enableColorization ? Color .resolveColorKey (iconColorKey) : Color .mPrimary
4343
4444 // Content dimensions (visual capsule size)
45- readonly property real contentWidth: content .implicitWidth + Style .marginM * 2
46- readonly property real contentHeight: capsuleHeight
45+ readonly property real contentWidth: isBarVertical ? capsuleHeight : layout .implicitWidth + Style .marginM * 2
46+ readonly property real contentHeight: isBarVertical ? layout . implicitHeight + Style . marginM * 2 : capsuleHeight
4747
4848 // Widget dimensions (extends to full bar height for better click area)
4949 implicitWidth: contentWidth
@@ -67,54 +67,113 @@ Item {
6767 radius: Style .radiusL
6868 border .color : Style .capsuleBorderColor
6969 border .width : Style .capsuleBorderWidth
70-
71- RowLayout { // Widget
72- id: content
70+ Item {
71+ id: layout
7372 anchors .centerIn : parent
74- spacing: Style .marginS
75- NIcon { // Theme icon
76- visible: ! root .pluginApi .mainInstance .refreshing && root .customIconPath === " " && ! root .useDistroLogo
77- color: mouseArea .containsMouse ? Color .mOnHover : (root .pluginApi .mainInstance .noctaliaUpdate ? Color .mHover : root .iconColor )
78- icon: (root .pluginApi .mainInstance .noctaliaUpdate | mouseArea .containsMouse ) ? root .iconName + " -filled" : root .iconName
79- }
80- IconImage { // Custom file or distro logo
81- visible: ! root .pluginApi .mainInstance .refreshing && (root .useDistroLogo || root .customIconPath !== " " )
82- Layout .preferredWidth : root .capsuleHeight * 0.6
83- Layout .preferredHeight : root .capsuleHeight * 0.6
84- source: {
85- if (root .useDistroLogo ) return HostService .osLogo
86- if (root .customIconPath !== " " ) return root .customIconPath .startsWith (" file://" ) ? root .customIconPath : " file://" + root .customIconPath
87- return " "
73+ implicitWidth: contentHorizontal .visible ? contentHorizontal .implicitWidth : contentVertical .implicitWidth
74+ implicitHeight: contentHorizontal .visible ? contentHorizontal .implicitHeight : contentVertical .implicitHeight
75+
76+ RowLayout { // Horizontal Widget
77+ id: contentHorizontal
78+ visible: ! root .isBarVertical
79+ anchors .centerIn : parent
80+ spacing: Style .marginS
81+ NIcon { // Theme icon
82+ visible: ! root .pluginApi .mainInstance .refreshing && root .customIconPath === " " && ! root .useDistroLogo
83+ color: mouseArea .containsMouse ? Color .mOnHover : (root .pluginApi .mainInstance .noctaliaUpdate ? Color .mHover : root .iconColor )
84+ icon: (root .pluginApi .mainInstance .noctaliaUpdate | mouseArea .containsMouse ) ? root .iconName + " -filled" : root .iconName
8885 }
89- smooth: true
90- asynchronous: true
91- layer .enabled : root .enableColorization && (root .useDistroLogo || root .customIconPath !== " " )
92- layer .effect : ShaderEffect {
93- property color targetColor: mouseArea .containsMouse ? Color .mOnHover : root .iconColor
94- property real colorizeMode: 2.0
95- fragmentShader: Qt .resolvedUrl (Quickshell .shellDir + " /Shaders/qsb/appicon_colorize.frag.qsb" )
86+ IconImage { // Custom file or distro logo
87+ visible: ! root .pluginApi .mainInstance .refreshing && (root .useDistroLogo || root .customIconPath !== " " )
88+ Layout .preferredWidth : root .capsuleHeight * 0.6
89+ Layout .preferredHeight : root .capsuleHeight * 0.6
90+ source: {
91+ if (root .useDistroLogo ) return HostService .osLogo
92+ if (root .customIconPath !== " " ) return root .customIconPath .startsWith (" file://" ) ? root .customIconPath : " file://" + root .customIconPath
93+ return " "
94+ }
95+ smooth: true
96+ asynchronous: true
97+ layer .enabled : root .enableColorization && (root .useDistroLogo || root .customIconPath !== " " )
98+ layer .effect : ShaderEffect {
99+ property color targetColor: mouseArea .containsMouse ? Color .mOnHover : root .iconColor
100+ property real colorizeMode: 2.0
101+ fragmentShader: Qt .resolvedUrl (Quickshell .shellDir + " /Shaders/qsb/appicon_colorize.frag.qsb" )
102+ }
96103 }
97- }
98- NIcon { // Loading spinner
99- icon: " loader"
100- color: mouseArea .containsMouse ? Color .mOnHover : Color .mOnSurfaceVariant
101- visible: root .pluginApi .mainInstance .refreshing
102-
103- RotationAnimator on rotation {
104- running: root .pluginApi .mainInstance .refreshing
105- from: 0
106- to: 360
107- duration: 1000
108- loops: Animation .Infinite
104+ NIcon { // Loading spinner
105+ icon: " loader"
106+ color: mouseArea .containsMouse ? Color .mOnHover : Color .mOnSurfaceVariant
107+ visible: root .pluginApi .mainInstance .refreshing
108+
109+ RotationAnimator on rotation {
110+ running: root .pluginApi .mainInstance .refreshing
111+ from: 0
112+ to: 360
113+ duration: 1000
114+ loops: Animation .Infinite
115+ }
116+ }
117+ NText { // Count
118+ visible: ! root .pluginApi .mainInstance .refreshing
119+ text: (root .pluginApi .mainInstance .updateCount + root .pluginApi .mainInstance .flatpakCount ).toString ()
120+ color: mouseArea .containsMouse ? Color .mOnHover : (root .pluginApi .mainInstance .noctaliaUpdate ? Color .mSecondary : Color .mOnSurface )
121+ pointSize: root .barFontSize
122+ applyUiScale: false
123+ font .weight : root .boldText ? Font .Bold : Font .Normal
109124 }
110125 }
111- NText { // Count
112- visible: ! root .pluginApi .mainInstance .refreshing
113- text: (root .pluginApi .mainInstance .updateCount + root .pluginApi .mainInstance .flatpakCount ).toString ()
114- color: mouseArea .containsMouse ? Color .mOnHover : (root .pluginApi .mainInstance .noctaliaUpdate ? Color .mSecondary : Color .mOnSurface )
115- pointSize: root .barFontSize
116- applyUiScale: false
117- font .weight : root .boldText ? Font .Bold : Font .Normal
126+
127+
128+ ColumnLayout { // Vertical Widget
129+ id: contentVertical
130+ visible: root .isBarVertical
131+ anchors .centerIn : parent
132+ spacing: Style .marginS
133+ NText { // Count
134+ visible: ! root .pluginApi .mainInstance .refreshing
135+ text: (root .pluginApi .mainInstance .updateCount + root .pluginApi .mainInstance .flatpakCount ).toString ()
136+ color: mouseArea .containsMouse ? Color .mOnHover : (root .pluginApi .mainInstance .noctaliaUpdate ? Color .mSecondary : Color .mOnSurface )
137+ pointSize: root .barFontSize
138+ applyUiScale: false
139+ font .weight : root .boldText ? Font .Bold : Font .Normal
140+ }
141+ NIcon { // Theme icon
142+ visible: ! root .pluginApi .mainInstance .refreshing && root .customIconPath === " " && ! root .useDistroLogo
143+ color: mouseArea .containsMouse ? Color .mOnHover : (root .pluginApi .mainInstance .noctaliaUpdate ? Color .mHover : root .iconColor )
144+ icon: (root .pluginApi .mainInstance .noctaliaUpdate | mouseArea .containsMouse ) ? root .iconName + " -filled" : root .iconName
145+ }
146+ IconImage { // Custom file or distro logo
147+ visible: ! root .pluginApi .mainInstance .refreshing && (root .useDistroLogo || root .customIconPath !== " " )
148+ Layout .preferredWidth : root .capsuleHeight * 0.6
149+ Layout .preferredHeight : root .capsuleHeight * 0.6
150+ source: {
151+ if (root .useDistroLogo ) return HostService .osLogo
152+ if (root .customIconPath !== " " ) return root .customIconPath .startsWith (" file://" ) ? root .customIconPath : " file://" + root .customIconPath
153+ return " "
154+ }
155+ smooth: true
156+ asynchronous: true
157+ layer .enabled : root .enableColorization && (root .useDistroLogo || root .customIconPath !== " " )
158+ layer .effect : ShaderEffect {
159+ property color targetColor: mouseArea .containsMouse ? Color .mOnHover : root .iconColor
160+ property real colorizeMode: 2.0
161+ fragmentShader: Qt .resolvedUrl (Quickshell .shellDir + " /Shaders/qsb/appicon_colorize.frag.qsb" )
162+ }
163+ }
164+ NIcon { // Loading spinner
165+ icon: " loader"
166+ color: mouseArea .containsMouse ? Color .mOnHover : Color .mOnSurfaceVariant
167+ visible: root .pluginApi .mainInstance .refreshing
168+
169+ RotationAnimator on rotation {
170+ running: root .pluginApi .mainInstance .refreshing
171+ from: 0
172+ to: 360
173+ duration: 1000
174+ loops: Animation .Infinite
175+ }
176+ }
118177 }
119178 }
120179 }
@@ -183,7 +242,9 @@ Item {
183242 }
184243 onEntered: {
185244 // Tooltip shows available updates for both system and flatpak
186- TooltipService .show (root, (root .pluginApi .mainInstance .noctaliaUpdate ? pluginApi .tr (" tooltip.noctaliaUpdates" ) : pluginApi .tr (" tooltip.availableUpdates" )) + " \n ---------------\n " + (root .tooltipTextTrimmed !== root .tooltipText ? root .tooltipTextTrimmed + " \n ..." : root .tooltipTextTrimmed ), BarService .getTooltipDirection ())
245+ if (pluginApi .pluginSettings .tooltip ?? pluginApi .manifest .metadata .defaultSettings .tooltip ) {
246+ TooltipService .show (root, (root .pluginApi .mainInstance .noctaliaUpdate ? pluginApi .tr (" tooltip.noctaliaUpdates" ) : pluginApi .tr (" tooltip.availableUpdates" )) + " \n ---------------\n " + (root .tooltipTextTrimmed !== root .tooltipText ? root .tooltipTextTrimmed + " \n ..." : root .tooltipTextTrimmed ), BarService .getTooltipDirection (root .screen ? .name ))
247+ }
187248 }
188249
189250 onExited: {
0 commit comments