Skip to content

Conversation

@stefonarch
Copy link
Contributor

immagine

@stefonarch
Copy link
Contributor Author

stefonarch commented Dec 16, 2025

I noticed that without using QLabel the order is reverted, the checkbox comes before the text. Should they be added for consistency?

Noticed only now that

         <decoration>server</decoration>
             <gap>0</gap>

could go well here too.

@johanmalm
Copy link
Member

Thanks.

Thoughts:

  1. It feels like we ought to settle on a policy for
    a. What type of layout we use. I think I prefer QFormLayout
    b. Use of QGroupBox to group similar settings together
    c. Do we use a QLabel on the left and associated QWidget on the right (as most of it is); or do we organise it some other way like QLabel on top and QWidget below (which I think is more modern on webpages, etc).
  2. For the new appearance settings, we ought to be quite thoughtful about how the settings are organised. For example, it doesn't feel that obvious what "Keep Border" means.
  3. Consider moving "Keep Border" to behaviour.
  4. Consider creating a tristate QComboBox for DropShadows ("Disabled", "Enabled except on tiled windows", "Enabled on all windows".

I don't know much about UI design, but feel it's worth pondering this before merging.

@stefonarch
Copy link
Contributor Author

stefonarch commented Dec 17, 2025

I'm quite a newbie with this too, but we can ask @tsujan for advice I think.

1.a: I've no concrete idea, some do not have it afaik and here I used a grid layout. What is needed is QscrollArea but not everywhere.
1.c: Not sure, isn't it a waste of space? And checkboxes with an extra label are a lot more work I see, in LXQt we have them without afaik everywhere.

3: I tried to made a scrollable .ui file for all which could be inserted in behavior.cpp:

immagine
  1. Good idea, will try, and add also "Gap" spinbox and "Decoration" combobox.

@stefonarch
Copy link
Contributor Author

immagine

The combo would take much space in this way, not sure if my first attempt is cleaner with just 2 checkboxes.

@tsujan
Copy link

tsujan commented Dec 17, 2025

checkboxes with an extra label are a lot more work I see

QCheckBox inherits QAbstractButton, which can have text and icon. Having a QCheckBox with no text and then adding a QLabel to it feels a little weird to me ;) It isn't usual, but it's not wrong either.

As for layouts, QFormLayout is a good choice when you have only two widgets in each row (e.g., a label plus another widget).

With more than two widgets is some rows, QGridLayout can come in handy. It has more options, especially "spanning" and "column stretch". QHBoxLayout can also be used inside it.

As a side note, there's also something that most users of Qt Designer aren't aware of, namely, the order of items inside the ui file. Designer doesn't sort the items in its created ui file as it shows them, especially with QGridLayout. As a result, keyboard-only users may have a hard time when using the Tab key to focus the next widget: the focused widget becomes unpredictable. Personally, I prefer to sort the items manually, by editing the ui file directly, although it's a boring job.

@tsujan
Copy link

tsujan commented Dec 17, 2025

The combo would take much space in this way

The minimum width of a combo-box is calculated (by Qt) based on its longest text. Apart from that, it can be just a matter of alignment.

@johanmalm
Copy link
Member

johanmalm commented Dec 17, 2025

Thanks both.

So, would it make sense to organize as shown below within each stack:

Scroll Area
|
+--- Vertical Layout
     |
     +--- Group Box
     |    |
     |    +--- Grid Layout (or Form Layout if it's a simple one)
     |         |
     |         +--- The widgets
     |
     +--- Group Box
          |
          +--- etc...

I tried to made a scrollable .ui file for all which could be inserted in behavior.cpp

Great. So, does help the dialog stay at 640x480 and just support the content of the behaviour page to scroll up/down?

The combo would take much space in this way, not sure if my first attempt is cleaner with just 2 checkboxes.

I don't really mind. It was just a suggestion.

Having a QCheckBox with no text and then adding a QLabel to it feels a little weird to me ;) It isn't usual, but it's not wrong either.

Makes sense. Yes, let's just use the QCheckBox with text then.

Regarding the QFormLayout vs QGridLayout - If we organise the content in Group Boxes, maybe we could just either depending on what widgets we add.

As a side note, there's also something that most users of Qt Designer aren't aware of, namely, the order of items inside the ui file. Designer doesn't sort the items in its created ui file as it shows them, especially with QGridLayout. As a result, keyboard-only users may have a hard time when using the Tab key to focus the next widget: the focused widget becomes unpredictable. Personally, I prefer to sort the items manually, by editing the ui file directly, although it's a boring job.

Thanks for pointing this out. I notice it now that you've mentioned it. Agree, it's nice to keep this tidy.

@stefonarch
Copy link
Contributor Author

stefonarch commented Dec 17, 2025

Great. So, does help the dialog stay at 640x480 and just support the content of the behaviour page to scroll up/down?

behavior.mp4

The size depends on the font: with 15px I get a ~1000px width window and it looks that the fixed mouse page determinate this Using 9px font similar: I get a really small window but again the mouse tab is as full as in the video here.

Tsujan made me remove all fixed widths and heights from my app, saying that it will cause only trouble later with languages which use long wordings for example (horizontal scrollbars?).

Regarding the QFormLayout vs QGridLayout - If we organise the content in Group Boxes, maybe we could just either depending on what widgets we add.

Not sure what is really needed. This mockup of the behavior tab has:

immagine

@johanmalm
Copy link
Member

^ I like the look of that. 😄

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants