Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection colour of components with custom view models #1944

Open
kasyrm opened this issue Apr 18, 2024 · 2 comments
Open

Selection colour of components with custom view models #1944

kasyrm opened this issue Apr 18, 2024 · 2 comments
Labels
type_enhancement New feature or request

Comments

@kasyrm
Copy link

kasyrm commented Apr 18, 2024

Fist of all super editor is an amazing tool, thanks for creating it 馃殌

User Behavior
I would like to be able to provide a selection colour for my custom components. For the view models provided by package the selection colour seems to be assigned inside a private function _applySelection in SingleColumnLayoutSelectionStyler, but other components do not change colour when selected. (I also noticed horizontal ruler selection colour differs from the rest. Would be great to be able to override it)

Feature Value
It provides proper feedback to user that the element is selected.

Additional context
If this is achievable already in a different way please let me know 馃檹

@kasyrm kasyrm added the type_enhancement New feature or request label Apr 18, 2024
@matthew-carroll
Copy link
Contributor

To make sure that we understand exactly what you're requesting, can you provide a specific UI goal that you're trying to achieve, and let us know what you've tried, and where you're getting stuck?

I understand there's a general desire for selection control, but it would be more effective to work from a specific goal.

@kasyrm
Copy link
Author

kasyrm commented May 23, 2024

I would like for the component to appear selected.
In my button component I added a SelectableBox that accepts selection and selection color. Selection information is provided from view model mirroring for example the HorizontalRulerComponent. From what I found selection is assigned in SingleColumnLayoutSelectionStyler but only to 3 particular ViewModels (Text, Image and HorizotalRuler). I would like there to be a way to pass the information also to custom ViewModels.

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Positioned.fill(
          child: SelectableBox(
            selection: selection,
            selectionColor: selectionColor,
            child: BoxComponent(key: componentKey, child: Container()),
          ),
        ),
        _buildButton(),
      ],
    );
  }
Button component that is selected but does not appear selected

Button component that is selected but does not appear selected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type_enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants