mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Fix window corner radius override
This commit is contained in:
@@ -269,12 +269,18 @@ public class QuickStepContract {
|
||||
return mode == NAV_BAR_MODE_3BUTTON;
|
||||
}
|
||||
|
||||
public static boolean sHasCustomCornerRadius = false;
|
||||
public static float sCustomCornerRadius = 0f;
|
||||
|
||||
/**
|
||||
* Corner radius that should be used on windows in order to cover the display.
|
||||
* These values are expressed in pixels because they should not respect display or font
|
||||
* scaling, this means that we don't have to reload them on config changes.
|
||||
*/
|
||||
public static float getWindowCornerRadius(Resources resources) {
|
||||
if (sHasCustomCornerRadius) {
|
||||
return sCustomCornerRadius;
|
||||
}
|
||||
return ScreenDecorationsUtils.getWindowCornerRadius(resources);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ import com.android.launcher3.uioverrides.QuickstepLauncher
|
||||
import com.android.launcher3.uioverrides.states.OverviewState
|
||||
import com.android.launcher3.util.Themes
|
||||
import com.android.systemui.plugins.shared.LauncherOverlayManager
|
||||
import com.android.systemui.shared.system.QuickStepContract
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@@ -98,6 +99,12 @@ class LawnchairLauncher : QuickstepLauncher(), LifecycleOwner,
|
||||
}
|
||||
})
|
||||
}
|
||||
prefs.overrideWindowCornerRadius.subscribeValues(this) {
|
||||
QuickStepContract.sHasCustomCornerRadius = it
|
||||
}
|
||||
prefs.windowCornerRadius.subscribeValues(this) {
|
||||
QuickStepContract.sCustomCornerRadius = it.toFloat()
|
||||
}
|
||||
}
|
||||
|
||||
override fun setupViews() {
|
||||
|
||||
Reference in New Issue
Block a user