MCPcopy
hub / github.com/paperwm/PaperWM / updateWindowPositionBar

Method updateWindowPositionBar

tiling.js:1739–1769  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1737 }
1738
1739 updateWindowPositionBar() {
1740 // if pref show-window-position-bar, exit
1741 if (!this.showPositionBar) {
1742 return;
1743 }
1744
1745 // show space duplicate elements if not primary monitor
1746 if (!this.hasTopBar) {
1747 Utils.actor_raise(this.workspaceIndicator);
1748 this.workspaceLabel.show();
1749 }
1750
1751 // number of columns (a column have one or more windows)
1752 let cols = this.length;
1753 if (cols <= 1) {
1754 this.windowPositionBar.hide();
1755 return;
1756 } else {
1757 this.windowPositionBar.show();
1758 }
1759
1760 let width = this.monitor.width;
1761 this.windowPositionBarBackdrop.width = width;
1762 let segments = width / cols;
1763 this.windowPositionBar.width = segments;
1764 this.windowPositionBar.height = Topbar.panelBox.height;
1765
1766 // index of currently selected window
1767 let windex = this.indexOf(this.selectedWindow);
1768 this.windowPositionBar.x = windex * segments;
1769 }
1770
1771 /**
1772 * A space contains several elements that are duplicated (in the topbar) so that

Callers 2

updateSelectionFunction · 0.80

Calls 3

indexOfMethod · 0.95
showMethod · 0.45
hideMethod · 0.45

Tested by

no test coverage detected