Show the Arena champ select in the banner (#85)
CI / core (pull_request) Successful in 1m35s
CI / core (pull_request) Successful in 1m35s
This commit is contained in:
1 parent
411d139a75
commit
d74da1bee1
6 files changed
+540
-211
No files matched your search
@@ -149,7 +149,7 @@ impl CardGrid {
|
||||
}
|
||||
|
||||
/// A grid that is as tall as its rows and builds them all. It has the home grid's cards and
|
||||
/// metrics, and is not meant to be a cached view: its height depends on its content.
|
||||
/// metrics. The parent uses the same row height to lay out the cached hand.
|
||||
pub fn fit_content() -> CardGrid {
|
||||
CardGrid {
|
||||
fit_content: true,
|
||||
@@ -157,6 +157,12 @@ impl CardGrid {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn hand_height(&self, window_width: Pixels) -> Option<Pixels> {
|
||||
let metrics = Metrics::of(window_width);
|
||||
let rows = self.shown.len().div_ceil(metrics.columns);
|
||||
(rows > 0).then(|| px(metrics.row_height() * rows as f32))
|
||||
}
|
||||
|
||||
/// Replaces the cards; the grid is drawn again only when they differ (reloads keep coming
|
||||
/// during an import). `set_shown` follows, as the indices belong to the cards.
|
||||
pub fn set_cards(&mut self, cards: Rc<[Card]>, cx: &mut Context<Self>) {
|
||||
|
||||
Reference in new issue
Block a user