From f9109e6a3f6b2195f1fbde7bd99648b4992cc0e2 Mon Sep 17 00:00:00 2001 From: Adam Obuchowicz Date: Wed, 7 Apr 2021 17:53:06 +0200 Subject: [PATCH] Minor fixes (https://github.com/enso-org/ide/pull/1446) Original commit: https://github.com/enso-org/ide/commit/33f73066f3fe5ba78510ac8fb51369d01d6ec0fb --- gui/src/rust/ensogl/lib/components/src/list_view.rs | 3 +-- gui/src/rust/ide/view/src/code_editor.rs | 8 +++++++- gui/src/rust/ide/view/src/searcher.rs | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gui/src/rust/ensogl/lib/components/src/list_view.rs b/gui/src/rust/ensogl/lib/components/src/list_view.rs index 0b6949cd31..1c64a501e3 100644 --- a/gui/src/rust/ensogl/lib/components/src/list_view.rs +++ b/gui/src/rust/ensogl/lib/components/src/list_view.rs @@ -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); diff --git a/gui/src/rust/ide/view/src/code_editor.rs b/gui/src/rust/ide/view/src/code_editor.rs index 8a90a62091..b02ac8e1aa 100644 --- a/gui/src/rust/ide/view/src/code_editor.rs +++ b/gui/src/rust/ide/view/src/code_editor.rs @@ -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::(); @@ -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} diff --git a/gui/src/rust/ide/view/src/searcher.rs b/gui/src/rust/ide/view/src/searcher.rs index 056153ca6e..4597b6a4d7 100644 --- a/gui/src/rust/ide/view/src/searcher.rs +++ b/gui/src/rust/ide/view/src/searcher.rs @@ -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;