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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spinboxes are over sized #161

Open
AlexB67 opened this issue Dec 30, 2021 · 5 comments
Open

Spinboxes are over sized #161

AlexB67 opened this issue Dec 30, 2021 · 5 comments

Comments

@AlexB67
Copy link

AlexB67 commented Dec 30, 2021

Hello,

As can be seen in your demo or other apps using adwaita-qt you will see that spinboxes look rather way too big. Compared with real adwaita and kvantum gnome where spinbox sizes appears as they should, you will see a stark difference in adwaita-qt and the result looks rather ugly in adwaita-qt IMO.

I experimented a bit with and came up with the following improved look (as it should be IMO).

spinboxes-corrected

Spinboxes now have the same height as other surrounding buttons, which is how GTK and kvantum gnome behave too.

I made the simple change, the last line for height, but could do both as in the screenshot where width was reduced a bit too much

`
QSize Style::spinBoxSizeFromContents(const QStyleOption *option, const QSize &contentsSize, const QWidget *widget) const

// code
// only height, width could do with a little shrinkage too IMO
size.setHeight(int(Metrics::SpinBox_MinHeight));
// code
return size;
}
`

Not sure why the extra padding logic was needed, but that's for you to decide if there could be potential knock ons. At least it now looks about normal/right to me.

Cheers.

@grulja
Copy link
Collaborator

grulja commented Jan 3, 2022

Hi, can you open a merge request for this?

@AlexB67
Copy link
Author

AlexB67 commented Jan 3, 2022

Hi, can you open a merge request for this?

Sure, leave it with me and I'll double check it is okay (i.e no knock ons as far as I can tell).

@AlexB67
Copy link
Author

AlexB67 commented Jan 3, 2022

Okay, I'll do a PR later. While I was at it I observed that sliders have black tick marks using the dark variant, making them barely visible, which is obviously a bug.

I put something in place for that too. The amended spin boxes and sliders now look like so. Even small changes can make a big difference, but it looks much improved to me IMO, or perhaps I am very picky :)

I'll let you decide if the code changes are acceptable, not being familiar with the code base and all, but if I got carried way i can see some more changes coming to make it look more like the current gtk4 style, which is flatter these days, for example combos, buttons etc.

afwaita-improved

@AlexB67
Copy link
Author

AlexB67 commented Jan 3, 2022

Hi,

I created a PR. You will notice in your demo the spinbox height is now snow lightly less than surrounding widgets, but it's much better IMO.

The thing is, other widget use the same logic I removed from the spinbox height, so as it stands without more extensive changes a small discrepancy will remain. I am not too bothered by it.

In my own test case it looks much improved (Compare the spinner with the combo below, close to spot on),

spinners_in_action

Cheers

@AlexB67
Copy link
Author

AlexB67 commented Jan 4, 2022

Hi again,

I threw in a little extra. To me it's a massive uplift to make things more gtk4 like. I made the bevel around buttons/combos etc optional, So now they look very gtk4 like i.e flat and (IMO the unpleasant bevel 3D effect) is now gone by default, it was a minimal change in renderFrame where I added a new option without throwing away code. changed one line in the dark stylesheet, not sure if the colour is 100% correct, judged by eye. Need to find it somewhere.

Well, I'll leave it to you to incorporate should you wish,I'll be keeping it :)

improved-button-style

Cheers, I need to stop this, gets addictive as I learn more about the code base. :D

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

No branches or pull requests

2 participants