mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Cleanup: replaced a bunch of Screen by their proper "screen"
This commit is contained in:
@@ -7,6 +7,8 @@ import qs.Widgets
|
||||
Item {
|
||||
id: root
|
||||
|
||||
required property ShellScreen screen
|
||||
|
||||
property string icon: ""
|
||||
property string text: ""
|
||||
property string suffix: ""
|
||||
@@ -43,6 +45,7 @@ Item {
|
||||
Component {
|
||||
id: verticalPillComponent
|
||||
BarPillVertical {
|
||||
screen: root.screen
|
||||
icon: root.icon
|
||||
text: root.text
|
||||
suffix: root.suffix
|
||||
@@ -68,6 +71,7 @@ Item {
|
||||
Component {
|
||||
id: horizontalPillComponent
|
||||
BarPillHorizontal {
|
||||
screen: root.screen
|
||||
icon: root.icon
|
||||
text: root.text
|
||||
suffix: root.suffix
|
||||
|
||||
@@ -8,7 +8,7 @@ import qs.Widgets
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property ShellScreen screen
|
||||
required property ShellScreen screen
|
||||
|
||||
property string icon: ""
|
||||
property string text: ""
|
||||
@@ -255,7 +255,7 @@ Item {
|
||||
onEntered: {
|
||||
hovered = true;
|
||||
root.entered();
|
||||
TooltipService.show(Screen, pill, root.tooltipText, BarService.getTooltipDirection(), Style.tooltipDelayLong);
|
||||
TooltipService.show(screen, pill, root.tooltipText, BarService.getTooltipDirection(), Style.tooltipDelayLong);
|
||||
if (forceClose) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import qs.Widgets
|
||||
Item {
|
||||
id: root
|
||||
|
||||
required property ShellScreen screen
|
||||
|
||||
property string icon: ""
|
||||
property string text: ""
|
||||
property string suffix: ""
|
||||
@@ -295,7 +297,7 @@ Item {
|
||||
onEntered: {
|
||||
hovered = true;
|
||||
root.entered();
|
||||
TooltipService.show(Screen, pill, root.tooltipText, BarService.getTooltipDirection(), Style.tooltipDelayLong);
|
||||
TooltipService.show(screen, pill, root.tooltipText, BarService.getTooltipDirection(), Style.tooltipDelayLong);
|
||||
if (forceClose) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ Item {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onEntered: {
|
||||
if ((windowTitle !== "") && isVerticalBar || (scrollingMode === "never")) {
|
||||
TooltipService.show(Screen, root, windowTitle, BarService.getTooltipDirection());
|
||||
TooltipService.show(screen, root, windowTitle, BarService.getTooltipDirection());
|
||||
}
|
||||
}
|
||||
onExited: {
|
||||
|
||||
@@ -87,6 +87,7 @@ Item {
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
screen: root.screen
|
||||
density: Settings.data.bar.density
|
||||
oppositeDirection: BarService.getPillDirection(root)
|
||||
icon: testMode ? BatteryService.getIcon(testPercent, testCharging, true) : BatteryService.getIcon(percent, charging, isReady)
|
||||
|
||||
@@ -36,6 +36,7 @@ Item {
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
screen: root.screen
|
||||
density: Settings.data.bar.density
|
||||
oppositeDirection: BarService.getPillDirection(root)
|
||||
icon: BluetoothService.enabled ? "bluetooth" : "bluetooth-off"
|
||||
|
||||
@@ -77,6 +77,7 @@ Item {
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
screen: root.screen
|
||||
density: Settings.data.bar.density
|
||||
oppositeDirection: BarService.getPillDirection(root)
|
||||
icon: getIcon()
|
||||
|
||||
@@ -122,7 +122,7 @@ Rectangle {
|
||||
hoverEnabled: true
|
||||
onEntered: {
|
||||
if (!PanelService.getPanel("calendarPanel", screen)?.active) {
|
||||
TooltipService.show(Screen, root, I18n.tr("clock.tooltip"), BarService.getTooltipDirection());
|
||||
TooltipService.show(screen, root, I18n.tr("clock.tooltip"), BarService.getTooltipDirection());
|
||||
}
|
||||
}
|
||||
onExited: {
|
||||
|
||||
@@ -55,6 +55,7 @@ Item {
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
screen: root.screen
|
||||
oppositeDirection: BarService.getPillDirection(root)
|
||||
icon: _dynamicIcon !== "" ? _dynamicIcon : customIcon
|
||||
text: shouldShowText ? _dynamicText : ""
|
||||
|
||||
@@ -37,8 +37,8 @@ Item {
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
screen: root.screen
|
||||
text: IdleInhibitorService.timeout == null ? "" : Time.formatVagueHumanReadableDuration(IdleInhibitorService.timeout)
|
||||
|
||||
density: Settings.data.bar.density
|
||||
oppositeDirection: BarService.getPillDirection(root)
|
||||
icon: IdleInhibitorService.isInhibited ? "keep-awake-on" : "keep-awake-off"
|
||||
|
||||
@@ -41,8 +41,9 @@ Item {
|
||||
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
screen: root.screen
|
||||
density: Settings.data.bar.density
|
||||
oppositeDirection: BarService.getPillDirection(root)
|
||||
icon: "keyboard"
|
||||
|
||||
@@ -484,7 +484,7 @@ Item {
|
||||
onEntered: {
|
||||
var textToShow = hasActivePlayer ? tooltipText : placeholderText;
|
||||
if ((textToShow !== "") && isVerticalBar || (scrollingMode === "never")) {
|
||||
TooltipService.show(Screen, root, textToShow, BarService.getTooltipDirection());
|
||||
TooltipService.show(screen, root, textToShow, BarService.getTooltipDirection());
|
||||
}
|
||||
}
|
||||
onExited: {
|
||||
|
||||
@@ -87,6 +87,7 @@ Item {
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
screen: root.screen
|
||||
oppositeDirection: BarService.getPillDirection(root)
|
||||
icon: AudioService.getInputIcon()
|
||||
density: Settings.data.bar.density
|
||||
|
||||
@@ -177,7 +177,7 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
}
|
||||
onEntered: TooltipService.show(Screen, taskbarItem, taskbarItem.modelData.title || taskbarItem.modelData.appId || "Unknown app.", BarService.getTooltipDirection())
|
||||
onEntered: TooltipService.show(screen, taskbarItem, taskbarItem.modelData.title || taskbarItem.modelData.appId || "Unknown app.", BarService.getTooltipDirection())
|
||||
onExited: TooltipService.hide()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ Item {
|
||||
}
|
||||
onEntered: {
|
||||
taskbarItem.itemHovered = true;
|
||||
TooltipService.show(Screen, taskbarItem, model.title || model.appId || "Unknown app.", BarService.getTooltipDirection());
|
||||
TooltipService.show(screen, taskbarItem, model.title || model.appId || "Unknown app.", BarService.getTooltipDirection());
|
||||
}
|
||||
onExited: {
|
||||
taskbarItem.itemHovered = false;
|
||||
|
||||
@@ -379,7 +379,7 @@ Rectangle {
|
||||
if (trayMenuWindow) {
|
||||
trayMenuWindow.close();
|
||||
}
|
||||
TooltipService.show(Screen, trayIcon, modelData.tooltipTitle || modelData.name || modelData.id || "Tray Item", BarService.getTooltipDirection());
|
||||
TooltipService.show(screen, trayIcon, modelData.tooltipTitle || modelData.name || modelData.id || "Tray Item", BarService.getTooltipDirection());
|
||||
}
|
||||
onExited: TooltipService.hide()
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ Item {
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
screen: root.screen
|
||||
density: Settings.data.bar.density
|
||||
oppositeDirection: BarService.getPillDirection(root)
|
||||
icon: AudioService.getOutputIcon()
|
||||
|
||||
@@ -36,6 +36,7 @@ Item {
|
||||
BarPill {
|
||||
id: pill
|
||||
|
||||
screen: root.screen
|
||||
density: Settings.data.bar.density
|
||||
oppositeDirection: BarService.getPillDirection(root)
|
||||
icon: {
|
||||
|
||||
@@ -500,7 +500,7 @@ Loader {
|
||||
const appName = appButton.appTitle || appButton.appId || "Unknown";
|
||||
const tooltipText = appName.length > 40 ? appName.substring(0, 37) + "..." : appName;
|
||||
if (!contextMenu.visible) {
|
||||
TooltipService.show(Screen, appButton, tooltipText, "top");
|
||||
TooltipService.show(screen, appButton, tooltipText, "top");
|
||||
}
|
||||
if (autoHide) {
|
||||
showTimer.stop();
|
||||
|
||||
@@ -82,7 +82,7 @@ ColumnLayout {
|
||||
enabled: !valueTextStream
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
|
||||
Layout.bottomMargin: Style.marginS
|
||||
onEntered: TooltipService.show(Screen, leftClickUpdateText, I18n.tr("bar.widget-settings.custom-button.left-click.update-text"), "auto")
|
||||
onEntered: TooltipService.show(screen, leftClickUpdateText, I18n.tr("bar.widget-settings.custom-button.left-click.update-text"), "auto")
|
||||
onExited: TooltipService.hide()
|
||||
checked: widgetData?.leftClickUpdateText ?? widgetMetadata.leftClickUpdateText
|
||||
onToggled: isChecked => checked = isChecked
|
||||
@@ -106,7 +106,7 @@ ColumnLayout {
|
||||
enabled: !valueTextStream
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
|
||||
Layout.bottomMargin: Style.marginS
|
||||
onEntered: TooltipService.show(Screen, rightClickUpdateText, I18n.tr("bar.widget-settings.custom-button.right-click.update-text"), "auto")
|
||||
onEntered: TooltipService.show(screen, rightClickUpdateText, I18n.tr("bar.widget-settings.custom-button.right-click.update-text"), "auto")
|
||||
onExited: TooltipService.hide()
|
||||
checked: widgetData?.rightClickUpdateText ?? widgetMetadata.rightClickUpdateText
|
||||
onToggled: isChecked => checked = isChecked
|
||||
@@ -130,7 +130,7 @@ ColumnLayout {
|
||||
enabled: !valueTextStream
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
|
||||
Layout.bottomMargin: Style.marginS
|
||||
onEntered: TooltipService.show(Screen, middleClickUpdateText, I18n.tr("bar.widget-settings.custom-button.middle-click.update-text"), "auto")
|
||||
onEntered: TooltipService.show(screen, middleClickUpdateText, I18n.tr("bar.widget-settings.custom-button.middle-click.update-text"), "auto")
|
||||
onExited: TooltipService.hide()
|
||||
checked: widgetData?.middleClickUpdateText ?? widgetMetadata.middleClickUpdateText
|
||||
onToggled: isChecked => checked = isChecked
|
||||
|
||||
@@ -235,7 +235,7 @@ SmartPanel {
|
||||
if (trayMenuWindow) {
|
||||
trayMenuWindow.close();
|
||||
}
|
||||
TooltipService.show(Screen, trayIcon, modelData.tooltipTitle || modelData.name || modelData.id || "Tray Item", BarService.getTooltipDirection());
|
||||
TooltipService.show(screen, trayIcon, modelData.tooltipTitle || modelData.name || modelData.id || "Tray Item", BarService.getTooltipDirection());
|
||||
}
|
||||
onExited: TooltipService.hide()
|
||||
}
|
||||
|
||||
+1
-1
@@ -144,7 +144,7 @@ Rectangle {
|
||||
root.hovered = true;
|
||||
root.entered();
|
||||
if (tooltipText) {
|
||||
TooltipService.show(Screen, root, root.tooltipText);
|
||||
TooltipService.show(screen, root, root.tooltipText);
|
||||
}
|
||||
}
|
||||
onExited: {
|
||||
|
||||
@@ -83,7 +83,7 @@ Rectangle {
|
||||
onEntered: {
|
||||
hovering = root.enabled ? true : false;
|
||||
if (tooltipText) {
|
||||
TooltipService.show(Screen, parent, tooltipText, tooltipDirection);
|
||||
TooltipService.show(screen, parent, tooltipText, tooltipDirection);
|
||||
}
|
||||
root.entered();
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ Rectangle {
|
||||
onEntered: {
|
||||
hovering = root.enabled ? true : false;
|
||||
if (tooltipText) {
|
||||
TooltipService.show(Screen, parent, tooltipText, tooltipDirection);
|
||||
TooltipService.show(screen, parent, tooltipText, tooltipDirection);
|
||||
}
|
||||
root.entered();
|
||||
}
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ Slider {
|
||||
onEntered: {
|
||||
root.hovering = true;
|
||||
if (root.tooltipText) {
|
||||
TooltipService.show(Screen, knob, root.tooltipText, root.tooltipDirection);
|
||||
TooltipService.show(screen, knob, root.tooltipText, root.tooltipDirection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user