Original commit: 33f73066f3
This commit is contained in:
Adam Obuchowicz 2021-04-07 17:53:06 +02:00 committed by GitHub
parent c3eecdbd55
commit f9109e6a3f
3 changed files with 10 additions and 5 deletions

View File

@ -132,8 +132,7 @@ impl Model {
let visible_entries = Self::visible_entries(view,self.entries.entry_count());
let padding_px = self.padding();
let padding = 2.0 * padding_px + SHAPE_PADDING;
// FIXME: Why this + 2.0*padding_px is needed here? It was added to make bottom padding but should rather not be needed.
let padding = Vector2(padding, padding + 2.0*padding_px);
let padding = Vector2(padding, padding);
let shadow = Vector2(2.0 * SHADOW_PX, 2.0 * SHADOW_PX);
self.entries.set_position_x(-view.size.x / 2.0);
self.background.size.set(view.size + padding + shadow);

View File

@ -4,8 +4,10 @@ use crate::prelude::*;
use enso_frp as frp;
use ensogl::application;
use ensogl::application::{Application, shortcut};
use ensogl::application::Application;
use ensogl::application::shortcut;
use ensogl::display;
use ensogl::display::shape::StyleWatchFrp;
use ensogl::DEPRECATED_Animation;
use ensogl_text as text;
@ -65,6 +67,7 @@ impl View {
/// Create Code Editor component.
pub fn new(app:&Application) -> Self {
let scene = app.display.scene();
let styles = StyleWatchFrp::new(&app.display.scene().style_sheet);
let frp = Frp::new();
let network = &frp.network;
let model = app.new_view::<text::Area>();
@ -104,6 +107,9 @@ impl View {
Vector2(x,y)
});
eval position ((pos) model.set_position_xy(*pos));
let color = styles.get_color(ensogl_theme::code::syntax::base);
eval color ((color) model.set_default_color(color));
}
Self{model,frp}

View File

@ -28,8 +28,8 @@ pub const SEARCHER_WIDTH:f32 = 480.0;
/// Height of searcher panel in pixels.
///
/// Because we don't implement clipping yet, the best UX is when searcher height is almost multiple
/// of entry height.
pub const SEARCHER_HEIGHT:f32 = 179.5;
/// of entry height + padding.
pub const SEARCHER_HEIGHT:f32 = 184.5;
const ACTION_LIST_GAP : f32 = 180.0;
const LIST_DOC_GAP : f32 = 15.0;