Code Monkey home page Code Monkey logo

bevy_cosmic_edit's People

Contributors

bytemunch avatar staffengineer avatar thatvertigo avatar thegrimsey avatar tigregalis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bevy_cosmic_edit's Issues

Set default scale from window scale

Not sure how to get access to the window scale from inside the impl Default for CosmicMetrics block.

Could set the default to something stupid like 0.69696969 and have a system checking if that scale is set on anything, then set the scale to window scale.

Very open to suggestions here

Held keys do not repeat

On other text inputs holding a key will send one input, then wait a time, then repeat inputs for that key with a delay between inputs.

This applies to every input I can find, including paste, backspace, directions, return, delete.

Key repeat respects held modifiers like shift and cmd/ctrl

Might be smarter to implement a separate key repeat system that passes data to the input system, but that will introduce a 1 frame delay between input and action, and text input should be as immediate as possible to feel smooth.

winit has an is_repeat field on KeyEvent, may be able to hook that somehow.

winit has the ability to distinguish repeat keys in 0.29.X-beta, which will obsolete a fix once released and picked up by bevy.

Panic due to cursor being out of bounds

If set_text called with text length smaller than the current buffer cosmic-text panics due to cursor being out of bounds. Panic thrown in let text = self.text.split_off(index); on cosmic-text side.

Steps to reproduce:

  1. Create system that sets text to empty string by modifying CosmicText component.
  2. Type any char (trigger Action::Insert).

Add selection word/paragraph on mouse click

1-mouse-click: place cursor (already implemented by cosmic-text)
2-clicks: select word
3-clicks: select paragraph
(mimic behaviour of google translate text selection on mouse clicking)

Dark theme colors support

    let attrs = AttrsOwned::new(Attrs::new().color(CosmicColor::rgb(255, 255, 255)));
    ...
    background_color: Color::BLACK.into(),

Expected: white font on black background
Actual:
image

Use smaller bundled fallback font

Currently VictorMono is bundled, and has a fair footprint. Ideally the font should be as small as reasonably possible, as it will be included in all builds and downloads.

mode: "auto-height"

Currently text that can't fit into buffer becoming invisible and can be scrolled in buffer. Let's add feature for automatic buffer height adjustment based on content, so all buffer's content is always visible.

image
buffer.width = user_defined_width 
image_width = user_defined_width
image_height = calc_buffer_height (one or more lines), 
all visible (unless max height specified I guess)

Fix auto-height mode word wrapping.

There is left padding for auto-height mode text widget...
there should be right padding too and/or buffer size should be smaller, otherwise:
image

mode: "infinite-line"

ezgif com-video-to-gif (3)

buffer.width = f32::MAX, 
image_width = user_defined_width, 
image_height = calc_buffer_height (one line), 
visible = x_min..x_max = f(user_defined_width, calc_text_width, cursor)
image

Typing a capital letter using the shift key needs doubled backspace to delete

Inputs [SHIFT][A][Backspace] leaves the A, a second backspace removes it.
Inputs [SHIFT][A](unshift)[b] deletes the b and the A only needs one backspace to delete.

Shifting while capslocked has the same effect on lowercase letters.

Caps Lock then backspace deletes correctly.

Seems to happen if the last character typed was shifted.

Simplify UI bundle code

Original comment:
#84 (comment)

Use Sprites for all rendering, have a Node component on "UI" bundles for positioning.

Will simplify the codebase and allow for use of sprite-specific bevy features, such as shaders.

Think I remember reading about UI Sprites somewhere in the bevy repo, will edit with a link if I can find it.

On my machine Sprites look a bit fuzzier than UI Images, this will need to be addressed. Probably a Z positioning thing or something.

Obscured input, like `<input type='password'>` on web

Might be an optional component, replacing every character going in to the buffer with .

Obscured input should not be copy or cuttable, but should accept paste.

Option to turn obscuring off via an event would be desirable, like the eye symbols on the web. This suggests a struct such as pub struct PasswordInput { pub hidden: bool }.

editor.get_text() should return the unobscured string, so the buffer must hold the actual text, only drawing an amount of • equal to the length of the buffer.

Hopefully displaying and holding different values doesn't mess up the click functions.

  • Default font should include the bullet point glyph to work out-of-the-box

Crash in `undo_redo` in `input.rs`

Occasionally, the following line (src/input.rs:583) will crash, as when undo_redo is called, no entities which satisfy editor_q's query are in the World:
let (mut editor, attrs, mut edit_history) = editor_q.get_mut(entity).unwrap();

This can be fixed by replacing .unwrap() with a match statement, essentially exiting the function if the query has no items. This is what I do on my fork, and it doesn't seem to break anything, but I'm not 100% sure.

Sometimes Backspace does not work

On some runs, cannot delete characters in a buffer with backspace.
Some runs it works as expected.

WASM seems to work fine consistently (sample size of 10 refreshes, two builds)

Losing response focus when using spotlight search

Hi,

I recently encountered a bug where when leaving the focus of the app, to open spotlight search on mac, I lose the focus of the response window even after switching back to the app. This does not occur on other platforms, nor when switching between windows.
Thanks in advance!

Allow user to enable/disable line wrapping

max_lines doesn't work properly with long lines since line wrapping. Let's give a plugin user option to disable text wrapping.
The following code disables it:

        let mut buffer = Buffer::new(
            &mut font_system.0,
            Metrics::new(metrics.font_size, metrics.line_height).scale(metrics.scale_factor),
        );
        buffer.set_wrap(&mut font_system.0, cosmic_text::Wrap::None);
        let mut editor = Editor::new(buffer);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.