Tooltip: different approach to get the current screen.

This commit is contained in:
ItsLemmy
2025-10-03 23:27:07 -04:00
parent b85576653a
commit 86127660fe
33 changed files with 32 additions and 83 deletions
@@ -10,8 +10,6 @@ import qs.Widgets
NBox {
id: root
property ShellScreen screen
ColumnLayout {
anchors.fill: parent
anchors.margins: Style.marginL * scaling
@@ -282,7 +280,6 @@ NBox {
// Previous button
NIconButton {
icon: "media-prev"
screen: root.screen
tooltipText: I18n.tr("tooltips.previous-media")
visible: MediaService.canGoPrevious
onClicked: MediaService.canGoPrevious ? MediaService.previous() : {}
@@ -291,7 +288,6 @@ NBox {
// Play/Pause button
NIconButton {
icon: MediaService.isPlaying ? "media-pause" : "media-play"
screen: root.screen
tooltipText: MediaService.isPlaying ? I18n.tr("tooltips.pause") : I18n.tr("tooltips.play")
visible: (MediaService.canPlay || MediaService.canPause)
onClicked: (MediaService.canPlay || MediaService.canPause) ? MediaService.playPause() : {}
@@ -300,7 +296,6 @@ NBox {
// Next button
NIconButton {
icon: "media-next"
screen: root.screen
tooltipText: I18n.tr("tooltips.next-media")
visible: MediaService.canGoNext
onClicked: MediaService.canGoNext ? MediaService.next() : {}
@@ -10,7 +10,6 @@ import qs.Widgets
// Power Profiles: performance, balanced, eco
NBox {
property ShellScreen screen
property real spacing: 0
// Centralized service
@@ -27,7 +26,6 @@ NBox {
// Performance
NIconButton {
icon: PowerProfileService.getIcon(PowerProfile.Performance)
screen: root.screen
tooltipText: I18n.tr("tooltips.set-power-profile", {
"profile": PowerProfileService.getName(PowerProfile.Performance)
})
@@ -40,7 +38,6 @@ NBox {
// Balanced
NIconButton {
icon: PowerProfileService.getIcon(PowerProfile.Balanced)
screen: root.screen
tooltipText: I18n.tr("tooltips.set-power-profile", {
"profile": PowerProfileService.getName(PowerProfile.Balanced)
})
@@ -53,7 +50,6 @@ NBox {
// Eco
NIconButton {
icon: PowerProfileService.getIcon(PowerProfile.PowerSaver)
screen: root.screen
tooltipText: I18n.tr("tooltips.set-power-profile", {
"profile": PowerProfileService.getName(PowerProfile.PowerSaver)
})
@@ -14,7 +14,6 @@ import qs.Widgets
NBox {
id: root
property ShellScreen screen
property string uptimeText: "--"
RowLayout {
@@ -59,7 +58,6 @@ NBox {
}
NIconButton {
icon: "settings"
screen: root.screen
tooltipText: I18n.tr("tooltips.open-settings")
onClicked: {
settingsPanel.requestedTab = SettingsPanel.Tab.General
@@ -69,7 +67,6 @@ NBox {
NIconButton {
icon: "power"
screen: root.screen
tooltipText: I18n.tr("tooltips.session-menu")
onClicked: {
sessionMenuPanel.open()
@@ -79,7 +76,6 @@ NBox {
NIconButton {
icon: "close"
screen: root.screen
tooltipText: I18n.tr("tooltips.close")
onClicked: {
controlCenterPanel.close()
@@ -9,8 +9,6 @@ import qs.Widgets
NBox {
id: root
property ShellScreen screen
ColumnLayout {
id: content
anchors.left: parent.left
@@ -10,7 +10,6 @@ import qs.Widgets
// Utilities: record & wallpaper
NBox {
property ShellScreen screen
property real spacing: 0
RowLayout {
@@ -24,7 +23,6 @@ NBox {
// Screen Recorder
NIconButton {
icon: "camera-video"
screen: root.screen
enabled: ScreenRecorderService.isAvailable
tooltipText: ScreenRecorderService.isAvailable ? (ScreenRecorderService.isRecording ? I18n.tr("tooltips.stop-screen-recording") : I18n.tr("tooltips.start-screen-recording")) : I18n.tr("tooltips.screen-recorder-not-installed")
colorBg: ScreenRecorderService.isRecording ? Color.mPrimary : Color.mSurfaceVariant
@@ -44,7 +42,6 @@ NBox {
// Idle Inhibitor
NIconButton {
icon: IdleInhibitorService.isInhibited ? "keep-awake-on" : "keep-awake-off"
screen: root.screen
tooltipText: IdleInhibitorService.isInhibited ? I18n.tr("tooltips.disable-keep-awake") : I18n.tr("tooltips.enable-keep-awake")
colorBg: IdleInhibitorService.isInhibited ? Color.mPrimary : Color.mSurfaceVariant
colorFg: IdleInhibitorService.isInhibited ? Color.mOnPrimary : Color.mPrimary
@@ -57,7 +54,6 @@ NBox {
NIconButton {
visible: Settings.data.wallpaper.enabled
icon: "wallpaper-selector"
screen: root.screen
tooltipText: I18n.tr("tooltips.wallpaper-selector")
onClicked: PanelService.getPanel("wallpaperPanel")?.toggle(this)
onRightClicked: WallpaperService.setRandomWallpaper()
@@ -9,7 +9,6 @@ import qs.Widgets
NBox {
id: root
property ShellScreen screen
readonly property bool weatherReady: (LocationService.data.weather !== null)
ColumnLayout {