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

Removed the unused "Size of bar" widget #58699

Closed
wants to merge 1 commit into from

Conversation

goettlic
Copy link

Description

I had a look at the code, the problem is, that the scale bar is always automatically resized between a quarter an a third of the width of the map canvas. So the given number in "Size of bar" has no influence on the size of the bar, because it gets always resized.
I deleted the option to enter the size of the bar, instead it is set to 25 % of the width of the map canvas. Some automatic adjustments are still made if the "Automatically snap to round number on resize" is checked.
Fixes #15647

Widget before
image

Widget after
image

@github-actions github-actions bot added this to the 3.40.0 milestone Sep 12, 2024
Copy link

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit e07ddfe)

goettlic added a commit to goettlic/QGIS-Documentation that referenced this pull request Sep 13, 2024
Copy link

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible
    In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request.
    If there is no further activity on this pull request, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Sep 27, 2024
@goettlic
Copy link
Author

this is waiting for review...

@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Sep 30, 2024
Copy link

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible
    In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request.
    If there is no further activity on this pull request, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Oct 15, 2024
double scaleBarWidth = mPreferredSize / scaleBarUnitsPerPixel;

//If scale bar is very small reset to 1/4 of the canvas wide
if ( scaleBarWidth < 30 )
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't the current logic:

  • start with the preferred size
  • if it's less than 30 pixels, resize to one quarter of the window
  • if it's more than 30% of the window width, resize down

So the preferred size WILL be used if it's > 30 pix and < 30% of window size

Copy link
Author

Choose a reason for hiding this comment

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

Thank you very much for the comment.
The problem is that the inserted value in the dialogue depends on the default range in the QSpinBox class with a maximum of 99. I do not know if it is possible to change that maximum default. So the preferred size will only be recognized if the size of the map canvas and the current map scale suits the inserted value. In my tries that is hardly the case and at least larger numbers are needed.
I think, the user gets more confused if there is the chance to enter a value which is not working properly in most cases. So maybe it is better not to offer the option at all?
Maybe one alternative is to insert a value as a percentage of the map canvas instead of a value in map units. Otherwise the default maximum has to be changed.
I think most people are using the "Automatically snap to round number on resize" check box to get some readable numbers at the scale bar so a approximately fixed length will be fine.
It is my first commit to qgis done at the contributor meeting in Bratislava. I discussed the possible options there with some experienced people and we came to the decision to size it to 25% of the map canvas. In the end we are all do not really use these feature (scale bar decoration) and it is still the question from the original issue #15647 how it should work.
I am thankful for any suggestion to fix this finally!

@nyalldawson nyalldawson removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Oct 17, 2024
Copy link

github-actions bot commented Nov 2, 2024

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible
    In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request.
    If there is no further activity on this pull request, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Nov 2, 2024
Copy link

While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist.

@github-actions github-actions bot closed this Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Uh oh! Seems this work is abandoned, and the PR is about to close.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Size of scale bar on canvas: weird behaviour
2 participants