add opacity settings for obscured windows

This commit is contained in:
Peter Fajdiga
2023-12-16 12:10:26 +01:00
parent 25a9efc8e4
commit e98ce18105
7 changed files with 37 additions and 0 deletions

View File

@@ -183,6 +183,27 @@
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_offScreenOpacity">
<property name="text">
<string>Obscured window opacity:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QSpinBox" name="kcfg_offScreenOpacity">
<property name="suffix">
<string> %</string>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
</layout>
</widget>

View File

@@ -7,6 +7,7 @@ type Config = {
gapsInnerVertical: number,
overscroll: number,
manualScrollStep: number,
offScreenOpacity: number,
untileOnDrag: boolean,
stackColumnsByDefault: boolean,
resizeNeighborColumn: boolean,

View File

@@ -92,6 +92,11 @@ const configDef = [
"type": "UInt",
"default": 200
},
{
"name": "offScreenOpacity",
"type": "UInt",
"default": 100
},
{
"name": "untileOnDrag",
"type": "Bool",

View File

@@ -47,6 +47,7 @@ interface KwinClient {
readonly dock: boolean;
readonly normalWindow: boolean;
readonly managed: boolean;
opacity: number;
// Read-write Properties
fullScreen: boolean;

View File

@@ -181,6 +181,13 @@ class Column {
}
public arrange(x: number) {
if (this.grid.config.offScreenOpacity < 1.0) {
const opacity = this.isVisible(this.grid.desktop.getCurrentVisibleRange(), true) ? 100 : this.grid.config.offScreenOpacity;
for (const window of this.windows.iterator()) {
window.client.kwinClient.opacity = opacity;
}
}
if (this.stacked && this.windows.length() >= 2 && this.canStack()) {
this.arrangeStacked(x);
return;

View File

@@ -1,6 +1,7 @@
type LayoutConfig = {
gapsInnerHorizontal: number,
gapsInnerVertical: number,
offScreenOpacity: number,
stackColumnsByDefault: boolean,
resizeNeighborColumn: boolean,
reMaximize: boolean,

View File

@@ -24,6 +24,7 @@ class World {
const layoutConfig = {
gapsInnerHorizontal: config.gapsInnerHorizontal,
gapsInnerVertical: config.gapsInnerVertical,
offScreenOpacity: config.offScreenOpacity / 100.0,
stackColumnsByDefault: config.stackColumnsByDefault,
resizeNeighborColumn: config.resizeNeighborColumn,
reMaximize: config.reMaximize,