Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions config/Config.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import "defaults/system.js" as SystemDefaults
import "defaults/dock.js" as DockDefaults
import "defaults/ai.js" as AiDefaults
import "ConfigValidator.js" as ConfigValidator
import "ScreenPositions.js" as ScreenPositions

Singleton {
id: root
Expand Down Expand Up @@ -527,6 +528,7 @@ Singleton {

adapter: JsonAdapter {
property string position: "top"
property var screenPositions: ({})
property string launcherIcon: ""
property bool launcherIconTint: true
property bool launcherIconFullTint: true
Expand Down Expand Up @@ -672,6 +674,7 @@ Singleton {
adapter: JsonAdapter {
property string theme: "default"
property string position: "top"
property var screenPositions: ({})
property int hoverRegionHeight: 8
property bool keepHidden: false
property string noMediaDisplay: "userHost"
Expand Down Expand Up @@ -1088,6 +1091,7 @@ Singleton {
property bool enabled: false
property string theme: "default"
property string position: "bottom"
property var screenPositions: ({})
property int height: 56
property int iconSize: 40
property int spacing: 4
Expand Down Expand Up @@ -3254,6 +3258,20 @@ Singleton {
// Bar configuration
property QtObject bar: barLoader.adapter
property bool showBackground: theme.srBarBg.opacity > 0
readonly property var shellEdgePositions: ["top", "bottom", "left", "right"]
readonly property var notchEdgePositions: ["top", "bottom"]

function barPositionForScreen(screenName) {
return ScreenPositions.positionForScreen(bar, screenName, "top", shellEdgePositions);
}

function notchPositionForScreen(screenName) {
return ScreenPositions.positionForScreen(notch, screenName, "top", notchEdgePositions);
}

function dockPositionForScreen(screenName) {
return ScreenPositions.positionForScreen(dock, screenName, "bottom", shellEdgePositions);
Comment on lines +3272 to +3273
}

// Workspace configuration
property QtObject workspaces: workspacesLoader.adapter
Expand Down
7 changes: 7 additions & 0 deletions config/ConfigValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ function validate(current, defaults, keyName) {
return clone(defaults);
}

if (keyName === "screenPositions") {
if (typeof current !== 'object' || Array.isArray(current)) {
return clone(defaults);
}
return clone(current);
}

if (Array.isArray(defaults)) {
if (!Array.isArray(current)) {
return clone(defaults);
Expand Down
20 changes: 20 additions & 0 deletions config/ScreenPositions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.pragma library

function isValidPosition(value, allowedPositions) {
return typeof value === "string" && allowedPositions.indexOf(value) !== -1;
}

function positionForScreen(config, screenName, fallbackPosition, allowedPositions) {
var globalPosition = fallbackPosition;

if (config && isValidPosition(config.position, allowedPositions)) {
globalPosition = config.position;
}

if (!config || !screenName || !config.screenPositions || typeof config.screenPositions !== "object" || Array.isArray(config.screenPositions)) {
return globalPosition;
}

var screenPosition = config.screenPositions[screenName];
return isValidPosition(screenPosition, allowedPositions) ? screenPosition : globalPosition;
}
1 change: 1 addition & 0 deletions config/defaults/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var data = {
"position": "top",
"screenPositions": {},
"launcherIcon": "",
"launcherIconTint": true,
"launcherIconFullTint": true,
Expand Down
1 change: 1 addition & 0 deletions config/defaults/dock.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var data = {
"enabled": true,
"theme": "default",
"position": "bottom",
"screenPositions": {},
"height": 48,
"iconSize": 24,
"spacing": 4,
Expand Down
1 change: 1 addition & 0 deletions config/defaults/notch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var data = {
"theme": "default",
"position": "top",
"screenPositions": {},
"hoverRegionHeight": 8,
"keepHidden": false,
"noMediaDisplay": "userHost",
Expand Down
6 changes: 3 additions & 3 deletions modules/bar/BarContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Item {

required property ShellScreen screen

property string barPosition: (Config.bar && Config.bar.position !== undefined && ["top", "bottom", "left", "right"].includes(Config.bar.position) ? Config.bar.position : "top")
property string barPosition: Config.barPositionForScreen(screen.name)
property string orientation: barPosition === "left" || barPosition === "right" ? "vertical" : "horizontal"

// Auto-hide properties
Expand Down Expand Up @@ -69,7 +69,7 @@ Item {
// Check if notch hover is active (for synchronized reveal when bar is at same side)
// NOTE: We access Visibilities.notchPanels directly because UnifiedShellPanel registers itself as the panel ref
readonly property var notchPanelRef: Visibilities.notchPanels[screen.name]
readonly property string notchPosition: (Config.notchPosition !== undefined ? Config.notchPosition : "top")
readonly property string notchPosition: Config.notchPositionForScreen(screen.name)
readonly property bool notchHoverActive: {
if (barPosition !== notchPosition)
return false;
Expand Down Expand Up @@ -145,7 +145,7 @@ Item {
readonly property bool integratedDockEnabled: (Config.dock && Config.dock.enabled !== undefined ? Config.dock.enabled : false) && (Config.dock && Config.dock.theme !== undefined ? Config.dock.theme : "default") === "integrated"
// Map dock position for integrated based on orientation
readonly property string integratedDockPosition: {
const pos = (Config.dock && Config.dock.position !== undefined ? Config.dock.position : "center");
const pos = Config.dockPositionForScreen(screen.name);

if (root.orientation === "horizontal") {
if (pos === "left" || pos === "start")
Expand Down
2 changes: 1 addition & 1 deletion modules/bar/IntegratedDock.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ StyledRect {

readonly property bool isVertical: orientation === "vertical"
readonly property bool isIntegrated: (Config.dock?.theme ?? "default") === "integrated"
readonly property string dockPosition: Config.dock?.position ?? "center"
readonly property string dockPosition: Config.dockPositionForScreen(bar.screen.name)

// Compact sizing for integrated dock
readonly property int iconSize: 18
Expand Down
2 changes: 1 addition & 1 deletion modules/desktop/Desktop.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PanelWindow {

property int barSize: Config.showBackground ? 44 : 40
property int bottomTextMargin: 32
property string barPosition: ["top", "bottom", "left", "right"].includes(Config.bar.position) ? Config.bar.position : "top"
property string barPosition: Config.barPositionForScreen(screen?.name ?? "")

anchors {
top: true
Expand Down
6 changes: 3 additions & 3 deletions modules/dock/DockContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Item {
readonly property bool isDefault: theme === "default"

// Position configuration with fallback logic to avoid bar collision
readonly property string userPosition: Config.dock?.position ?? "bottom"
readonly property string barPosition: Config.bar?.position ?? "top"
readonly property string notchPosition: Config.notchPosition ?? "top"
readonly property string userPosition: Config.dockPositionForScreen(screen.name)
readonly property string barPosition: Config.barPositionForScreen(screen.name)
readonly property string notchPosition: Config.notchPositionForScreen(screen.name)

// Effective position
readonly property string position: {
Expand Down
2 changes: 1 addition & 1 deletion modules/frame/ScreenFrame.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Item {
readonly property int sidebarMargin: 4
readonly property int sidebarExpansion: sidebarPinned ? (sidebarWidth + thickness) : 0

readonly property string barPos: Config.bar?.position ?? "top"
readonly property string barPos: Config.barPositionForScreen(targetScreen.name)
// Bar height is 44. Total size = Thickness (Outer) + Bar (44) + Thickness (Inner)
readonly property int barExpansion: 44 + thickness
readonly property int topThickness: hasFullscreenWindow ? 0 : (thickness + ((containBar && barPos === "top") ? barExpansion : 0))
Expand Down
4 changes: 2 additions & 2 deletions modules/frame/ScreenFrameContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Item {
// State source: Singletons and Registry
readonly property bool frameEnabled: Config.bar?.frameEnabled ?? false
readonly property bool configContainBar: Config.bar?.containBar ?? false
readonly property string barPos: Config.bar?.position ?? "top"
readonly property string notchPos: Config.notchPosition ?? "top"
readonly property string barPos: Config.barPositionForScreen(targetScreen.name)
readonly property string notchPos: Config.notchPositionForScreen(targetScreen.name)

readonly property var barPanel: Visibilities.barPanels[targetScreen.name]
readonly property var dockPanel: Visibilities.dockPanels[targetScreen.name]
Expand Down
6 changes: 3 additions & 3 deletions modules/globals/GlobalStates.qml
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,11 @@ Singleton {

// Shell config sections and their properties
readonly property var _shellSections: {
"bar": ["position", "launcherIcon", "launcherIconTint", "launcherIconFullTint", "launcherIconSize", "enableFirefoxPlayer", "screenList", "frameEnabled", "frameThickness", "pinnedOnStartup", "hoverToReveal", "hoverRegionHeight", "showPinButton", "availableOnFullscreen", "pillStyle", "use12hFormat", "containBar", "keepBarShadow", "keepBarBorder"],
"notch": ["theme", "position", "hoverRegionHeight", "keepHidden"],
"bar": ["position", "screenPositions", "launcherIcon", "launcherIconTint", "launcherIconFullTint", "launcherIconSize", "enableFirefoxPlayer", "screenList", "frameEnabled", "frameThickness", "pinnedOnStartup", "hoverToReveal", "hoverRegionHeight", "showPinButton", "availableOnFullscreen", "pillStyle", "use12hFormat", "containBar", "keepBarShadow", "keepBarBorder"],
"notch": ["theme", "position", "screenPositions", "hoverRegionHeight", "keepHidden"],
"workspaces": ["shown", "showAppIcons", "alwaysShowNumbers", "showNumbers", "dynamic"],
"overview": ["rows", "columns", "scale", "workspaceSpacing"],
"dock": ["enabled", "theme", "position", "height", "iconSize", "spacing", "margin", "hoverRegionHeight", "pinnedOnStartup", "hoverToReveal", "availableOnFullscreen", "showRunningIndicators", "showPinButton", "showOverviewButton", "screenList", "keepHidden"],
"dock": ["enabled", "theme", "position", "screenPositions", "height", "iconSize", "spacing", "margin", "hoverRegionHeight", "pinnedOnStartup", "hoverToReveal", "availableOnFullscreen", "showRunningIndicators", "showPinButton", "showOverviewButton", "screenList", "keepHidden"],
"lockscreen": ["position"],
"desktop": ["enabled", "iconSize", "spacingVertical", "textColor"],
"system": ["idle", "ocr"]
Expand Down
2 changes: 1 addition & 1 deletion modules/notch/Notch.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Item {
property int defaultHeight: Config.showBackground ? (screenNotchOpen || hasActiveNotifications ? Math.max(stackContainer.height, 44) : 44) : (screenNotchOpen || hasActiveNotifications ? Math.max(stackContainer.height, 40) : 40)
property int islandHeight: screenNotchOpen || hasActiveNotifications ? Math.max(stackContainer.height, 36) : 36

readonly property string position: Config.notchPosition ?? "top"
property string position: Config.notchPosition ?? "top"

// Corner size calculation for dynamic width (only for default theme)
readonly property int cornerSize: Config.roundness > 0 ? Config.roundness + 4 : 0
Expand Down
9 changes: 6 additions & 3 deletions modules/notch/NotchContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Item {
readonly property bool hasWindows: toplevels.length > 0

// Get the bar position for this screen
readonly property string barPosition: (Config.bar && Config.bar.position !== undefined) ? Config.bar.position : "top"
readonly property string notchPosition: Config.notchPosition !== undefined ? Config.notchPosition : "top"
readonly property string barPosition: Config.barPositionForScreen(screen.name)
readonly property string notchPosition: Config.notchPositionForScreen(screen.name)

// Get the bar panel for this screen to check its state
readonly property var barPanelRef: Visibilities.barPanels[screen.name]
Expand Down Expand Up @@ -153,7 +153,9 @@ Item {
// Default view component - user@host text
Component {
id: defaultViewComponent
DefaultView {}
DefaultView {
screenName: root.screen.name
}
}

// Persistent views to avoid creation lag when opening the notch
Expand Down Expand Up @@ -273,6 +275,7 @@ Item {
id: notchContainer
unifiedEffectActive: root.unifiedEffectActive
parentHovered: root.isMouseOverNotch
position: root.notchPosition
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: root.notchPosition === "top" ? parent.top : undefined
anchors.bottom: root.notchPosition === "bottom" ? parent.bottom : undefined
Expand Down
6 changes: 3 additions & 3 deletions modules/shell/UnifiedShellPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ PanelWindow {

readonly property var compositorMonitor: AxctlService.monitorFor(targetScreen)
readonly property bool hasFullscreenWindow: {
if (!compositorMonitor)
if (!compositorMonitor || !compositorMonitor.activeWorkspace)
return false;

const activeWorkspaceId = compositorMonitor.activeWorkspace.id;
const monId = compositorMonitor.id;

// Check active toplevel first (fast path)
const toplevel = ToplevelManager.activeToplevel;
if (toplevel && toplevel.fullscreen && AxctlService.focusedMonitor.id === monId) {
if (toplevel && toplevel.fullscreen && AxctlService.focusedMonitor && AxctlService.focusedMonitor.id === monId) {
return true;
}

Expand Down Expand Up @@ -264,7 +264,7 @@ PanelWindow {
let margin = (frameOn && !frameWrapped) ? (Config.bar?.frameThickness ?? 6) : 0;
if (unifiedPanel.barEnabled && unifiedPanel.barPosition === "bottom" && unifiedPanel.barPinned) {
margin += unifiedPanel.barTargetHeight + unifiedPanel.barOuterMargin + (unifiedPanel.containBar ? Config.bar.frameThickness : 0);
} else if (unifiedPanel.dockEnabled && dockContent.dockPosition === "bottom" && dockContent.pinned) {
} else if (unifiedPanel.dockEnabled && dockContent.position === "bottom" && dockContent.pinned) {
margin += dockContent.dockHeight;
}
return margin;
Expand Down
4 changes: 4 additions & 0 deletions modules/widgets/dashboard/controls/SettingsIndex.qml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ QtObject {
// Ambxst > Bar
{ label: "Bar", keywords: "panel taskbar top bottom", section: 8, subSection: "bar", subLabel: "Ambxst > Bar", icon: Icons.layout, isIcon: true },
{ label: "Bar Position", keywords: "top bottom left right edge", section: 8, subSection: "bar", subLabel: "Ambxst > Bar", icon: Icons.layout, isIcon: true },
{ label: "Bar Per-Monitor Position", keywords: "screen monitor display edge override", section: 8, subSection: "bar", subLabel: "Ambxst > Bar", icon: Icons.layout, isIcon: true },
{ label: "Launcher Icon", keywords: "logo symbol path", section: 8, subSection: "bar", subLabel: "Ambxst > Bar", icon: Icons.layout, isIcon: true },
{ label: "Launcher Icon Tint", keywords: "color theme", section: 8, subSection: "bar", subLabel: "Ambxst > Bar", icon: Icons.palette, isIcon: true },
{ label: "Launcher Icon Full Tint", keywords: "monochrome color", section: 8, subSection: "bar", subLabel: "Ambxst > Bar", icon: Icons.palette, isIcon: true },
Expand All @@ -168,6 +169,8 @@ QtObject {

// Ambxst > Notch
{ label: "Notch", keywords: "island dynamic island center", section: 8, subSection: "notch", subLabel: "Ambxst > Notch", icon: Icons.layout, isIcon: true },
{ label: "Notch Position", keywords: "top bottom edge", section: 8, subSection: "notch", subLabel: "Ambxst > Notch", icon: Icons.layout, isIcon: true },
{ label: "Notch Per-Monitor Position", keywords: "screen monitor display edge override", section: 8, subSection: "notch", subLabel: "Ambxst > Notch", icon: Icons.layout, isIcon: true },

// Ambxst > Workspaces
{ label: "Workspaces", keywords: "virtual desktop spaces", section: 8, subSection: "workspaces", subLabel: "Ambxst > Workspaces", icon: Icons.squaresFour, isIcon: true },
Expand All @@ -189,6 +192,7 @@ QtObject {
{ label: "Dock Enabled", keywords: "show hide toggle", section: 8, subSection: "dock", subLabel: "Ambxst > Dock", icon: Icons.layout, isIcon: true },
{ label: "Dock Mode", keywords: "default floating integrated style", section: 8, subSection: "dock", subLabel: "Ambxst > Dock", icon: Icons.layout, isIcon: true },
{ label: "Dock Position", keywords: "left bottom right edge", section: 8, subSection: "dock", subLabel: "Ambxst > Dock", icon: Icons.layout, isIcon: true },
{ label: "Dock Per-Monitor Position", keywords: "screen monitor display edge override", section: 8, subSection: "dock", subLabel: "Ambxst > Dock", icon: Icons.layout, isIcon: true },
{ label: "Dock Height", keywords: "size thickness pixels", section: 8, subSection: "dock", subLabel: "Ambxst > Dock", icon: Icons.layout, isIcon: true },
{ label: "Dock Icon Size", keywords: "width height pixels apps", section: 8, subSection: "dock", subLabel: "Ambxst > Dock", icon: Icons.layout, isIcon: true },
{ label: "Dock Spacing", keywords: "gap between icons", section: 8, subSection: "dock", subLabel: "Ambxst > Dock", icon: Icons.layout, isIcon: true },
Expand Down
Loading