Skip to content

Commit

Permalink
Fix Jewel and Compose dependencies, align code to jewel 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
fscarponi authored and lamba92 committed Jan 11, 2024
1 parent 481ff4e commit 2420163
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ val tooling: Configuration by configurations.creating {
}

dependencies {
implementation(compose.desktop.linux_arm64)
implementation(compose.desktop.linux_x64)
implementation(compose.desktop.macos_arm64)
implementation(compose.desktop.macos_x64)
implementation(compose.desktop.windows_x64)
implementation(packageSearchCatalog.jewel.bridge.ij233)
implementation(packageSearchCatalog.kotlinx.serialization.core)
implementation(packageSearchCatalog.compose.desktop.components.splitpane){
exclude(group = "org.jetbrains.compose.runtime")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ internal fun PackageSearchTabStyle(): TabStyle {
underlineThickness = current.metrics.underlineThickness,
tabPadding = current.metrics.tabPadding,
tabHeight = PackageSearchMetrics.searchBarHeight,
tabContentSpacing = 0.dp,
closeContentGap = current.metrics.closeContentGap,
),
icons = current.icons,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.jetbrains.packagesearch.plugin.ui.model.infopanel.InfoPanelContent
import com.jetbrains.packagesearch.plugin.ui.model.infopanel.InfoPanelViewModel
import com.jetbrains.packagesearch.plugin.ui.model.packageslist.PackageListItemEvent
import com.jetbrains.packagesearch.plugin.ui.viewModel
import org.jetbrains.jewel.ui.component.SimpleTabContent
import org.jetbrains.jewel.ui.component.TabData
import org.jetbrains.jewel.ui.component.TabStrip
import org.jetbrains.jewel.ui.component.VerticalScrollbar
Expand All @@ -42,12 +43,12 @@ fun PackageSearchInfoPanel(
else -> Column(modifier = Modifier.fillMaxSize()) {
TabStrip(
modifier = Modifier.fillMaxWidth(),
tabs = tabs.map {
tabs = tabs.map { infoPanelContent ->
TabData.Default(
selected = activeTabTitle == it.tabTitle,
label = it.tabTitle,
selected = activeTabTitle == infoPanelContent.tabTitle,
content = { SimpleTabContent(label = infoPanelContent.tabTitle, state = it) },
closable = false,
onClick = { viewModel.setActiveTabTitle(it.tabTitle) },
onClick = { viewModel.setActiveTabTitle(infoPanelContent.tabTitle) },
)
}
)
Expand All @@ -70,6 +71,7 @@ fun PackageSearchInfoPanel(
HeaderAttributesTab(content = activeTab, scrollState = viewModel.scrollState)

}

is InfoPanelContent.Attributes.FromSearch -> {
HeaderAttributesTab(content = activeTab, scrollState = viewModel.scrollState)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fun PackageSearchModulesTree(
onExpandAll = viewModel::expandAll,
onCollapseAll = {
val rootIds = tree.roots.map { it.id }.toSet()
viewModel.treeState.selectedKeys = (viewModel.treeState.selectedKeys intersect rootIds).toList()
viewModel.treeState.selectedKeys = viewModel.treeState.selectedKeys intersect rootIds
viewModel.collapseAll()
},
)
Expand All @@ -74,7 +74,7 @@ fun PackageSearchModulesTree(
viewModel.treeState.selectedKeys = tree.walkBreadthFirst()
.take(1)
.map { it.data.id }
.toList()
.toSet()
}
}
Box {
Expand Down

0 comments on commit 2420163

Please sign in to comment.