mirror of
https://github.com/enso-org/enso.git
synced 2024-12-24 13:31:41 +03:00
Minor fixes (https://github.com/enso-org/ide/pull/1446)
Original commit: 33f73066f3
This commit is contained in:
parent
c3eecdbd55
commit
f9109e6a3f
@ -132,8 +132,7 @@ impl Model {
|
|||||||
let visible_entries = Self::visible_entries(view,self.entries.entry_count());
|
let visible_entries = Self::visible_entries(view,self.entries.entry_count());
|
||||||
let padding_px = self.padding();
|
let padding_px = self.padding();
|
||||||
let padding = 2.0 * padding_px + SHAPE_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);
|
||||||
let padding = Vector2(padding, padding + 2.0*padding_px);
|
|
||||||
let shadow = Vector2(2.0 * SHADOW_PX, 2.0 * SHADOW_PX);
|
let shadow = Vector2(2.0 * SHADOW_PX, 2.0 * SHADOW_PX);
|
||||||
self.entries.set_position_x(-view.size.x / 2.0);
|
self.entries.set_position_x(-view.size.x / 2.0);
|
||||||
self.background.size.set(view.size + padding + shadow);
|
self.background.size.set(view.size + padding + shadow);
|
||||||
|
@ -4,8 +4,10 @@ use crate::prelude::*;
|
|||||||
|
|
||||||
use enso_frp as frp;
|
use enso_frp as frp;
|
||||||
use ensogl::application;
|
use ensogl::application;
|
||||||
use ensogl::application::{Application, shortcut};
|
use ensogl::application::Application;
|
||||||
|
use ensogl::application::shortcut;
|
||||||
use ensogl::display;
|
use ensogl::display;
|
||||||
|
use ensogl::display::shape::StyleWatchFrp;
|
||||||
use ensogl::DEPRECATED_Animation;
|
use ensogl::DEPRECATED_Animation;
|
||||||
use ensogl_text as text;
|
use ensogl_text as text;
|
||||||
|
|
||||||
@ -65,6 +67,7 @@ impl View {
|
|||||||
/// Create Code Editor component.
|
/// Create Code Editor component.
|
||||||
pub fn new(app:&Application) -> Self {
|
pub fn new(app:&Application) -> Self {
|
||||||
let scene = app.display.scene();
|
let scene = app.display.scene();
|
||||||
|
let styles = StyleWatchFrp::new(&app.display.scene().style_sheet);
|
||||||
let frp = Frp::new();
|
let frp = Frp::new();
|
||||||
let network = &frp.network;
|
let network = &frp.network;
|
||||||
let model = app.new_view::<text::Area>();
|
let model = app.new_view::<text::Area>();
|
||||||
@ -104,6 +107,9 @@ impl View {
|
|||||||
Vector2(x,y)
|
Vector2(x,y)
|
||||||
});
|
});
|
||||||
eval position ((pos) model.set_position_xy(*pos));
|
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}
|
Self{model,frp}
|
||||||
|
@ -28,8 +28,8 @@ pub const SEARCHER_WIDTH:f32 = 480.0;
|
|||||||
/// Height of searcher panel in pixels.
|
/// Height of searcher panel in pixels.
|
||||||
///
|
///
|
||||||
/// Because we don't implement clipping yet, the best UX is when searcher height is almost multiple
|
/// Because we don't implement clipping yet, the best UX is when searcher height is almost multiple
|
||||||
/// of entry height.
|
/// of entry height + padding.
|
||||||
pub const SEARCHER_HEIGHT:f32 = 179.5;
|
pub const SEARCHER_HEIGHT:f32 = 184.5;
|
||||||
|
|
||||||
const ACTION_LIST_GAP : f32 = 180.0;
|
const ACTION_LIST_GAP : f32 = 180.0;
|
||||||
const LIST_DOC_GAP : f32 = 15.0;
|
const LIST_DOC_GAP : f32 = 15.0;
|
||||||
|
Loading…
Reference in New Issue
Block a user