Skip to content

Fix recent connections action button #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix: horizontal resize hides the new connection action button
  • Loading branch information
fioan89 committed Jun 29, 2022
commit 3b47a7cd986b81510fab824d2ffa3b4bc172001d
Original file line number Diff line number Diff line change
Expand Up @@ -62,39 +62,36 @@ class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections, Dis
label(CoderGatewayBundle.message("gateway.connector.recentconnections.title")).applyToComponent {
font = JBFont.h3().asBold()
}
panel {
row {
searchBar = cell(SearchTextField(false)).applyToComponent {
minimumSize = Dimension(350, -1)
textEditor.border = JBUI.Borders.empty(2, 5, 2, 0)
addDocumentListener(object : DocumentAdapter() {
override fun textChanged(e: DocumentEvent) {
val toSearchFor = this@applyToComponent.text
val filteredConnections = recentConnectionsService.getAllRecentConnections().filter { it.coderWorkspaceHostname?.toLowerCase()?.contains(toSearchFor) ?: false || it.projectPath?.toLowerCase()?.contains(toSearchFor) ?: false }
updateContentView(filteredConnections.groupBy { it.coderWorkspaceHostname })
}
})
}.component
label("").resizableColumn().horizontalAlign(HorizontalAlign.FILL)
searchBar = cell(SearchTextField(false)).applyToComponent {
minimumSize = Dimension(350, -1)
textEditor.border = JBUI.Borders.empty(2, 5, 2, 0)
addDocumentListener(object : DocumentAdapter() {
override fun textChanged(e: DocumentEvent) {
val toSearchFor = this@applyToComponent.text
val filteredConnections = recentConnectionsService.getAllRecentConnections().filter { it.coderWorkspaceHostname?.toLowerCase()?.contains(toSearchFor) ?: false || it.projectPath?.toLowerCase()?.contains(toSearchFor) ?: false }
updateContentView(filteredConnections.groupBy { it.coderWorkspaceHostname })
}
})
}.component

actionButton(
object : DumbAwareAction(CoderGatewayBundle.message("gateway.connector.recentconnections.new.wizard.button.tooltip"), null, AllIcons.General.Add) {
override fun actionPerformed(e: AnActionEvent) {
actionButton(
object : DumbAwareAction(CoderGatewayBundle.message("gateway.connector.recentconnections.new.wizard.button.tooltip"), null, AllIcons.General.Add) {
override fun actionPerformed(e: AnActionEvent) {
rootPanel.apply {
removeAll()
addToCenter(CoderGatewayConnectorWizardWrapperView {
rootPanel.apply {
removeAll()
addToCenter(CoderGatewayConnectorWizardWrapperView {
rootPanel.apply {
removeAll()
addToCenter(contentPanel)
updateUI()
}
}.component)
addToCenter(contentPanel)
updateUI()
}
}
},
).gap(RightGap.SMALL)
}
}.horizontalAlign(HorizontalAlign.RIGHT)
}.component)
updateUI()
}
}
},
).gap(RightGap.SMALL)
}.bottomGap(BottomGap.MEDIUM)
separator(background = WelcomeScreenUIManager.getSeparatorColor())
row {
Expand Down