mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Tray: layout fixes
This commit is contained in:
@@ -20,21 +20,24 @@ NPanel {
|
||||
// Trigger refresh when settings change
|
||||
property int settingsVersion: 0
|
||||
|
||||
// Read favorites directly from settings for reactivity
|
||||
readonly property var favoritesList: {
|
||||
// Read widget settings for reactivity
|
||||
readonly property var widgetSettings: {
|
||||
// Reference settingsVersion to force recalculation when it changes
|
||||
var _ = root.settingsVersion
|
||||
if (widgetSection === "" || widgetIndex < 0)
|
||||
return []
|
||||
return {}
|
||||
var widgets = Settings.data.bar.widgets[widgetSection]
|
||||
if (!widgets || widgetIndex >= widgets.length)
|
||||
return []
|
||||
var widgetSettings = widgets[widgetIndex]
|
||||
if (!widgetSettings || widgetSettings.id !== "Tray")
|
||||
return []
|
||||
return widgetSettings.favorites || []
|
||||
return {}
|
||||
var settings = widgets[widgetIndex]
|
||||
if (!settings || settings.id !== "Tray")
|
||||
return {}
|
||||
return settings
|
||||
}
|
||||
|
||||
// Read favorites directly from settings for reactivity
|
||||
readonly property var favoritesList: widgetSettings.favorites || []
|
||||
|
||||
function wildCardMatch(str, rule) {
|
||||
if (!str || !rule)
|
||||
return false
|
||||
@@ -126,7 +129,7 @@ NPanel {
|
||||
return icon
|
||||
}
|
||||
|
||||
layer.enabled: true
|
||||
layer.enabled: root.widgetSettings.colorizeIcons !== false
|
||||
layer.effect: ShaderEffect {
|
||||
property color targetColor: Settings.data.colorSchemes.darkMode ? Color.mOnSurface : Color.mSurfaceVariant
|
||||
property real colorizeMode: 1.0
|
||||
|
||||
@@ -303,17 +303,18 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// Dropdown opener - wrapped in Item for proper alignment
|
||||
// Dropdown opener - simple icon with hover effect
|
||||
Item {
|
||||
id: dropdownButton
|
||||
visible: dropdownItems.length > 0
|
||||
width: itemSize
|
||||
height: itemSize
|
||||
|
||||
NIconButton {
|
||||
id: dropdownButton
|
||||
property bool hovered: false
|
||||
|
||||
NIcon {
|
||||
id: chevronIcon
|
||||
anchors.centerIn: parent
|
||||
width: itemSize
|
||||
height: itemSize
|
||||
icon: {
|
||||
if (barPosition === "top")
|
||||
return "chevron-down"
|
||||
@@ -326,13 +327,36 @@ Rectangle {
|
||||
else
|
||||
return "chevron-down" // default fallback
|
||||
}
|
||||
tooltipText: I18n.tr("open-control-center") // reuse generic tooltip text
|
||||
pointSize: Math.round(itemSize * 0.65)
|
||||
color: dropdownButton.hovered ? Color.mPrimary : Color.mOnSurface
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Style.animationFast
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onEntered: {
|
||||
dropdownButton.hovered = true
|
||||
TooltipService.show(Screen, dropdownButton, I18n.tr("tooltips.open-tray-dropdown"), BarService.getTooltipDirection())
|
||||
}
|
||||
onExited: {
|
||||
dropdownButton.hovered = false
|
||||
TooltipService.hide()
|
||||
}
|
||||
onClicked: {
|
||||
TooltipService.hideImmediately()
|
||||
const panel = PanelService.getPanel("trayDropdownPanel", root.screen)
|
||||
if (panel) {
|
||||
panel.widgetSection = root.section
|
||||
panel.widgetIndex = root.sectionWidgetIndex
|
||||
panel.toggle(this)
|
||||
panel.toggle(dropdownButton)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user