mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Ssshh!!! Secret flag to force colorful toolbar even when one project is open
(cherry picked from commit 6fe9ebaf6d5b68edb4c9a5e3d10d698479e46e09) GitOrigin-RevId: 66b4affb93c67eb181baa3a03ef4151e83870ab7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
046c10a5b4
commit
323a96b4ee
@@ -12,6 +12,7 @@ import com.intellij.openapi.project.ProjectManager
|
||||
import com.intellij.openapi.project.ex.ProjectManagerEx
|
||||
import com.intellij.openapi.startup.ProjectActivity
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import com.intellij.openapi.wm.ex.WindowManagerEx
|
||||
import com.intellij.openapi.wm.impl.ProjectFrameHelper
|
||||
import com.intellij.ui.GotItTooltip
|
||||
@@ -50,7 +51,7 @@ class ProjectWindowCustomizerService : Disposable {
|
||||
internal fun update(newValue: Boolean) {
|
||||
if (newValue != ourSettingsValue) {
|
||||
ourSettingsValue = newValue
|
||||
wasGradientPainted = newValue && ProjectManager.getInstance().openProjects.size > 1
|
||||
wasGradientPainted = newValue && conditionToEnable()
|
||||
fireUpdate()
|
||||
}
|
||||
}
|
||||
@@ -71,12 +72,14 @@ class ProjectWindowCustomizerService : Disposable {
|
||||
}
|
||||
|
||||
fun enableIfNeeded() {
|
||||
if (ProjectManagerEx.getOpenProjects().size > 1 && !wasGradientPainted) {
|
||||
if (conditionToEnable() && !wasGradientPainted) {
|
||||
wasGradientPainted = true
|
||||
fireUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
private fun conditionToEnable() = ProjectManagerEx.getOpenProjects().size > 1 || Registry.`is`("ide.colorful.toolbar.force")
|
||||
|
||||
fun addListener(disposable: Disposable, fireFirstTime: Boolean, listener: (Boolean) -> Unit) {
|
||||
if (fireFirstTime) {
|
||||
listener(isActive())
|
||||
@@ -92,6 +95,7 @@ class ProjectWindowCustomizerService : Disposable {
|
||||
}
|
||||
|
||||
fun shouldShowGotIt() = !gotItShown
|
||||
|
||||
private fun recordGotItShown() {
|
||||
gotItShown = true
|
||||
}
|
||||
|
||||
@@ -2337,5 +2337,9 @@ ide.speed.search.allow.custom.location.description=Allow using SpeedSearchSupply
|
||||
ide.log.coroutine.pce=true
|
||||
ide.log.coroutine.pce.description=Log PCEs occurring in coroutines. \
|
||||
These exceptions are treated as failure by coroutine framework, and should be reported as such.
|
||||
|
||||
ide.colorful.toolbar.force=false
|
||||
ide.colorful.toolbar.force.description=Show 'Colorful toolbar' even if there is one project open (works only if the feature is enabled). \
|
||||
Reopen project or restart IDE to apply the setting
|
||||
# please leave this note as last line
|
||||
# TODO please use EP com.intellij.registryKey for plugin/product specific keys
|
||||
|
||||
Reference in New Issue
Block a user