Skip to content

Commit

Permalink
Fix content gap breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill-grouchnikov committed Feb 2, 2022
1 parent 8435593 commit 7be8ded
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
Expand Up @@ -450,7 +450,7 @@ internal fun getPreferredCommandPopupMenuPanelSize(
}
}

val gap = (presentationModel.contentGap * density.density)
val gap = (presentationModel.contentGap.value * density.density)
var panelWidth = maxButtonWidth * presentationModel.layoutSpec.columnCount +
gap * (presentationModel.layoutSpec.columnCount + 1)
var panelHeight = maxButtonHeight * presentationModel.layoutSpec.visibleRowCount +
Expand Down
Expand Up @@ -38,12 +38,11 @@ sealed class PanelRowFillSpec {
class Fixed(val columnCount: Int) : PanelRowFillSpec()
class Adaptive(val minColumnWidth: Dp) : PanelRowFillSpec()

override fun hashCode() = if (this is Fixed) {
31 + columnCount
} else {
require(this is Adaptive)
62 + minColumnWidth.hashCode()
}
override fun hashCode() =
when (this) {
is Fixed -> 31 + columnCount
is Adaptive -> 62 + minColumnWidth.hashCode()
}

override fun equals(other: Any?) =
(this is Fixed && other is Fixed && this.columnCount == other.columnCount) ||
Expand All @@ -54,12 +53,11 @@ sealed class PanelColumnFillSpec {
class Fixed(val rowCount: Int) : PanelColumnFillSpec()
class Adaptive(val minRowHeight: Dp) : PanelColumnFillSpec()

override fun hashCode() = if (this is Fixed) {
31 + rowCount
} else {
require(this is Adaptive)
62 + minRowHeight.hashCode()
}
override fun hashCode() =
when (this) {
is Fixed -> 31 + rowCount
is Adaptive -> 62 + minRowHeight.hashCode()
}

override fun equals(other: Any?) =
(this is Fixed && other is Fixed && this.rowCount == other.rowCount) ||
Expand Down

0 comments on commit 7be8ded

Please sign in to comment.