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

always try to show 4 buttons in toolbar #3184

Merged
merged 2 commits into from
Mar 27, 2024
Merged

always try to show 4 buttons in toolbar #3184

merged 2 commits into from
Mar 27, 2024

Conversation

PeterPetrik
Copy link
Contributor

@PeterPetrik PeterPetrik commented Mar 27, 2024

if screen size is >= 240px 4 buttons will be shown now (I hope there are no smaller mobile phones :) )

toolbarbuttons.mov

Copy link

Pull Request Test Coverage Report for Build 8447778046

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 60.103%

Files with Coverage Reduction New Missed Lines %
input/app/projectsmodel.cpp 1 65.75%
input/core/merginuserinfo.cpp 3 72.99%
Totals Coverage Status
Change from base Build 8438223473: -0.02%
Covered Lines: 7558
Relevant Lines: 12575

💛 - Coveralls

app/qml/components/MMToolbar.qml Outdated Show resolved Hide resolved
Comment on lines +151 to +157
if (maxButtonsInToolbar < internal.minimumToolbarButtonsInMainToolbar) {
maxButtonsInToolbar = Math.floor( toolbar.width / internal.minimumToolbarButtonWidth )
if (maxButtonsInToolbar > internal.minimumToolbarButtonsInMainToolbar) {
// we do not want to show more buttons than minimum even they would fit
maxButtonsInToolbar = internal.minimumToolbarButtonsInMainToolbar
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about something like this - would that work? 🤔

Suggested change
if (maxButtonsInToolbar < internal.minimumToolbarButtonsInMainToolbar) {
maxButtonsInToolbar = Math.floor( toolbar.width / internal.minimumToolbarButtonWidth )
if (maxButtonsInToolbar > internal.minimumToolbarButtonsInMainToolbar) {
// we do not want to show more buttons than minimum even they would fit
maxButtonsInToolbar = internal.minimumToolbarButtonsInMainToolbar
}
}
let maxButtonsInToolbar = Math.floor( toolbar.width / internal.preferredToolbarButtonWidth )
if ( Screen.primaryOrientation === Qt.PortraitOrientation || Qt.InvertedPortraitOrientation ) {
maxButtonsInToolbar = Math.max( maxButtonsInToolbar, internal.minimumToolbarButtonsInMainToolbar)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would work on mobiles , but when you will play with width on desktop it will be screwed... and we have windows production version at minimum

@PeterPetrik PeterPetrik merged commit 5ae6dbb into master Mar 27, 2024
11 checks passed
@PeterPetrik PeterPetrik deleted the toolbar2 branch March 27, 2024 11:54
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.

None yet

2 participants