|
@@ -454,6 +454,7 @@ trait ChartView {
|
|
|
pane: pane_grid::Pane,
|
|
pane: pane_grid::Pane,
|
|
|
state: &'a PaneState,
|
|
state: &'a PaneState,
|
|
|
indicators: &'a [I],
|
|
indicators: &'a [I],
|
|
|
|
|
+ notifications: Option<&'a Vec<screen::Notification>>,
|
|
|
) -> Element<Message>;
|
|
) -> Element<Message>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -463,13 +464,26 @@ fn handle_chart_view<'a, F>(
|
|
|
pane: pane_grid::Pane,
|
|
pane: pane_grid::Pane,
|
|
|
indicators: &'a [impl Indicator],
|
|
indicators: &'a [impl Indicator],
|
|
|
settings_view: F,
|
|
settings_view: F,
|
|
|
|
|
+ notifications: Option<&'a Vec<screen::Notification>>,
|
|
|
) -> Element<'a, Message>
|
|
) -> Element<'a, Message>
|
|
|
where
|
|
where
|
|
|
F: FnOnce() -> Element<'a, Message>,
|
|
F: FnOnce() -> Element<'a, Message>,
|
|
|
{
|
|
{
|
|
|
|
|
+ let base = if let Some(notifications) = notifications {
|
|
|
|
|
+ pane_notification(
|
|
|
|
|
+ underlay,
|
|
|
|
|
+ notification_modals(
|
|
|
|
|
+ pane,
|
|
|
|
|
+ notifications,
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ } else {
|
|
|
|
|
+ underlay.into()
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
match state.modal {
|
|
match state.modal {
|
|
|
PaneModal::StreamModifier => pane_menu(
|
|
PaneModal::StreamModifier => pane_menu(
|
|
|
- underlay,
|
|
|
|
|
|
|
+ base,
|
|
|
stream_modifier_view(
|
|
stream_modifier_view(
|
|
|
pane,
|
|
pane,
|
|
|
state.settings.tick_multiply,
|
|
state.settings.tick_multiply,
|
|
@@ -480,7 +494,7 @@ where
|
|
|
Alignment::Start,
|
|
Alignment::Start,
|
|
|
),
|
|
),
|
|
|
PaneModal::Indicators => pane_menu(
|
|
PaneModal::Indicators => pane_menu(
|
|
|
- underlay,
|
|
|
|
|
|
|
+ base,
|
|
|
indicators_view(
|
|
indicators_view(
|
|
|
pane,
|
|
pane,
|
|
|
state.settings.ticker_info.map(|info| info.market_type),
|
|
state.settings.ticker_info.map(|info| info.market_type),
|
|
@@ -492,14 +506,14 @@ where
|
|
|
),
|
|
),
|
|
|
PaneModal::Settings => {
|
|
PaneModal::Settings => {
|
|
|
pane_menu(
|
|
pane_menu(
|
|
|
- underlay,
|
|
|
|
|
|
|
+ base,
|
|
|
settings_view(),
|
|
settings_view(),
|
|
|
Message::ToggleModal(pane, PaneModal::None),
|
|
Message::ToggleModal(pane, PaneModal::None),
|
|
|
padding::right(12).left(12),
|
|
padding::right(12).left(12),
|
|
|
Alignment::End,
|
|
Alignment::End,
|
|
|
)
|
|
)
|
|
|
},
|
|
},
|
|
|
- _ => underlay,
|
|
|
|
|
|
|
+ _ => base,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -509,6 +523,7 @@ impl ChartView for HeatmapChart {
|
|
|
pane: pane_grid::Pane,
|
|
pane: pane_grid::Pane,
|
|
|
state: &'a PaneState,
|
|
state: &'a PaneState,
|
|
|
indicators: &'a [I],
|
|
indicators: &'a [I],
|
|
|
|
|
+ notifications: Option<&'a Vec<screen::Notification>>,
|
|
|
) -> Element<Message> {
|
|
) -> Element<Message> {
|
|
|
let underlay = self
|
|
let underlay = self
|
|
|
.view(indicators, state.settings.ticker_info)
|
|
.view(indicators, state.settings.ticker_info)
|
|
@@ -525,6 +540,7 @@ impl ChartView for HeatmapChart {
|
|
|
pane,
|
|
pane,
|
|
|
indicators,
|
|
indicators,
|
|
|
settings_view,
|
|
settings_view,
|
|
|
|
|
+ notifications,
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -535,6 +551,7 @@ impl ChartView for FootprintChart {
|
|
|
pane: pane_grid::Pane,
|
|
pane: pane_grid::Pane,
|
|
|
state: &'a PaneState,
|
|
state: &'a PaneState,
|
|
|
indicators: &'a [I],
|
|
indicators: &'a [I],
|
|
|
|
|
+ notifications: Option<&'a Vec<screen::Notification>>,
|
|
|
) -> Element<Message> {
|
|
) -> Element<Message> {
|
|
|
let underlay = self
|
|
let underlay = self
|
|
|
.view(indicators, state.settings.ticker_info)
|
|
.view(indicators, state.settings.ticker_info)
|
|
@@ -550,6 +567,7 @@ impl ChartView for FootprintChart {
|
|
|
pane,
|
|
pane,
|
|
|
indicators,
|
|
indicators,
|
|
|
settings_view,
|
|
settings_view,
|
|
|
|
|
+ notifications,
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -560,6 +578,7 @@ impl ChartView for CandlestickChart {
|
|
|
pane: pane_grid::Pane,
|
|
pane: pane_grid::Pane,
|
|
|
state: &'a PaneState,
|
|
state: &'a PaneState,
|
|
|
indicators: &'a [I],
|
|
indicators: &'a [I],
|
|
|
|
|
+ notifications: Option<&'a Vec<screen::Notification>>,
|
|
|
) -> Element<Message> {
|
|
) -> Element<Message> {
|
|
|
let underlay = self
|
|
let underlay = self
|
|
|
.view(indicators, state.settings.ticker_info)
|
|
.view(indicators, state.settings.ticker_info)
|
|
@@ -575,6 +594,7 @@ impl ChartView for CandlestickChart {
|
|
|
pane,
|
|
pane,
|
|
|
indicators,
|
|
indicators,
|
|
|
settings_view,
|
|
settings_view,
|
|
|
|
|
+ notifications,
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -866,19 +886,9 @@ fn view_chart<'a, C: ChartView, I: Indicator>(
|
|
|
notifications: Option<&'a Vec<screen::Notification>>,
|
|
notifications: Option<&'a Vec<screen::Notification>>,
|
|
|
indicators: &'a [I],
|
|
indicators: &'a [I],
|
|
|
) -> Element<'a, Message> {
|
|
) -> Element<'a, Message> {
|
|
|
- let base = center(content.view(pane, state, indicators));
|
|
|
|
|
-
|
|
|
|
|
- if let Some(notifications) = notifications {
|
|
|
|
|
- pane_notification(
|
|
|
|
|
- base,
|
|
|
|
|
- notification_modals(
|
|
|
|
|
- pane,
|
|
|
|
|
- notifications,
|
|
|
|
|
- )
|
|
|
|
|
- )
|
|
|
|
|
- } else {
|
|
|
|
|
- base.into()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ center(
|
|
|
|
|
+ content.view(pane, state, indicators, notifications)
|
|
|
|
|
+ ).into()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Pane controls, title bar
|
|
// Pane controls, title bar
|