-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
new widget from qgis/QGIS#58699
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
|
this is waiting for review... |
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
|
double scaleBarWidth = mPreferredSize / scaleBarUnitsPerPixel; | ||
|
||
//If scale bar is very small reset to 1/4 of the canvas wide | ||
if ( scaleBarWidth < 30 ) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
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
|
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. |
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
Widget after