From ca9d9f0d9219c9922ff6caa6552f24d50aebb57b Mon Sep 17 00:00:00 2001 From: Daniil Tsaryov Date: Tue, 9 Jun 2020 23:34:20 +0300 Subject: [PATCH] Use JB popup for remote field in git pull dialog IDEA-242994 GitOrigin-RevId: 237bdd9ef9a76966293d473a2ff588275eda44cb --- plugins/git4idea/resources/messages/GitBundle.properties | 1 + plugins/git4idea/src/git4idea/pull/GitPullDialog.kt | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/git4idea/resources/messages/GitBundle.properties b/plugins/git4idea/resources/messages/GitBundle.properties index 63bbae308fa4..cc33030a0260 100644 --- a/plugins/git4idea/resources/messages/GitBundle.properties +++ b/plugins/git4idea/resources/messages/GitBundle.properties @@ -116,6 +116,7 @@ pulling.title=Pulling changes from {0} pull.branch.not.selected.error=The branch to pull from should be selected. pull.branch.no.matching.error=There is no matching branch. pull.branch.nothing.to.pull=No branches +pull.branch.no.matching.remotes=No remotes pull.options.modify=Modify options pull.option.remove=Remove option pull.option.ff.only=Merge only if it can be fast-forwarded diff --git a/plugins/git4idea/src/git4idea/pull/GitPullDialog.kt b/plugins/git4idea/src/git4idea/pull/GitPullDialog.kt index c9cd6e1a7be4..a823cfc954f6 100644 --- a/plugins/git4idea/src/git4idea/pull/GitPullDialog.kt +++ b/plugins/git4idea/src/git4idea/pull/GitPullDialog.kt @@ -303,9 +303,12 @@ class GitPullDialog(private val project: Project, } private fun createRemoteField() = ComboBox(MutableCollectionComboBoxModel()).apply { + isSwingPopup = false renderer = SimpleListCellRenderer.create(GitBundle.message("util.remote.renderer.none")) { it.name } val bw = DarculaUIUtil.BW.get() - ui = FlatComboBoxUI(outerInsets = Insets(bw, 0, bw, 0)) + ui = FlatComboBoxUI( + outerInsets = Insets(bw, 0, bw, 0), + popupEmptyText = GitBundle.message("pull.branch.no.matching.remotes")) item = getCurrentOrDefaultRemote(getRepository())