Skip to content

Label and SpinBox widgets do not align #506

Open

Description

@occoder

I tried to apply style="text-align: right; vertical-align: middle" to both Label and SpinBox objects that are arranged side by side with the same height setting. But it seems the "vertical-align: middle" does not have any effect. These two objects always misaligned vertically even within the same HBox. Why does it work this way?

Activity

  1. dddomodossola commented on Dec 9, 2022

    @dddomodossola
    Collaborator

    Hello, can you please send me an image and a simple example script? I will try to fix it

  2. occoder commented on Dec 11, 2022

    @occoder
    Author

    Hi @dddomodossola , thanks for your timely feedback.
    The relevant code snippet looks like

    self.lbl_start = gui.Label("Start: ", width=80, height=30, style="text-align: right; vertical-align: middle")
    self.spin_start = gui.SpinBox(self.start, LL, UL, STEP, width=50, height=30, style="margin-left: 10px; vertical-align: middle")
    hbox = gui.HBox(width=1200, height=100, style="position: relative; left: 20px; top: 20px; justify-content: left")
    hbox.append({"lbl_start": self.lbl_start, "spin_start": self.spin_start})
    

    The UI effect looks like
    Brave
    You can see that vertically they are misaligned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions